Class SessionManager
public class SessionManager : ILayoutHostedService, IHostedService, IEventListener<PlayerLeft>, IEventListener<PlayerJoined>, IEventListener<PlayerTeamChanged>, IEventListener<SquadLeaderUpdated>, IEventListener<SquadMemberJoined>, IEventListener<SquadMemberLeft>, IEventListener<PlayerKitChanged>
- Inheritance
-
SessionManager
- Implements
- Inherited Members
Constructors
SessionManager(MapScheduler, ILogger<SessionManager>, IPlayerService, ServerHeartbeatTimer, IConfiguration, IGameDataDbContext, WarfareModule)
public SessionManager(MapScheduler mapScheduler, ILogger<SessionManager> logger, IPlayerService playerService, ServerHeartbeatTimer heartbeatTimer, IConfiguration systemConfig, IGameDataDbContext dbContext, WarfareModule module)
Parameters
mapSchedulerMapSchedulerloggerILogger<SessionManager>playerServiceIPlayerServiceheartbeatTimerServerHeartbeatTimersystemConfigIConfigurationdbContextIGameDataDbContextmoduleWarfareModule
Methods
Release()
public void Release()
StartNewSession(WarfarePlayer, bool, CancellationToken)
Starts a new session after ending the current session if there is one. Insignificant sessions will be cut.
public Task<SessionRecord> StartNewSession(WarfarePlayer player, bool startedGame, CancellationToken token = default)
Parameters
playerWarfarePlayerstartedGameboolIf the player was there at the start of the game.
tokenCancellationToken
Returns
StartNewSessionForAllPlayers(bool, CancellationToken)
public Task StartNewSessionForAllPlayers(bool startedGame, CancellationToken token = default)
Parameters
startedGamebooltokenCancellationToken
Returns
WaitAsync()
public Task WaitAsync()