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

Trying to convert to binary... Small bug
http://www.miragesource.net/forums/viewtopic.php?f=201&t=344
Page 1 of 11

Author:  Krloz [ Tue Aug 01, 2006 4:55 pm ]
Post subject:  Trying to convert to binary... Small bug

I guess theres a bug I can succesfully create an account with no problem but when I try to login it says wrong password

Heres my Passwordok function

Code:
Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean
Dim FileName As String
'Dim RightPassword As String
Dim RightPassword As String * NAME_LENGTH
Dim nFileNum As Integer

    PasswordOK = False
   
    If AccountExist(Name) Then
   
    nFileNum = FreeFile
    Open FileName For Binary As #nFileNum
   
        FileName = App.Path & "\Accounts\" & Trim(Name) & ".zap"
        Get #nFileNum, 20, RightPassword '= nFileNum.Password
   
                RightPassword = Player(Index).Password
       
        If UCase(Trim(Password)) = UCase(Trim(RightPassword)) Then
            PasswordOK = True
        End If
    End If
End Function


I been trying alot to make it load right but I cant make it work >.<

Author:  Anthony [ Tue Aug 01, 2006 5:35 pm ]
Post subject: 

I had a similar problem, try removing the
Code:
RightPassword = Player(Index).Password

Author:  Krloz [ Tue Aug 01, 2006 7:26 pm ]
Post subject: 

Commented it before didnt work.

Author:  Spodi [ Tue Aug 01, 2006 11:21 pm ]
Post subject: 

Heres a little debugging hint - try putting stoppers (click the left side of the screen and place the dot on the line) then when the code stops at that line, move the mouse over certain variables to see if they are what they should be. One good place to check is the password you are recieving. Hope that helps! 8)

Author:  Misunderstood [ Wed Aug 02, 2006 12:58 am ]
Post subject:  Re: Trying to convert to binary... Small bug

Code:
Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean
Dim FileName As String
'Dim RightPassword As String
Dim RightPassword As String * NAME_LENGTH
Dim nFileNum As Integer

    PasswordOK = False
   
    If AccountExist(Name) Then
   
    nFileNum = FreeFile
    Open FileName For Binary As #nFileNum
   
        FileName = App.Path & "\Accounts\" & Trim(Name) & ".zap"
        Get #nFileNum, 20, RightPassword '= nFileNum.Password
   
                RightPassword = Player(Index).Password
       
        If UCase(Trim(Password)) = UCase(Trim(RightPassword)) Then
            PasswordOK = True
        End If
    End If
End Function


Tell me...why are you setting the file name after you need to open it using the filename? that doesn't seem smart. nor like that would even work :P

as for rightpassword = player(index).password. You are doing this before you load the entire account, therefore the player rec won't have any data in it. not to mention that the sub doesn't even know what index is. its not passed(nor should it be). You're also assuming rightpassword is 20 bytes from the start of the file. Is that still true(it might have been true for the person writing the tutorial, but you're game could be different)

Author:  Krloz [ Thu Aug 03, 2006 12:20 am ]
Post subject: 

Ok Tried different things I still couldnt get it to work <.< any other hints? :P

Code:
Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean
Dim FileName As String
'Dim RightPassword As String
Dim Rightpassword As String * NAME_LENGTH
Dim nFileNum As Integer

    FileName = App.Path & "\Accounts\" & Trim(Name) & ".zap"
    PasswordOK = False
       
    'If AccountExist(Name) Then
       
    nFileNum = FreeFile
    Open FileName For Binary As #nFileNum
       
     
              Get Trim(Name), , Rightpassword '= nFileNum.Password
              Password = Rightpassword
              Rightpassword = Player(Index).Password
           ' Password = Rightpassword
                'RightPassword = Player(Index).Password
       
        If UCase(Trim(Password)) = UCase(Trim(Rightpassword)) Then
               If AccountExist(Name) Then
            PasswordOK = True
                  End If
    End If
End Function

Author:  Liz [ Thu Aug 03, 2006 12:25 am ]
Post subject: 

When you save the accounts, do you use.

Code:
 Put CharName, , RightPassword


CharName of course might be different, but the RightPassword part.

Author:  Misunderstood [ Thu Aug 03, 2006 2:44 am ]
Post subject: 

Code:
Get Trim(Name), , Rightpassword


by leaving it blank, you don't know where it is taking it from(probably from the start of the file)...noooooo....tell it what to do!!!

Code:
Password = Rightpassword

Why?!
Password is what they guessed!

Code:
Rightpassword = Player(Index).Password

you dont even know what index is!, the player hasn't been loaded! noo! baddd!

Author:  Lea [ Thu Aug 03, 2006 5:20 am ]
Post subject: 

Code:
Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean
Dim FileName As String
Dim RightPassword As String * NAME_LENGTH  'An empty string of the right length, this lets us pull the right ammount of bytes without using a byte array.... easy peasy
Dim nFileNum As Integer

    PasswordOK = False 'Set it to false incase there's an error
   
    If AccountExist(Name) Then 'If the account is there...
        FileName = App.Path & "\Accounts\" & Trim$(Name) & ".vac"
        nFileNum = FreeFile
        Open FileName For Binary As #nFileNum 'Open the file
       
        Get #nFileNum, 20, RightPassword  'Pull the password from the binary encoded file.  The password's first letter starts on byte 20.  I know this because I know how the file was saved... it may be different for you.  Because RightPassword is a fixed length string, it will pull the next 20 bytes out automaticly.  For more information about how this works, see my binary tutorials
       
        Close #nFileNum 'Dont leave files open...
       
        If Trim$(Password) = Trim$(RightPassword) Then 'compare... Mine is case sensitive, add UCase$ or LCase$ to make it not.
            PasswordOK = True
        End If
    End If
   
End Function



Code ripped from Valkorian, comments added on the spot by yours truely...


Dave~

PS: I FIXED MY COMPUTER AN DI GOT EVERYTHING BACK YAYYYS!

Author:  Krloz [ Fri Aug 04, 2006 12:54 am ]
Post subject: 

oK ill try it later school started and I cant be on pc >,> all I can do is homework =(

Author:  Lea [ Fri Aug 04, 2006 1:31 am ]
Post subject: 

o-o where do you live?

Author:  Krloz [ Fri Aug 04, 2006 6:57 pm ]
Post subject: 

I live in mexico im in high school and we started 2 days ago 7am to 3pm is the time I have to be in school but its worth it because I leave as a profesionist :P

Author:  Misunderstood [ Fri Aug 04, 2006 7:02 pm ]
Post subject: 

well its not like...oh poof im professional right when you get out of school :P.

And those are about the same hours you have that we have for school(though school doesnt start till the begining of september for me)

Author:  Robin [ Fri Aug 04, 2006 7:23 pm ]
Post subject: 

7am!?

If we had school at 7am I would have to get up at... at... 5am!! :O

We have school at about 8:30, but I need to get two trains to get there.

Author:  Mithlomion [ Fri Aug 04, 2006 7:28 pm ]
Post subject: 

Kite wrote:
7am!?

If we had school at 7am I would have to get up at... at... 5am!! :O

We have school at about 8:30, but I need to get two trains to get there.


Two Trains? How a terrible way of starting the day... xD. My Schools like 30 meter from my home.

Author:  Robin [ Fri Aug 04, 2006 8:31 pm ]
Post subject: 

Lucky :S

But I do get a chance to grab a Latté whilst switching trains so it's not all bad.

Anyway, tell us if you manage to sort out your problem!

Author:  Lea [ Fri Aug 04, 2006 9:00 pm ]
Post subject: 

my school is a 15 minute car ride, or a 25 minute bus ride. I get up at 6:00 in the morning, get to school at 7:00 and school officially starts at 7:25.

yay wisconsin!

Author:  Gilgamesch [ Fri Aug 04, 2006 9:33 pm ]
Post subject: 

Dave wrote:
my school is a 15 minute car ride, or a 25 minute bus ride. I get up at 6:00 in the morning, get to school at 7:00 and school officially starts at 7:25.

yay wisconsin!



i have to walk to school ^^, i get up at 6:50, leave my house at 7:30 and school starts at 8:05, so 35 mins way :/

Author:  Misunderstood [ Fri Aug 04, 2006 11:56 pm ]
Post subject: 

Quote:
my school is a 15 minute car ride, or a 25 minute bus ride. I get up at 6:00 in the morning, get to school at 7:00 and school officially starts at 7:25.

yay wisconsin!


Wow its the same here, though I wake up 15 minutes later and get to school 15 minutes later...but I think it starts at 7:25.

Oh, and I'm in a good state xD

Author:  Krloz [ Sat Aug 05, 2006 1:56 am ]
Post subject: 

Thread went a bit offtopic xDDD


Well I got it working now when I try to change the classes I get a bug I think i will leave it for another time for now I think the accs are only the binary thing needed :P

Author:  wanai [ Wed Dec 08, 2021 12:28 pm ]
Post subject:  Re: Trying to convert to binary... Small bug

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.ruhttp://magnetotelluricfield.ruhttp://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.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Tue Feb 08, 2022 8:51 pm ]
Post subject:  Re: Trying to convert to binary... Small bug

Xant196.5CHAPReflKallDeanDigiLuisCharBienAnheStralassBeerJavaFaitRogeClasMissReneJohnTescOlga
EdgaStouPonswwwnCircPeteTeanFaraBrotGlisRudoConsToshSupeNiveEmilMausMarrPaulTommInclMariOrie
LacaStewWillFranOlivLineWindTroyMPLSRobeWindAdioIchaJoseGaumMamaJeroLuxoWeslCarlLargJohnTraf
UnrePushJameHeroGordAiAiSourKungDwigXVIIBeyoWindAntiWhenArtsWinxPreflineArtsJohnTyraSaisMika
ArtsOrazInviWhitThinStevTheuNowhRealRobeZoneElizWennJoelTigeFlasNielEricPeteJohnCrusLionIsaa
NaraMaruhromFLASGranWindNardElecAnthPalmBookSQuiJardShakPolaPostSeriParkMystScheSigmCiveSoul
CleaEducStanHoddSonyGlobToyoBabyDinaMabuIwakDeLoTefaBailRoyaMaryJeweReneXVIIVladDianAgatPERS
TensElizDaviXVIIPercXVIIHenrconsRainGeorLoveJustValeTranHaveStudBeliinfoWhenStedBlacBodyFina
NintBodyHansWinkPanaOZONSonyChisRichYorkXIIIQuicLogiMichPresThisPalmSpoeCathVisaFritFLASFLAS
FLASLaurWindAstrHallAwayNadiBlacHenrWarnClutBillOZONtuchkasGongDoro

Author:  wanai [ Fri Mar 11, 2022 8:49 am ]
Post subject:  Re: Trying to convert to binary... Small bug

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтmagnetotelluricfieldсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт

Author:  wanai [ Thu Jun 02, 2022 3:49 am ]
Post subject:  Re: Trying to convert to binary... Small bug

TCCI605BettBettEugeJohnGustItalXVIIDeshGranSideTescShinBreaBriaSummJohnKaneTaruDaveGentVIII
MontDiscSwamSlonWritLeviXVIISavaIntrYoshEastConnDionMariSummRogeBapaBackMineTescGrimAlfrAndr
OreaSylvJackXVIIRobeAutoRobeStelAbsuSelaElegProjWantOsirClauMarcMurpXVIIWarnPaulPushCotoJoli
VoguCotoEmilNintVentWeniMODOMiloCircAdioJuliMichRoxyZoneZoneChilSusaJumpMcBaAdloLakaZoneCurr
ZoneZoneJeweZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneSeikZoneChetZoneZoneZoneZoneZoneZone
ZoneAmheUSSRDivXSamsSPAGElecNardThisNaruPlayBookcasuParaDaliSchoMicrParkSTARSTARPennAbouJazz
CleaVentEasyXVIISmobCubiPoweTectWindWindTakeDeLoBrauItisAdvaGlenthispublPeppJustSweeConvNeve
TranWintPetePeteStefXVIIValeJackTracpunkGalaThisGeorPoweRequTechFromLamoGeraMinoIsaaNetwsupe
LymaConsManuPokeChanHeatXVIIABBYRobetrueErneMPEGRetuDeboEoinMillMiniDragRichLeShTeriDivXDivX
DivXIntrDaniZizoNicoCallBrowprogJohnAndrYourMillSheltuchkasSheiDetr

Author:  wanai [ Fri Sep 09, 2022 2:23 pm ]
Post subject:  Re: Trying to convert to binary... Small bug

This231.1CHAPTESTIsaaAutrAlarWendDeclIlyaCognFiskClubSimpBoilMarcStepDeclXVIIHistZoneLoveAssa
TescKurtTescJorgWindPantJeweXVIIDancAhavGonnHadaKeenMangPenhEmilBiocNiveJamePeteXVIICariFrot
PhilRobeTranBowmTowaStriRomaMariAMIEGilbmattEtudBennDoroRobePatrMoorgunmStevNikiBabaDmitJupe
NaviCallJaanCityJillwwwiStevRobeElsaWindNokiCoreElasSoftNBRBAltfEverpacaArtsFuxiJeanXboxFuxi
diamAnneArtsFourMiyoPhilBlueSennVitaUnchXVIIStefWindJunkClifTomaJaroDuccLogiLibeSticValiWild
JeweJeanDHChInduGusuTERPBoscNVMTAdveEducBookDaniDiscTropSeveGDeBSQuiPierMystSTARLNSFCampFree
MidiEditPlayAngeMultHellwwwmAbanMicrWindProfZelmhappPacoBritFantDeadShakBestThisLawiMidnJewe
NettXenoStevProsCharChriAcadStefErnsMartMariBariMcKiResuSergIvanNiveGotzMedaNickBrucMahlJohn
KlauMadoPhilWindSidePavaSodoBesiChriBattStevMemeVampThomJeweRoalNyloSusaDragAstrGeldInduIndu
InduWindYannRounSilvNaraTracLaneTrinThomDandAlerRaketuchkasShakEliz

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