Table of Contents

Class SessionManager

Namespace
Uncreated.Warfare.Sessions
Assembly
Uncreated.Warfare.dll
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

mapScheduler MapScheduler
logger ILogger<SessionManager>
playerService IPlayerService
heartbeatTimer ServerHeartbeatTimer
systemConfig IConfiguration
dbContext IGameDataDbContext
module WarfareModule

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

player WarfarePlayer
startedGame bool

If the player was there at the start of the game.

token CancellationToken

Returns

Task<SessionRecord>

StartNewSessionForAllPlayers(bool, CancellationToken)

public Task StartNewSessionForAllPlayers(bool startedGame, CancellationToken token = default)

Parameters

startedGame bool
token CancellationToken

Returns

Task

WaitAsync()

public Task WaitAsync()

Returns

Task