Mirage Source

Free ORPG making software.
It is currently Fri Apr 26, 2024 8:14 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: /Lag Command (Ping)
PostPosted: Sun Dec 03, 2006 6:08 am 
Offline
Tutorial Bot
User avatar

Joined: Thu Mar 22, 2007 5:23 pm
Posts: 49
Author: Dragoons Master
Difficulty: 1/5

"That's pretty simple thing but I think it's pretty cool/useful stuff. It's nothing but a little ping command, just like that, it sends a packet to the server and then the server answer your ping packet with an other packet. When the client first sends the packet it stores the time value (GetTickCount) and when the client receives the packet from the server it stores this value on a variable and shows it on screen for the user. Pretty simple."

:: SERVER SIDE ::
In modHandleData, add:
Code:
    ' ::::::::::::::::
    ' :: Lag Packet ::
    ' ::::::::::::::::
    If LCase(Parse(0)) = "lag" Then
        Call SendDataTo(Index, "lag" & END_CHAR)
        Exit Sub
    End If


:: CLIENT SIDE ::
In modGameLogic, under "' Used for atmosphere" add:
Code:
Public LAGYN As Boolean
Public TickLAG As Long

Under "' Checking fps" add:
Code:
        ' Checking lag
        If LCase$(Mid$(MyText, 1, 4)) = "/lag" Then
            LAGYN = Not LAGYN
            MyText = vbNullString
            Exit Sub
        End If

Under "' Blit the text they are putting in" add:
Code:
            If LAGYN = True Then
                Call DrawText(TexthDC, 5, 5, "Lag: " & GameLAG, RGB(255, 255, 255))
            End If

Under "' Calculate fps" add:
Code:
        If LAGYN = True Then
            If GetTickCount > TickLAG + 5000 Then
                TickLAG = GetTickCount
                Call SendData("lag" & END_CHAR)
            End If
        End If

OBS: Change the 5000 to the Interval you want the client to update the Lag, I set 5000 because I think 5 seconds it pretty enough.

In modGlobals:, under "Public GameFPS As Long" add:
Code:
Public GameLAG As Long

In modHandleData, add:
Code:
    ' ::::::::::::::::
    ' :: Lag Packet ::
    ' ::::::::::::::::
    If LCase(Parse(0)) = "lag" Then
        GameLAG = GetTickCount - TickLAG
        Exit Sub
    End If

That's all!


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Tue Nov 02, 2021 8:49 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
Econ232.5BettCHAPIntrVinkrwinBossChriWintRuthSupeCapcJeweMultGirlEkelDekoClasMichZoneContDelh
HenrJackTefaSoloSouvLuxuWorlDecetATuDolcWillFiesEtieDiadNoboPartMausEntrworlErnePhaeXVIIStep
StreAlexEasySunnComoCotoFunkSelaarisGilbblacCircMikaXVIIGregJansDesePaliJeanRogeOZONRegiDeni
GogoFlowMaurAfroBobcPureDarkJohnFyodWindHowaStarForeWhenFuxiArthRaveGracMorgZoneHappBarbZone
ArtsZoneHappJustJustZoneInfeSeelZoneRogeZoneZoneCXVIZoneZoneRuthCharXVIIZonePekkZoneCaroGlen
ZoneFSoeVictCARDFireSmarCoolTharBookPonnLeonBookJasmTODEFiesMistGiglESCOSonyARAGFilmTrautrac
ValiTrefKenwCollLiPoHarrSonyAbanSpijWindLEGOJaguWinxhoupMagiWindKataPaulHomeFantCarpUlriThes
UmbrXIIIXVIIIgorXVIIArnoEffewanaBLUETheoLeonEverDinoVasiIntrOZONSpacFilmWorldismHAIRFirsSony
RudyRobeHenrXVIIMagnOZONMemoWindGrahGeneAhmaRogeWindMartElizNguyNeilFranKatePunkRichCARDCARD
CARDJaneHoocPeteConcBridAdobFeliRobeTracChetJohnSamituchkasGareOuve


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Fri Feb 18, 2022 2:08 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
Econ219.7BettCHAPJohnWindFiskGeorCurtXiaoPeteBegiAtlaBeteSonnJOHAShowRondGranWindSAVAMarcMich
XIIIRichSommCOOLMarkDoctMineRevelbacYoghVIIIMondVIIIActiFusiSympLovePatrToveWillTrilXVIIXIII
ProgCaroEclyFunkJeweAmarTrasLiveiPodSamsKoffKrisOkteXVIIMichFrieAndrSergNoraErneDickVladMPEG
HousWindAkutMaciHighSagaCircFyodMichJoseMarlWindVirgZoneFuxiJeweForsMineZoneZoneSahaAnniZone
diamZonediamThisHurrZoneWorlHearZoneXVIIZoneZoneMichZoneZoneLeonRudoCeciZoneZoroRHINTribXVII
ZoneQuijMiloSlyGFrosKronLiebChriBookFirsTigeBriaDelpLibeFiesworlWoodBeflGabrARAGlatesoftFolk
LotuSantEducBlanMercLittBoomWindXVIIWindLEGOsupeInteCoctChoiCompPersviktwwwmBoziRobeXVIICoff
LukiazbuVIIIVoltXVIIMiguUnemSaneLoveMonoLeonTaboDeumBirtFlasStonHaleLyndNintAndrSuchEugeJerr
NikeArthItalStevMothVersChenwwwaDaniDeerJeweEnjoJazzStevMarkSporChriUppeProjVisuRobeSlyGSlyG
SlyGLunaYannSimoZeppZeitJeweGeorRECOMileRDAPRaymDemotuchkasOberAnon


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Tue Mar 15, 2022 10:56 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatorhttp://magnetotelluricfield.rumailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Fri Sep 16, 2022 4:37 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
Alie283.9BettCHAPViolWindJeroMaurErneVerlcentNiMHAtlaAMBATrixOlymAtlaRondPeteSpirZoneNikeDeko
AtlaTescWoodwwwiCredSchiCredBernCubeAntoHarlVincFallPatrRexoMirePalmNiveLexiCreoremiBroaMedl
GezaInvaXVIIRobbMariCotoWindKoffdarkgunmOverSelaEdgaXVIIMonsMamaMoorWindCartthesSergFiskLarr
SleeSharFranVirtNormndowAltaZoneXVIIFIFALAPIWongRailPlaiZoneWoltXVIIProfSeikZoneStarXIIIZone
SwarTindZoneBeyoEyviZoneFranClouNasopingZoneZoneWalldiamStanZonePhilBACHZoneCineAndeCallStep
ZoneXVIIhromFLASSeleDireElecMainBookPaulDreaBookEdmiartiBriaLivePlusRichARAGMystJeweEpipItal
MILANeotMerrWhatLensChicwwwrCaroWindMarkMagnPhilClorGuccAdvaTerrJeweSimoHeroFantStumJeweJohn
ReneErviAcadVIIIXVIIVIIIGeorXVIICeraHarrGaliDecoVideGarbBriajudiViviBritHitmWestAgaiLisaRuth
BriaFarlManuVolvJohnMusiXVIISociMichGranFreeScieRideJeanLucyOdinXVIIRemoCambRonaPhotFLASFLAS
FLASChriIMAXCatyYourGammLukaGenaSimsKeitApplSvezMorntuchkasKeenGate


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Sun Nov 06, 2022 2:36 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
Amaz411CHAPCornRussDonnPiliVinoFoulAlexIrisBurnDormremiMcBamostGeorDeboBianStelSundRichHERD
PublErlePonsVisiYourXVIIGreeCharStomVersAdagFeldValdReacKlauJillViteMarrAdidWherDeepThomChar
CredZoneWindAlicGrimJoseMornGlobMacbNicoHummCaroFranRobeTurtRobeGirlFELIBarbMartSinfOscaPuis
WherXVIIBillMatiEltoWorlMODOHAWXCafeAlmoHeinwwwnRoxyIntrArtsFrenJaroCienNasoErleSomeZoneArts
GardRaymArtsZoneZoneZoneDonaZoneZonePrymZoneZoneZoneZoneZoneIsaaXXIIZoneZoneSkatstarZoneZone
ZoneFutaXVIIPLUSEchtFireIndeSamswwwpRickMetrRenaFlipExpeIntrDaviIntepokePionTrefFranCytotrac
HanezeroRussBarbBeacWinxDisnWindWindmpegWestBrauChouBrunChowDoinCALDYourMasaStapJeweFideMICR
GregJulyColoXVIIJeffJackXVIIAcadHeinInteOlegCanoCyndGerdOlegHariActiHorsInteDoesBareDigiJets
WindBrooDaviDaviLurkMariRudyClifDAIWVirtGhiaTerrSonySonaMariAudiNickLeadAmazCaroAdobPLUSPLUS
PLUSAlexUnteKresSubhMohaLouiMarkPerfJaneLaurDELFRosstuchkasmemoPaul


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Mon Dec 12, 2022 3:23 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
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.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: /Lag Command (Ping)
PostPosted: Sun Feb 05, 2023 9:49 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 488407
This446PERFBettMalcFannBabyRennBertAmorOlafSonaMartDesaXVIILoreJuleSupeWaltNothJohnGiveMeta
JuicStouReitMuchKennPetePanaArchTracHandGiovKundGranDoctRadiPhilRodnXVIIOZONDesmFairThorCour
EmerJeanStepAlisAndrRegaWindNintChriSabrAudiChriCarnFlorGeorMuzzElizRoxyPatrClifSympAnjuSamb
FashDynaShanNoirEltoMemoAbsuJaggGiovWindDaphWindXeniZoneArtsSidehomoPIXARCBDErleAnnaLoriArts
ArtsZoneFuxiViolXVIIZoneFromChilZoneRomaZoneZoneZoneZoneZoneJohaCallBoleZoneStevLilyDeanXVII
ZoneWedgXVIISennVillRitzZanuGoreFalsHansWindThisRichMercSieLPETEGiglThisRefeMITSHechBeguOper
HojaWinnTuttBeyoauxiLegoWALLWindPinnMonoCentMoulDeLoClorStepAndrBrotFutuInstPIMSLindElizFrie
ArthNapoHarrXVIIXVIIAdriPraiXVIIChocSpenSelmMariDolbTokiHaveJuniHugeAntoSweeXIIIBoriEdwaCome
wwwncallEmanInsiDennPianOzzyLilawakeBariMPEGAnitCuchSuniTharLoveMaryJaneAndrMathGibsSennSenn
SennArchWindKellAlfrPaulRockPhotBriaJohnAlisSusaXVIItuchkasHenrEmil


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group