From a2e3e8aeee67f78ada1cc23d331635f0c827b77d Mon Sep 17 00:00:00 2001 From: AeonLucid Date: Mon, 21 Sep 2020 00:49:19 +0200 Subject: [PATCH] GameManager logging --- src/AmongUs.Server/Net/GameManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AmongUs.Server/Net/GameManager.cs b/src/AmongUs.Server/Net/GameManager.cs index 0c2bc40..e5d1949 100644 --- a/src/AmongUs.Server/Net/GameManager.cs +++ b/src/AmongUs.Server/Net/GameManager.cs @@ -1,17 +1,18 @@ using System.Collections.Concurrent; using System.Security.Cryptography; using AmongUs.Shared.Innersloth; +using Serilog; namespace AmongUs.Server.Net { public class GameManager { - private readonly RNGCryptoServiceProvider _random; + private static readonly ILogger Logger = Log.ForContext(); + private readonly ConcurrentDictionary _games; public GameManager() { - _random = new RNGCryptoServiceProvider(); _games = new ConcurrentDictionary(); } @@ -22,9 +23,11 @@ namespace AmongUs.Server.Net if (_games.TryAdd(gameCode, game)) { + Logger.Debug("Created game with code {0} ({1}).", GameCode.IntToGameName(gameCode), gameCode); return game; } + Logger.Warning("Failed to create game."); return null; } @@ -36,6 +39,7 @@ namespace AmongUs.Server.Net public void Remove(int gameCode) { + Logger.Debug("Remove game with code {0} ({1}).", GameCode.IntToGameName(gameCode), gameCode); _games.TryRemove(gameCode, out _); } } -- 2.39.5