Skip to content

Commit

Permalink
房主离开房间的同时关闭游戏
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyhhssyy committed Jun 1, 2024
1 parent 4440ae5 commit 6b32854
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AmiyaBotPlayerRatingServer/RealtimeHubs/GameHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ await Clients.Group(gameId).SendAsync("PlayerLeft", JsonConvert.SerializeObject(
},
Game = FormatGame(game),
}));

//如果房主离开了,就关闭房间
if (game.CreatorId == appUser.Id)
{
await CloseGame(gameId);
}
}

[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
Expand Down

0 comments on commit 6b32854

Please sign in to comment.