Table of Contents
General
Sessions are used to tell Game Jolt when a user is playing a game, and what state they are in while playing (active, or idle).
Opening session is no necessary thing. It's only function is to tell GameJolt that user is playing your game at the moment.
Creating a new session
Opens a game session for a particular user. Allows you to tell Game Jolt that a user is playing your game. You must ping the session to keep it active and you must close it when you're done with it.
Note that you can only have one open session at a time. If you try to open a new session while one is running, the system will close out your current one before opening a new one.
local success = GJ.openSession()
Pinging a session
Pings an open session to tell the system that it's still active. If the session hasn't been pinged within 120 seconds, the system will close the session and you will have to open another one. It's recommended that you ping every 30 seconds or so to keep the system from cleaning up your session. You can also let the system know whether the player is in an "active" or "idle" state within your game through this call.
active parameter takes boolean-only values (false for "idle", true for "active").
local success = GJ.pingSession(active)
Closing a session
Closes the active session.
local success = GJ.closeSession()