Mirage Source
http://www.miragesource.net/forums/

Don't load the map twice
http://www.miragesource.net/forums/viewtopic.php?f=210&t=23
Page 1 of 2

Author:  Misunderstood [ Thu Jun 01, 2006 2:47 am ]
Post subject:  Don't load the map twice

in the checkmap packet...find this:
Code:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, True) Then
            ' Check to see if the revisions match
            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
        End If


well then lets carry on.
you know what getmaprevision does? it loads the map, then if it is the same, it loads it again? wtf!

soooo
make a new function in mod datebase called getMap, something like this
Code:
Public Function getMap(ByVal MapNum As Long) As MapRec
Dim FileName As String
Dim f As Long

    FileName = App.Path & MAP_PATH & "map" & MapNum & MAP_EXT
       
    f = FreeFile
    Open FileName For Binary As #f
        Get #f, , getMap
    Close #f
End Function


though it would be better if you just made loadmap a function with this code from above and have every instance of call loadmap(mapnum) (or most anyway) be changed to SaveMap=LoadMap(mapNum)

now change the first code I showed(the part in the checkmap packet)
change it to something like thiiiis:
Code:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, True) Then
            ' Check to see if the revisions match
            Dim tempMap As MapRec
            tempMap = getMap(x)
            If tempMap.Revision = y Then
                SaveMap = tempMap
             
                Call SendData("needmap" & SEP_CHAR & "no" & SEP_CHAR & END_CHAR)
                Exit Sub
            End If
        End If


[If you did it the other way and made loadMap a function instead of making a redundant getMap function then good for you, you should then be smart enough to know what to do(change get for load here)]

tada, I sound like an idiot, but you SHOULD get what im sayin, why didnt anyone notice this before? gah.

Author:  William [ Thu Jun 01, 2006 8:21 am ]
Post subject: 

Wont this screw things up. Cause what if I play and get map 1,2,3.. And then the owner edits map 2. And then i wont get it again because if I have map2. Skip to reload it ?

Author:  Obsidian [ Thu Jun 01, 2006 5:42 pm ]
Post subject: 

If the revision is different then it saves the map again. Otherwise, you recieve the map (and before it saves) it loads the map, then it saves the map, and loads it again.

Author:  William [ Thu Jun 01, 2006 6:09 pm ]
Post subject: 

Obsidian wrote:
If the revision is different then it saves the map again. Otherwise, you recieve the map (and before it saves) it loads the map, then it saves the map, and loads it again.


Aha, okay.

Author:  Krloz [ Sat Jul 01, 2006 2:57 am ]
Post subject: 

I cant compile this I get errors >,>

"Only comments may appear after End Sub , End Function , or End Property."

And it highlights MAP_PATH , I deleted all comments since it says so but it wont fix it

Author:  Misunderstood [ Sat Jul 01, 2006 3:25 am ]
Post subject: 

This is for MSE, im guessing you have an older MS or are using elysium?

just replace whatever is the right filepath to your maps folder, in mse MAP_PATH is a constant which equals "/maps/" I think. So you can just substitute that value in.

Author:  Krloz [ Sat Jul 01, 2006 3:48 am ]
Post subject: 

Oh no the path is /maps/ I saw it and Im using ME I wont use elysium because I want to do all by myself and learn

Author:  Misunderstood [ Sat Jul 01, 2006 4:46 am ]
Post subject: 

I dunno...its problably some stupid mistake you did, happens to me all the time. Try posting the whole section (everyting in the "checkformap" packet if block).

Author:  Robin [ Sat Jul 01, 2006 11:10 am ]
Post subject: 

Krloz wrote:
I cant compile this I get errors >,>

"Only comments may appear after End Sub , End Function , or End Property."

And it highlights MAP_PATH , I deleted all comments since it says so but it wont fix it


It didn't ask you to delete all comments, it said that 'only comments may appear after End Sub...'

This means you have something that is not in a sub, and only lines of code with a " ' " may appear outside of a sub (or a function... or a Property)

Make sure all your code is inside a valid sub.

Author:  Krloz [ Sat Jul 01, 2006 5:54 pm ]
Post subject: 

Ok Fixed that but now everytime I try to compile I get another error

"Exit function not allowed in Sub or Property"

I tried to commenting the exit function but when I try to compile it goes to the next exit function and the same error I tried to change exit sub to exit function , didnt work,

Tried to comment every exit function I get error but It wont work o.O

Author:  Dr. Spoon [ Sat Jul 01, 2006 6:02 pm ]
Post subject: 

maybe it should be an Exit Sub instead?

Author:  Krloz [ Sat Jul 01, 2006 6:08 pm ]
Post subject: 

Ya dr.spoon ur right =D Good to see you here :P


Fixes for it :
Changed every exit function to exit sub.

Author:  Misunderstood [ Sat Jul 01, 2006 7:23 pm ]
Post subject: 

What does this have to do with my tutorial? If you have problems of your own not relating to the tutorial please make them in their own topic, I don't see exit function anywhere in my tutorial.

Author:  Krloz [ Sat Jul 01, 2006 7:35 pm ]
Post subject: 

Just posting it there if someone else has this problem... I am trying to help >,>

Author:  Misunderstood [ Sat Jul 01, 2006 9:07 pm ]
Post subject: 

I'm not mad at you for posting the solution..posting your solutions is good, its just, I don't think you should have asked your question here in the first place. Unless you thought it was because of this tutorial.

Its just, it wasnt my tutorial that caused the problem and its mainly for the future, post in troubleshooting, unless it actually involves the tutorial you're posting in. :\

How can you make sure? Only do one thing at a time before testing so its easier to find what may be causing the problem. ;)

Author:  Coke [ Sun Aug 20, 2006 12:51 pm ]
Post subject: 

I get exactly the same error as him hrhr,

its the code directly beneath what you changed

Code:
        ' 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 Function
    End If


I dont see how it was a function in the first place but meh

Edit:

lol even though i undid the stages in this tutorial its still giving me this error now. Bloody wierd, and bloody annoying...

-raises hand-

A little help? ^_^

How has the exit function sat there quite happily untill this happened? =p

Edit 2: It now disagree's with ever exit function in sub handledata, changing all to exit sub... dunno what has happened >.>

Author:  Misunderstood [ Sun Aug 20, 2006 5:28 pm ]
Post subject: 

You're weird. :P

Are you still having problems? I can't tell...

Author:  Lea [ Sat Jul 21, 2007 4:56 am ]
Post subject:  Re: Don't load the map twice

You guys make this stuff too hard...

Code:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, True) Then
            ' Check to see if the revisions match
            Call LoadMap(x)
            If SaveMap.Revision = y Then
                Call SendData("needmap" & SEP_CHAR & "no" & SEP_CHAR & END_CHAR)
                Exit Sub
            End If
        End If

Author:  Matt [ Sat Jul 21, 2007 1:16 pm ]
Post subject:  Re: Don't load the map twice

So is that just an easier method Dave or what?

(I never read through the original code..)

Author:  Lea [ Sat Jul 21, 2007 1:36 pm ]
Post subject:  Re: Don't load the map twice

Well, I'd say it's better than making a new function that returns a map structure.

This way, you remove a function :D

Author:  Matt [ Sat Jul 21, 2007 7:30 pm ]
Post subject:  Re: Don't load the map twice

Ah. Like I said, I didn't read through the tutorial in the first place.

Author:  wanai [ Thu Dec 16, 2021 11:07 am ]
Post subject:  Re: Don't load the map twice

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Fri Feb 11, 2022 3:46 am ]
Post subject:  Re: Don't load the map twice

anzi92.67ReprBettThomLindLastBellManlEpicMarcXVIIIstvYuriOasiTescImprYoshJasoJameChinXIIISelz
BonuMathDaviTescEmilCredMoreGeorJackBarlJeanJohnEdgaComeAlexNiveXVIIXaviJuliBlanTescPaleRobe
LineMenaTumbCharJulePRODCrosYogaELEGWorlElegRHEIPortthesClaumattJeveHamiDiscAromGeorArnoBlue
GeorFunkRoxySelaCircElegHansXVIIRudoFeliElisArthSelaDoroZoneGallZoneDigiJeweBlacAdioZoneBeyo
ZoneZoneJeweZoneZoneSureXVIIZoneZoneXVIIXueqZoneZoneMargZoneJameZoneZoneZoneZoneTourZoneZone
ZonecraqFranTRASTuanDaviBoscIndeMartGuitZackSwarEdmiAlicRenzDiarOlmeKareCadiDobrXXIITextThro
PELOKarmEditKarlHautTranXVIIwwwnPoweWindElegBrauViteLaguChowhousGoveKareXVIIscumVelvAgatRena
XVIIImagRichGenrMaurEditEmilworlTotaBertDustLeonFascJustLogiLittVidaPeteAnchSCTPThisJameFros
PACMLarrJennJeanHervTrinWindMoirJohnSpinAsheJohnLisaJeanRichEricKarlLeShNighRoamGhiaTRASTRAS
TRASIcedMakifolkRoofFeatHardPhotGrzeBernSkipDolpPomituchkasUsinNigh

Author:  wanai [ Sun Mar 13, 2022 4:16 pm ]
Post subject:  Re: Don't load the map twice

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruинфоhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Thu Jun 16, 2022 5:27 pm ]
Post subject:  Re: Don't load the map twice

Blat244.6BettCHAPTricBretGuruDreaCharJingDeniNanoFrieJillWillPaulDaviOmegHeavPrimZoneTescChri
IzerXVIIRayeProvOreaXVIIMatiYourRighAquoXVIIMornMancRobeBrunCompSunsSummShamFredLEGOExpeShin
CantJeweRichFourHenrWindFielsilvRobbFranRaymModoWindCircBounNikiAdaxMalcNikiNikiJamePushRoma
FyodOceaFeliJorgAcroVictRyujMiyoQuikVIIIZoneSwarJourGranHughZoneRubyCandLuciPhilZoneHayaMart
XXVISongiftiJaneChriRobeChetShucmailZoneFirsPatrJameBessDisnZoneZoneWarnMileMORGZoneBrenEric
PonyFragWarsmicrCampEduaElecTekawwwnDoniBookFiesThisChicWoodXVIISmalSpirSTARLEGESkynAnaecoun
COUNEditExecYourLiveToloGreaDereStarWindJohaDremTefaMexxWhisCultPravGoodKansLukiUnleDolpVoce
PromESETJuliKathBernAcadUnitThomAcadToniDigiFranElguDigiPoweSeedFUSIChriSPSSProdSusaWorlWind
CameEnjoDickEcolStevOnceJeweJoseWindShadJeweAudiAmerFranFavoMichStonWordJuliMillSeanmicrmicr
micrTopsDigiForwDarkMacDDrafUriaDaviJinnMillTastauthtuchkasIrenXVII

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/