Mirage Source
3.0.7 help - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 3.x.x, MSx (https://mirage-engine.uk/forums/forumdisplay.php?fid=45)
+----- Thread: 3.0.7 help (/showthread.php?tid=1388)



3.0.7 help - Beres - 11-11-2007

Ok, i got the database working but when I go to make an character, when I click create, it gives my server an error and highlights

If .FKey = 0 Then
.FKey = RS!FKey
End If

Whats wrong?


Re: 3.0.7 help - William - 12-11-2007

What error number do you get, and what does it say?


Re: 3.0.7 help - Beres - 12-11-2007

Ok, everything works fine. I log into my account, click create new character, enter a character name and choose my class, then when I click on create it gives me:

Compile Error:

Invalid or unqualified reference

And it highlights the .FKey in the If .FKey = 0 Then

Code:
Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long)
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
Dim I As Long

        RS.Open "SELECT * FROM characters;", Conn_Client, adOpenStatic, adLockOptimistic
        RS.AddNew

        RS!Account = Player(Index).FKey
        RS!Name = Trim$(Name)
        RS!Sex = Sex
        RS!Class = ClassNum
        RS!Sprite = Class(ClassNum).Sprite
        RS!Level = 1
        RS!str = Class(ClassNum).str
        RS!DEF = Class(ClassNum).DEF
        RS!SPEED = Class(ClassNum).SPEED
        RS!MAGI = Class(ClassNum).MAGI
        RS!Map = 1
        RS!X = 1
        RS!Y = 1
        RS!HP = 10
        RS!MP = 10
        RS!SP = 10
        RS.Update
    
    If .FKey = 0 Then
        .FKey = RS!FKey
    End If

    RS.Close
    Set RS = Nothing
End Sub



Re: 3.0.7 help - Dragoons Master - 12-11-2007

Replace:
If .FKey = 0 Then
.FKey = RS!FKey
End If
with:
If Player(Index).FKey = 0 Then
Player(Index).FKey = RS!FKey
End If


Re: 3.0.7 help - Rian - 12-11-2007

Hmm. I really don't understand much of the SQL related stuff in VB, but it looks like it should be in some sort of With


Re: 3.0.7 help - Beres - 12-11-2007

Dragoons Master Wrote:Replace:
If .FKey = 0 Then
.FKey = RS!FKey
End If
with:
If Player(Index).FKey = 0 Then
Player(Index).FKey = RS!FKey
End If

I did do that and it totally froze up my server..


Re: 3.0.7 help - Dragoons Master - 12-11-2007

Well, it fixed your error, but now you have a new one. Before you click on create account, go to the server and stop it then press F8, and then click on create account. You'll see that the server is running line by line, so you can press F8 a few times and make sure where the bug is, I mean the line...


Re: 3.0.7 help - Beres - 12-11-2007

Ok I would try this, but now it keeps saying "Access Denied" when I click on create char


Re: 3.0.7 help - Dragoons Master - 12-11-2007

You need to be an administrator to run a server... I think that's the problem.
You realy need to xD
Edit:
Btw, is this a system msg or an error or what?


Re: 3.0.7 help - Beres - 12-11-2007

Like it worked when I made a new account, its a msgbox error


Re: 3.0.7 help - Dragoons Master - 12-11-2007

There is no msg like "Access Denied" in vanila MSE... I don't know... I don't think this is a msgbox from MSE, it probably is a problem w/ your access level...


Re: 3.0.7 help - Beres - 12-11-2007

Well I dont know.. I downloaded 3.0.7 bcuz I would really love to use a database. I used that 3.0.7 installation guide which is stickied and then used his dump file which set up my database. Now, everything runs fine except creating a new character. I put in the Sub AddChar from the installation guide and it doesnt work.


Re: 3.0.7 help - Dragoons Master - 12-11-2007

Take a look at MySql user information, now that you said this, I think it is your MySql user that does not have the permissions to create a new record. Take a look at that!


Re: 3.0.7 help - William - 12-11-2007

Quote:I recommened using my sql dump. This will give you 5 maps, 5 shops, 5 items, 5 npcs, and 5 spells. Set your MAX_ variables to equal these (both client and server) and test out your 3.0.7 server.
Did you sett all MAX_ to 5?


Re: 3.0.7 help - Cruzn - 12-11-2007

Sorry, this is the sub that should've been posted (my bad) with my guide:
Code:
Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long)
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
            
        RS.Open "SELECT * FROM characters;", Conn_Client, adOpenStatic, adLockOptimistic
        RS.AddNew

        RS!Account = Player(Index).FKey
        RS!Name = Trim(Name)
        RS!Sex = Sex
        RS!Class = ClassNum
        RS!Sprite = Class(ClassNum).Sprite
        RS!Level = 1
        RS!str = Class(ClassNum).str
        RS!DEF = Class(ClassNum).DEF
        RS!SPEED = Class(ClassNum).SPEED
        RS!MAGI = Class(ClassNum).MAGI
        RS!Map = 1
        RS!X = 1
        RS!Y = 1
        RS!HP = 10
        RS!MP = 10
        RS!SP = 10
        RS.Update
    
    If Player(Index).Char(CharNum).FKey = 0 Then
        Player(Index).Char(CharNum).FKey = RS!FKey
    End If

    RS.Close
    Set RS = Nothing
End Sub
Give that a try.
If that still doesn't work, you can just use my download link: http://www.talkanime.net/3.0.7/MS3.0.7v2.rar MS 3.0.7 which has all of the fixes/changes mentioned in my guide implemented.

William Wrote:
Quote:I recommened using my sql dump. This will give you 5 maps, 5 shops, 5 items, 5 npcs, and 5 spells. Set your MAX_ variables to equal these (both client and server) and test out your 3.0.7 server.
Did you sett all MAX_ to 5?
=P If he didn't change the MAX values, the server wouldn't start at all.


Re: 3.0.7 help - Beres - 12-11-2007

Ok cruzn, thx. I downloaded that one from your link and well, I set up the db and it worked. But now when I click on create character, it says connected and all that but the server totally freezes..


Re: 3.0.7 help - El_Dindonnier - 14-11-2007

Beres Wrote:Ok cruzn, thx. I downloaded that one from your link and well, I set up the db and it worked. But now when I click on create character, it says connected and all that but the server totally freezes..

I have the same problem, can I help me please ?

(thanks you in advance)

El_Dindonnier.


Re: 3.0.7 help - Beres - 14-11-2007

I actually got this working now.. What I did was just download the old 3.0.7, and did the installation guide.. EXCEPT, I didnt put in the AddChar sub. I left it as it was and well it connects and everything runs fine.