vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Wed Jun 19, 2013 12:51 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Add user id in mysql
PostPosted: Sun Oct 17, 2010 5:10 am 
Fresh Meat

Joined: Mon Oct 20, 2008 11:47 am
Posts: 22
Hi,
I want add user id when an user register, but i have difficult to find where the register code are in source.
It's certainly in server part but i didn't find.


Top
 Profile  
 
 Post subject: Re: Add user id in mysql
PostPosted: Sun Oct 17, 2010 9:42 am 
Wizard of Xor

Joined: Tue Mar 17, 2009 3:48 pm
Posts: 238
I believe it already assigns each user an ID.


Top
 Profile  
 
 Post subject: Re: Add user id in mysql
PostPosted: Mon Oct 18, 2010 8:05 am 
Fresh Meat

Joined: Mon Oct 20, 2008 11:47 am
Posts: 22
paxtenus wrote:
I believe it already assigns each user an ID.

No, if you see in vbgore.sql you didn't see user id for each user so in phpmyadmin i have add an fields whose name is "user_id" but when i register with the client the user id in phpmyadmin is always 0


Top
 Profile  
 
 Post subject: Re: Add user id in mysql
PostPosted: Mon Oct 18, 2010 2:53 pm 
Wizard of Xor

Joined: Tue Mar 17, 2009 3:48 pm
Posts: 238
In FileIO.bas:

In Sub Load_User

After:
Code:
With DB_RS


Add:

Code:
UserList(UserIndex).id = Val(!id)


--

In TCP.bas:

In Sub User_ConnectNew:

After:

Code:
        TempObjs(i).Amount = Int(Rnd * 10) + 1
    Next i


Add:
Code:
DB_Conn.Execute "SELECT * FROM users ORDER BY id DESC LIMIT 1"

UserList(UserIndex).id = Val(DB_RS!id) + 1


In Declares.bas:

In Declarations:

After:

Code:
Type User   'Holds data for a user


Add:

Code:
id As Integer



That should work, though it hasn't been tested. Let me know if it doesn't. You'll have to replace all currently-existing users' IDs, though.


Top
 Profile  
 
 Post subject: Re: Add user id in mysql
PostPosted: Tue Oct 19, 2010 9:44 am 
Fresh Meat

Joined: Mon Oct 20, 2008 11:47 am
Posts: 22
paxtenus wrote:
In FileIO.bas:

In Sub Load_User

After:
Code:
With DB_RS


Add:

Code:
UserList(UserIndex).id = Val(!id)


--

In TCP.bas:

In Sub User_ConnectNew:

After:

Code:
        TempObjs(i).Amount = Int(Rnd * 10) + 1
    Next i


Add:
Code:
DB_Conn.Execute "SELECT * FROM users ORDER BY id DESC LIMIT 1"

UserList(UserIndex).id = Val(DB_RS!id) + 1


In Declares.bas:

In Declarations:

After:

Code:
Type User   'Holds data for a user


Add:

Code:
id As Integer



That should work, though it hasn't been tested. Let me know if it doesn't. You'll have to replace all currently-existing users' IDs, though.


Hey, thank you very much it's nice of you, alternatively i had deleted register from client and i make an web register


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group