Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Login Error


Mohenjo Daro
 Share

Recommended Posts

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)
Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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:

> Richy       TESTPASSWORD

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:

> Mohenjo DaroTESTPASSWORD

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...