Mirage Source http://web.miragesource.net/forums/ |
|
Don't load the map twice http://web.miragesource.net/forums/viewtopic.php?f=210&t=108 |
Page 1 of 1 |
Author: | Misunderstood [ Sun Jun 04, 2006 11:34 pm ] |
Post subject: | Don't load the map twice |
eh, its somewhat of a bugfix, but I already posted it in tutorials, so heres the link... http://www.ms.shannaracorp.com/forums/viewtopic.php?t=23 What currently happens is the entire map is loaded to get the revision to see if the client has the right version or not, if it does, it loads the map again. What I did was make it load the map, check if it has the right version, if it does, it makes savemap = to the map already loaded, so the map doesn't need to be loaded twice. |
Author: | Bradyok [ Mon Jun 05, 2006 2:55 am ] |
Post subject: | |
I would say that is a bug fix. |
Author: | William [ Mon Jun 05, 2006 6:07 am ] |
Post subject: | |
Yeah thank you Miss, its a bug fix. |
Author: | Lea [ Tue Jun 06, 2006 6:14 pm ] |
Post subject: | |
Can't believe no one has caught that |
Author: | Misunderstood [ Tue Jun 06, 2006 7:24 pm ] |
Post subject: | |
Dave wrote: Can't believe no one has caught that
I was pretty amazed myself . I only found it cause I was moving the client to java. |
Author: | William [ Sat Feb 03, 2007 1:36 pm ] |
Post subject: | |
The url do not longer work, not sure if I remember but should it be like this? Code: If GetMapRevision(x) <> y Then
' We do so we dont need the map ' Load the map Call LoadMap(x) Call SendData("needmap" & SEP_CHAR & "no" & SEP_CHAR & END_CHAR) Exit Sub End If The <> instead of =. |
Author: | Dragoons Master [ Sat Feb 03, 2007 7:13 pm ] |
Post subject: | |
Actualy is = and not <>. If the Revision you have on your map is the same as the one the server has, then you dont need to receive the map and just load it. |
Author: | Misunderstood [ Sat Feb 03, 2007 10:11 pm ] |
Post subject: | |
No. The tutorial replaced GetMapRevision It loaded the map into tempMap after modifing loadmap (or you could have created a getMap to return a map it loads then it checks the revisions, and if equal, it sets savemap = to tempmap |
Author: | Cruzn [ Sat Feb 03, 2007 11:12 pm ] |
Post subject: | |
William wrote: The url do not longer work, not sure if I remember but should it be like this?
http://key2heaven.net/ms/forums/viewtopic.php?t=23 Incase you haven't figured it out already. =) |
Author: | shaded [ Sun May 25, 2008 3:30 am ] |
Post subject: | Re: Don't load the map twice |
Ok I hate to bring this up again(cause of old date), but I noticed that I of course still had the bug where it ALWAYS requested a new map. Well I made these changes and it seems to work perfectly fine now. I Changed: If FileExist(MAP_PATH & "map" & x & MAP_EXT, True) Then To: If FileExist(MAP_PATH & "map" & x & MAP_EXT, False) = True Then Code: If FileExist(MAP_PATH & "map" & x & MAP_EXT, False) = True Then ' Check to see if the revisions match If GetMapRevision(x) = y Then Call LoadMap(x) Call SendData("needmap" & SEP_CHAR & "no" & SEP_CHAR & END_CHAR) Exit Sub End If End If ' Either the revisions didn't match or we dont have the map, so we need it Call SendData("needmap" & SEP_CHAR & "yes" & SEP_CHAR & END_CHAR) Exit Sub End If I tested it and had it display every time I was on a new map or an old map; had my girlfriend make a simple change and it showed I was on a new map. While walking around on the old maps it displayed I was on an old map. I noticed their was an optimizing tutorial and some other stuff. Do they make this any better? Cause the fix I made actually seemed to work perfectly fine all the time and I noticed that the maps were loading quicker. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |