desithugg Posted August 21, 2006 Share Posted August 21, 2006 umm i have a login system that compares username/password.Sessions/cookiesbut recently ive been having a problem i use the login system for my rpg.Which contains of a battle system.But some users have decided to team up and train in one account at the same time.So they go way faster.Is there any way i can only have 1 person per account logged in at a time.I was thinking of making something like a session id.I pick randome (phrases) containing number,letters 29 characters long each.which is stored in the users table and the other is stored in the ips table.Than i receive the one from the ip using the persons ip and compare it to the one in the users table where the username mathches and if the Two rows match it lets the person continue and if not the person cant battle.Umm thats the best i could come up with/think of.Im not sure if it will work im assuming it will.But any1 have any other ideas.? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 when someone logs in store their ip address in the table next to their username.on each login check to see if the current ipaddress is the same as the one in the database if not boot em.You will also have to store the last time they did sent a request - so each page will have to update that. If they have been inactive for say 20 mins then allow login for that username from anywhere once more. Quote Link to comment Share on other sites More sharing options...
desithugg Posted August 21, 2006 Author Share Posted August 21, 2006 umm lemme make sure im understanding you.So when a person logs in i store their ip next to their username and what time.Each page i can include an updatetime.php so the time iwll be updated.So if they have been inactive for more than 20 mins they get logged out.And than if they have been active in the last 20 mins i only let the stored ip address come in.Sorry if im confusing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.