Session Manager
SessionManager
is a wrapper class using PlayPadCommunicator
to support the deveopler with integrating some little more complicated features you can read about below.
It includes the following public APIs:
-
AuthenticateFromExternalAndConnect
method:
Use this method once per application lifetime. It will communicate with PlayPad in order to:- Initialize communication
- Handle external authentication
- Set up
SmartContractService
if available (needed for example for Web3 duels) - Fetch tournament, leaderboards and user highscore data (after this method call respective communicators will have this data available to use)
- Invoke
FinishSessionInfoUpdate
at the end
-
ConnectedWithPlayPad
:
Tracks ifAuthenticateFromExternalAndConnect
has been already used. -
StartSessionInfoUpdate
andFinishSessionInfoUpdate
events:
Invoked when PlayPad detects authentication change and requests executing it by the game (out of matchmaking or a match). Respectively at the beginning and at the end of such a process. Useful for displaying and hiding authentication in progress overlay. -
CurrentSession
:
Carries some useful data, likeIsMobile
boolean for UI or controls adjustments.