Login Error

O.K. I’m using Mirage Legacy, and don’t criticize that, but I’m having a problem logging. The problem is that the game is telling me that the password is incorrect. I have a long user name and it touches the password in the .bin file. I’m thinking that the game is reading it weirdly but I haven’t had an issue on other versions. If anyone has had and fixed this problem or has any USEFUL suggestions, then please share them. (Useful doesn’t mean say switch engines)

does your username happen to have numbers in it? EO seems to have a thing where it doesn’t read numbers correctly from dat files

No, it’s Mohenjo Daro. I have used an underscore instead of a space too, the error was still showing up.

Most likely you have the exact same password as another account on the server OR your name is too long for the account name string.


~Select a new password

~Edit this line of code:

Public Const ACCOUNT_LENGTH As Byte = 12

to suit your needs

Well, I did find the line of code, changed it, tried it, and it’s still giving me the same error plus out or range 9 and overflow 6, any other ideas?

Hmmm. You’d need to delete the account you’ve made after you changed that constant if I’m correct.

You’ll also have to change that constant on the server side as well.

Try that while I search for a fix

O.K., I tried that too, still no luck.

Well snap. I’m sorry mate, it appears I can’t help you here 😕

Well thanks for trying. I know that if I use a shorter username and then my normal long name for the game name then it works, but I’d rather have both be my normal, guess I’ll have to keep trying.

What sort of characters does your password contain exactly? VB6 does not take kindly to any non-standard letters and symbols can at times cause a few odd issues. (Also have you tried debugging to see what password the server receives? Maybe it’s somehow sending skewed data or incomplete data)

Ok, I am using normal letters and a space or underscore depending. I do not know how to see what it is saying I am sending and see what it wants me to send. I have looked into the .bin file and have seen that everything is there, but my username, password, and account name are all 12 letters long, if that many have something to do with it.

It’s mainly to due to how the password is read in the server.

You have to read the password as (ACCOUNT_LENGTH + 1)

Because it grabs the character before the first letter of the password for some odd reason.

Just replace the server code function; PasswordOk with this:

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 Long

    If AccountExist(Name) Then
        filename = App.Path & "\data\accounts\" & Trim$(Name) & ".bin"
        nFileNum = FreeFile
        Open filename For Binary As #nFileNum
        Get #nFileNum, ACCOUNT_LENGTH + 1, RightPassword
        Close #nFileNum
    End If

        If UCase$(Trim$(Password)) = UCase$(Trim$(RightPassword)) Then
            PasswordOK = True
        End If
End Function

This fix was by DaveMax.

The reason, I think, is because the numbers start at 0, but how this code is suppose to fix this, I haven’t a clue. I did replace the code with this but, sadly, it did not fix the problem.

The .dat file for the account allocates the memory values for NAME_LENGTH and ACCOUNT_LENGTH…

Skywards fix would work but you’d have to delete all your accounts before it works correctly, because your existing .dats are already allocated.

So since your account name reaches the max of 12, the code as is in EO 2.0 reads 1 character before the actual password.

My .dat file is like this:


So it has null characters before the password, which isn’t be read by the code, because the Trim$() removes null characters before/after strings.

Your .dat file is assumed to be like this:


Try logging in with the last character of your account name + password. oPASSWORD

The fix I posted above should have fixed this if this is your problem.

Oh? I thought this was fixed ages ago. Guess I was mistaken there.

Stein, please read my whole problem, this is Mirage Legacy, it was an older custom engine. Anyways, you’re right Richy, it is taking in the last letter and applying that to the password. I’ll look into the code a bit more and see if I can see why the code you gave isn’t working.

Log in to reply