Author Topic: How do you handle multiple logins?  (Read 1086 times)

Offline Qwerty

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
How do you handle multiple logins?
« on: January 11, 2009, 06:23:25 PM »
I have a little problem with my game,

I haven't got something that checks if the user is already logged in when they try to log in. Should I have it so that they need to wait until their account sessions expires or automatically expire the previous session when they log in?
- "I sentance you to life"
- "You moron I'm already alive"

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 588
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: How do you handle multiple logins?
« Reply #1 on: January 11, 2009, 06:34:01 PM »
Is there a benefit of having multiple logins for a player?

With the advent of tabs sometimes I find myself opening a new tab in a game to complete the task at hand then close that tab.

I had a pretty intense attack code that would keep a player's record open during the attack. To prevent them from doing something else while attacking I placed a field in the database called isattack. If it was zero, they were not attacking and things could go on as they do. Set to one and everything the player could do in the game was blocked until the attack was resolved.

Creating online addictions, one game at a time:

Offline Qwerty

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
Re: How do you handle multiple logins?
« Reply #2 on: January 11, 2009, 07:32:21 PM »
I was thinking more about hackers and such, as well as accidently closing the window, and starting a new session. I have functions that handle user activities if they are fighting, harvesting, cooking, etc.
- "I sentance you to life"
- "You moron I'm already alive"

Offline MystressNyx

  • Administrator
  • Level 16
  • *****
  • Posts: 139
  • Reputation: +6/-0
    • View Profile
    • eXtremeCast Games
Re: How do you handle multiple logins?
« Reply #3 on: January 11, 2009, 09:55:28 PM »
So long as there is no inherent danger to the DB by them doing something else while it is processing things (as Codestryke and I had with that game), it's not generally an issue to leave the session open. I am personally famous for closing the wrong tab and find it terribly irritating to have to log in again when nothing has actually changed in that last few seconds. As long as your scripts protect the base functions of the game from overlapping when they shouldn't, there are no additional dangers.

Offline Qwerty

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
Re: How do you handle multiple logins?
« Reply #4 on: January 11, 2009, 10:48:19 PM »
So expire the old session when they start a new one?

Ok.
- "I sentance you to life"
- "You moron I'm already alive"

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: How do you handle multiple logins?
« Reply #5 on: January 12, 2009, 07:11:52 AM »
It may be a good idea to only expire any sessions currently in progress from the same IP (maybe even additionally restricted to same useragent, depending on your view). It depends upon what you want and what your system is trying to achieve. Remember that sessions are intended as a state tracking mechanism for HTTP.
Idiocy - Never underestimate the power of stupid people in large groups.


 


SimplePortal 2.3.3 © 2008-2010, SimplePortal