Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Called when the Hosts creates a game.
- /// </summary>
- /// <returns></returns>
- public async Task CreateGame()
- {
- string codeRoom = GeneratorHelper.GenerateRoomNumber();
- await Groups.AddToGroupAsync(Context.ConnectionId, codeRoom);
- await Clients.Caller.SendAsync("GameCodeSent", codeRoom);
- }
- /// <summary>
- /// Called when the Hosts quits a game they created.
- /// </summary>
- /// <returns></returns>
- public async Task LeavesCreatedGame(string codeRoom)
- {
- await Groups.RemoveFromGroupAsync(Context.ConnectionId, codeRoom);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement