Register for your free account! | Forgot your password?

You last visited: Today at 05:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Loading Maps

Discussion on Loading Maps within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Loading Maps

Would this be a good way to load maps with settings?
Code:
        public static void Load()
        {
            try
            {
                for (int i = 0; i < MapIDs.Length; i++)
                {
                    IniFile I = new IniFile(Path + MapIDs[i]);

                    Attack.PKMap pkmap = new Attack.PKMap();
                    pkmap.FreePK = I.ReadBool("PKMap", "FreePK", 0);
                    pkmap.PKPointsGain = I.ReadUInt16("PKMap", "PKPoints", 10);
                    pkmap.CanKill = I.ReadBool("PKMap", "KillMap", 0);
                    pkmap.RandomSpawn = I.ReadBool("PKMap", "RandomSpawn", 0);

                    Core.Map map = new Core.Map(pkmap);
                    map.MapID = I.ReadUInt16("Map", "MapID", 0);
                    map.DefaultX = I.ReadUInt16("Map", "X", 0);
                    map.DefaultY = I.ReadUInt16("Map", "Y", 0);
                    map.Password = I.ReadString("Map", "Password", "");
                    map.MaxPlayers = I.ReadUInt16("Map", "MaxPlayers", 0);//0 = no limit

                    DMaps.Load(map);
                }
            }
            catch (Exception Exc) { Console.WriteLine(Exc.ToString()); }
        }
Syst3m_W1z4rd is offline  
Old 04/08/2011, 11:26   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Should check out what I released a couple months back.. speeds the whole thing up.

I don't load all the maps at once only the main once(tc,bi etc) theres about 7 of those then if someone was to enter the PK map it would very quickly and efficiently load the map while the player has 0 idea that the map only just got loaded. that way you only load the maps that get used no point loading more then you need.
_DreadNought_ is offline  
Thanks
1 User
Old 04/08/2011, 11:28   #3
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
I will be checking that out

This, right?
Syst3m_W1z4rd is offline  
Old 04/08/2011, 11:35   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Yup might wonna clean it up a lil(wasn't gonna release the best) but that works very well and fast.
another void I used was uhm.. when a player goes into a map it checks if its loaded.. eg
Code:
public bool isLoad(uint _ID)
{
if (maps.contains(_ID))
return true;
else
return false;
}
usage
Code:
if (!isLoaded(ID))
Load(ID);
_DreadNought_ is offline  
Old 04/08/2011, 13:25   #5
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
I won't be using the code you provided, but I will be doing it the same way. Like loading the maps when needed Thanks again. Oh and I'm always shorting down things like :P
Syst3m_W1z4rd is offline  
Old 04/08/2011, 18:53   #6
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
_DreadNought_ is offline  
Reply


Similar Threads Similar Threads
[Koordinaten] Alle Maps ; Neue Maps ; Unbekannte Maps.
04/08/2013 - Metin2 PServer Guides & Strategies - 28 Replies
Hallu o.o Das Tool von Eddy˛ hat mich auf die Idee gebracht, alle Orte mal aufzulisten, mit den Koordinaten die man brauch um sich dahin zu teleportieren ;D Rotes Reich Map1 /warp 4742 9544 Rotes Reich Map2 /warp 3529 8825
Help? 5095 Source gets stuck at loading maps.
09/20/2010 - CO2 Private Server - 3 Replies
I am using the CoEmuV2 source, and when i try to open the gameserver, it gets stuck after loading the maps.



All times are GMT +2. The time now is 05:03.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.