LastSeen datetime a...
 
Notifications
Clear all

LastSeen datetime and online state is wrong

3 Posts
2 Users
0 Reactions
659 Views
(@tmrtrn)
Posts: 2
New Member
Topic starter
 

Hi, i am struggling to figure out how to block second user with same account, i followed ways you have mentioned in Unity forum. 

  1. check in the callback of User.Load if the account's state is "online" (or check lastSeen) and deny to login from the current instance until he's offline
  2. allow to login from the latest instance run, in CombuManager.AutoPing pass a callback to Ping where you check the boolean success variable passed as result and if it's false then you'll auto-logout the user (but don't call CombuPlatform.Logout else it will make invalid also the new logged instance.

auto ping result is always success and getting 'false' is never been happened when second device connected

lastSeen time is my server time and it isn't same with clients.

int seconds = (int)(System.DateTime.Now - _lastSeen.Value).TotalSeconds;

(Version 2.1.5)

Appreciate any advise.

 
Posted : 31/01/2016 2:01 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

After CombuManager has been initialized, you can access to CombuManager.instance.serverInfo.time from which you should be able to convert the server dates to your client by comparing with local date. Honestly I don't remember the second option, anyway for security reason I would create a script to be called after login that deletes all other sessions of the logged player, this way you always allow login but invalidates all other sessions.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 31/01/2016 1:24 pm
(@tmrtrn)
Posts: 2
New Member
Topic starter
 

Skared Creations said
After CombuManager has been initialized, you can access to CombuManager.instance.serverInfo.time from which you should be able to convert the server dates to your client by comparing with local date.

Yes, this works well, thank you.

Skared Creations said
anyway for security reason I would create a script to be called after login that deletes all other sessions of the logged player, this way you always allow login but invalidates all other sessions.

It would be nice if you could help me out with this script that deletes all other sessions. How do I notify the other user? Does it affect the player ping result in order to notify?

 
Posted : 01/02/2016 1:34 am
Share: