How to track user session in Unity3d?

If the user is inactive, the user will be logged out due to a lack of session, but how can I track a session or user activity in Unity3D?

That is, if the user is active in the Unity web player by clicking on objects or taking some action, then the session must be active and the user must not log out. If the user is inactive and nothing happens in the web player, the user must log out.

I do not ask how to implement a session timeout ... I ask how to track user activity in a block web player in an ASP.NET MVC web application so that the unity of the Internet player is maintained if necessary.

Hope this makes sense. For example, what request should be sent from the server per unit in order to know whether the unity is active or not.

This:

http://docs.unity3d.com/Documentation/Manual/UnityWebPlayerandbrowsercommunication.html ?

I know how to configure it, but I'm not sure which queries I should run or check ...

+4
source share
1 answer

It seems your game requires a click. You can simply take time from one click to another through OnMouseDown()and check if it is longer. You can also check the last mouse position with the current mouse position.

- , . , , .

0

Source: https://habr.com/ru/post/1532160/


All Articles