-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce logging and make it single line for better searchability
- Loading branch information
1 parent
549155d
commit 053c3d1
Showing
8 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
server/GridBattle.Api/Infrastructure/HubCallerContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Microsoft.AspNetCore.SignalR; | ||
|
||
namespace GridBattle.Api; | ||
|
||
public static class HubCallerContextExtensions | ||
{ | ||
private const string USERNAME = "USERNAME"; | ||
private const string ROOM_ID = "ROOM_ID"; | ||
|
||
public static string? GetUsername(this HubCallerContext context) => | ||
context.Items[USERNAME]?.ToString(); | ||
|
||
public static string? GetRoomId(this HubCallerContext context) => | ||
context.Items[ROOM_ID]?.ToString(); | ||
|
||
public static void RemoveUsername(this HubCallerContext context) => | ||
context.Items.Remove(USERNAME); | ||
|
||
public static void RemoveRoomId(this HubCallerContext context) => context.Items.Remove(ROOM_ID); | ||
|
||
public static void SetUsername(this HubCallerContext context, string username) => | ||
context.Items[USERNAME] = username; | ||
|
||
public static void SetRoomId(this HubCallerContext context, string roomId) => | ||
context.Items[ROOM_ID] = roomId; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters