b967bd70eb
- Introduced `IGameRepository` interface and its implementation. - Transitioned namespaces to `file-scoped` for consistency. - Simplified class definitions, e.g., `Game` and `SixDigitInt`. - Restructured `GameField` logic for improved readability and functionality. - Fixed formatting issues in `API.csproj` and added a `using` directive in `Program.cs`.
21 lines
498 B
C#
21 lines
498 B
C#
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace API.Controllers;
|
|
|
|
public class GameHubSocket : Hub
|
|
{
|
|
public async Task CreateGame(string playerName)
|
|
{
|
|
// TODO: create
|
|
await Groups.AddToGroupAsync(Context.ConnectionId, "gameId");
|
|
await Clients.Group("gameId").SendAsync("PlayerJoined", new
|
|
{
|
|
Context.ConnectionId,
|
|
PlayerName = playerName
|
|
});
|
|
}
|
|
|
|
public async Task JoinGame(string gameId, string playerName)
|
|
{
|
|
}
|
|
} |