Skip to content

Commit

Permalink
Add additional logging for external game start
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Sep 14, 2023
1 parent 624069c commit 46ba8e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,14 @@ export class GamePageComponent implements OnDestroy {
return;
}

this.logService.logInfo(`Game ${ctx.game.id} (player ${ctx.playerId}) is ${startState.isReady ? "" : "not"} ready to start.`);
this.logService.logWarning(`Game ${ctx.game.id} (player ${ctx.playerId}) is ${startState.isReady ? "" : "not"} ready to start.`);

// NOTE: in https://github.com/cmu-sei/Gameboard/issues/249, we're tracking the fact that we really need a separate
// data structure to record properties of the external game, including a better way to determine if we should redirect
// a reloading/returning player to the game screen

if (startState.isReady && ctx.game.session.isDuring && ctx.playerId) {
this.logService.logWarning(`Game ${ctx.game.id} (player ${ctx.playerId}) is starting...`);
this.routerService.goToGameStartPage({ gameId: ctx.game.id, playerId: ctx.playerId });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class UserIsPlayingGuard implements CanActivate, CanActivateChild {
}

// if we only have a player id, we need to resolve the gameId using the playerId
this.log.logInfo(`Checking UserIsPlayingGuard for game ${gameId}, user ${playerId}.`);
this.log.logWarning(`Checking UserIsPlayingGuard for game ${gameId}, user ${playerId}.`);
let resolvedGameId = gameId;
if (playerId) {
const player = await firstValueFrom(this.playerService.retrieve(playerId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export class SignalRService {
if (this._connection?.state == HubConnectionState.Connected) {
this.logger.logInfo(`Connection started with url`, connectToUrl);
}
else if (this._connection.state == HubConnectionState.Connecting || this._connection?.state == HubConnectionState.Reconnecting) {
this.logger.logWarning(`Connection with url ${connectToUrl} is in the Connecting state...`);
}
else {
this.logger.logError(`CRITICAL: The SignalR service was unable to join hub "${connectToUrl}".`);
}
Expand Down

0 comments on commit 46ba8e3

Please sign in to comment.