Move from the hand.
This commit is contained in:
@@ -8,10 +8,10 @@ namespace Shogi.Api.Managers;
|
||||
|
||||
public interface ISocketConnectionManager
|
||||
{
|
||||
Task BroadcastToAll(ISocketResponse response);
|
||||
Task BroadcastToAll(ISocketMessage response);
|
||||
void Subscribe(WebSocket socket, string playerName);
|
||||
void Unsubscribe(string playerName);
|
||||
Task BroadcastToPlayers(ISocketResponse response, params string?[] playerNames);
|
||||
Task BroadcastToPlayers(ISocketMessage response, params string?[] playerNames);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +45,7 @@ public class SocketConnectionManager : ISocketConnectionManager
|
||||
connections.TryRemove(playerName, out _);
|
||||
}
|
||||
|
||||
public async Task BroadcastToPlayers(ISocketResponse response, params string?[] playerNames)
|
||||
public async Task BroadcastToPlayers(ISocketMessage response, params string?[] playerNames)
|
||||
{
|
||||
var tasks = new List<Task>(playerNames.Length);
|
||||
foreach (var name in playerNames)
|
||||
@@ -59,7 +59,7 @@ public class SocketConnectionManager : ISocketConnectionManager
|
||||
}
|
||||
await Task.WhenAll(tasks);
|
||||
}
|
||||
public Task BroadcastToAll(ISocketResponse response)
|
||||
public Task BroadcastToAll(ISocketMessage response)
|
||||
{
|
||||
var message = Serialize(response);
|
||||
logger.LogInformation("Broadcasting:\n{0}\nDone Broadcasting.", message);
|
||||
|
||||
Reference in New Issue
Block a user