Ejemplo n.º 1
0
        public IActionResult LeaveLobby([FromBody] PostRequestBody body)
        {
            if (body.lobbyID != null && body.userID != null)
            {
                if (this.lobbyManager.LeaveLobby(body.lobbyID, (int)body.userID))
                {
                    if ((int)body.userID == lobbyManager.GetLobby(body.lobbyID).HostID)
                    {
                        return(this.DeleteLobby(body));
                    }

                    return(new ObjectResult(new { }));
                }

                return(NotFound());
            }

            return(BadRequest());
        }
Ejemplo n.º 2
0
 public IWrapper GetLobbyData([FromBody] Tokens tokens)
 {
     return(_contractMapper.MapToStageData(tokens.PlayerToken, _lobbyManager.GetLobby(tokens.LobbyToken)));
 }