Raised This Month: $51 Target: $400
 12% 

Problem with my SQL System


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fireattack
Senior Member
Join Date: Jul 2008
Old 07-31-2011 , 10:03   Problem with my SQL System
Reply With Quote #1

I'm doing a system where people have their own account with password, the problem is when they try to connect with the same account on two servers, they can clone stats so I thought of making a new security system:

User connect so flag on DB `online` put to "1" and I check that, so no more users can connect to this account.

The problem : If the User is playing and someone crash the server I can't put their flag on 0 when he disconnect so that account keep blocked and he can't join again.

I need ideas to fix this, I tried with plugin_end( ) and nothing. Thank you.
fireattack is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-31-2011 , 11:16   Re: Problem with my SQL System
Reply With Quote #2

Code:
register_forward(FM_GameShutdown, "fw_Sys_Error")
?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
fireattack
Senior Member
Join Date: Jul 2008
Old 07-31-2011 , 11:36   Re: Problem with my SQL System
Reply With Quote #3

I'm going to try.

Edit: Not working, but thank you lucas_7_94. Autobuy bug used to test.

Last edited by fireattack; 07-31-2011 at 11:54.
fireattack is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-31-2011 , 11:47   Re: Problem with my SQL System
Reply With Quote #4

First assign unique identifiers to all your servers, then instead of flag in DB `online` make an INT that stores unique identifier of a server on which user has logged in or 0 if user is not logged in.
Second make another table that has 2 columns: server_unique_id int primary_key, last_seen datetime, and make every server update last_seen with current timestamp lets say every 15 seconds.

If user is trying to log in check if he is logged in on some server. If true then check if current timestamp - last_seen is greater than 30 seconds.
Also when server is starting do update of `online` table and set server unique id = 0 where server unique id = id of that server.
__________________
Impossible is Nothing
Sylwester is offline
fireattack
Senior Member
Join Date: Jul 2008
Old 07-31-2011 , 11:55   Re: Problem with my SQL System
Reply With Quote #5

Quote:
Originally Posted by Sylwester View Post
First assign unique identifiers to all your servers, then instead of flag in DB `online` make an INT that stores unique identifier of a server on which user has logged in or 0 if user is not logged in.
Second make another table that has 2 columns: server_unique_id int primary_key, last_seen datetime, and make every server update last_seen with current timestamp lets say every 15 seconds.

If user is trying to log in check if he is logged in on some server. If true then check if current timestamp - last_seen is greater than 30 seconds.
Also when server is starting do update of `online` table and set server unique id = 0 where server unique id = id of that server.
Nice idea, testing.
Edit : Done.

Last edited by fireattack; 07-31-2011 at 16:16.
fireattack is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode