| Mirage Source http://miragesource.net/forums/ |
|
| Problem with Binary.. http://miragesource.net/forums/viewtopic.php?f=201&t=837 |
Page 1 of 1 |
| Author: | Matt [ Wed Dec 13, 2006 12:33 am ] |
| Post subject: | Problem with Binary.. |
I recently added the binary accounts tut that Dave posted. I can create an account and login, but I can not create an account. For some reason, when creating an account it saves it as \accounts\advocate.doa but when I create a character, it does not pass the login name, so I end up getting my character in a file named like this: \accounts\.doa I can not figure out for the life of me what's wrong with it. Any help would be much appreciated. |
|
| Author: | Tony [ Wed Dec 13, 2006 12:55 am ] |
| Post subject: | |
Hmmph can you update me on what you've updated so far with binary technique? :: Pando |
|
| Author: | Matt [ Wed Dec 13, 2006 1:05 am ] |
| Post subject: | |
SavePlayer, LoadPlayer, AccountExist, PasswordOK. I think that's it. AccountExist, I just updated the file type from ini to doa. |
|
| Author: | Tony [ Wed Dec 13, 2006 1:09 am ] |
| Post subject: | |
Hmmph you should try testing if inputting anything into login username & password works. If so its most likely your PasswordOK sub. Here you go: Code: Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean
Dim FileName As String Dim RightPassword As String * NAME_LENGTH Dim nFileNum As Integer PasswordOK = False If AccountExist(Name) Then FileName = App.Path & "\Accounts\" & Trim$(Name) & ".dat" nFileNum = FreeFile Open FileName For Binary As #nFileNum Get #nFileNum, 20, RightPassword Close #nFileNum If UCase$(Trim$(Password)) = UCase$(Trim$(RightPassword)) Then PasswordOK = True End If End If End Function :: Pando |
|
| Author: | Matt [ Wed Dec 13, 2006 1:12 am ] |
| Post subject: | |
That's how mine looks, aside from it being \data\accounts\ I'm thinking it's SavePlayer. But I can't find anything wrong with it. |
|
| Author: | Tony [ Wed Dec 13, 2006 1:19 am ] |
| Post subject: | |
Ill give you the slight bit of my sub. Code: Sub SavePlayer(ByVal index As Long)
Dim FileName As String Dim i As Long Dim n As Long Dim nFileNum As Integer FileName = App.Path & "\Accounts\" & Trim$(Player(index).Login) & ".dat" If FileExist(FileName, True) Then Kill FileName nFileNum = FreeFile Open FileName For Binary As #nFileNum If you just modified those subs, I really don't understand what the problem could possibly be. CAPS: SINCE YOU CHANGED IT TO DATA/ACCOUNTS/FILENAME.DOA MAKE SURE YOU UPDATE ACCOUNTEXIST AND ETC. :: Pando |
|
| Author: | Obsidian [ Wed Dec 13, 2006 1:28 am ] |
| Post subject: | |
I'm working with him right now... it should be completely working soon. No worries. [Edit] 2 Minutes Later........ Working.... |
|
| Author: | pingu [ Wed Dec 13, 2006 1:30 am ] |
| Post subject: | |
Obviously, "Trim$(Player(index).Login)" is returning null for some reason. |
|
| Author: | Matt [ Wed Dec 13, 2006 1:39 am ] |
| Post subject: | |
Lol. It was an idiot move on my behalf. I currently cleaned everything up, and moved everything inside a data folder. I forgot to add the /data in front of the /accounts in sub LoadPlayer. Lol. |
|
| Author: | Tony [ Wed Dec 13, 2006 1:57 am ] |
| Post subject: | |
Obsidian wrote: I'm working with him right now... it should be completely working soon. No worries.
[Edit] 2 Minutes Later........ Working.... :O! But but but but but I edited my post before and.. NVM lol your good Obsidian. :: Pando |
|
| Author: | Obsidian [ Wed Dec 13, 2006 2:01 am ] |
| Post subject: | |
Haha, thanks pando. Yeah they were a couple of simple mistakes, but he's got it working now. All is well. By the way, pingu, it was returning null, because he didn't set the correct filename path in the loadplayer sub. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|