Files
4Gewinnt/API/Controllers/GameHubSocket.cs
T

21 lines
487 B
C#

using Microsoft.AspNetCore.SignalR;
namespace API.Controllers;
public class GameHubSocket : Hub
{
public async Task CreateGame(string playerName, )
{
await Groups.AddToGroupAsync(Context.ConnectionId, gameId);
await Clients.Group(gameId).SendAsync("PlayerJoined", new
{
ConnectionId = Context.ConnectionId,
PlayerName = playerName
});
}
public async Task JoinGame(string gameId, string playerName)
{
}
}