Skip to content

Commit

Permalink
Null nat type *is* valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Sep 2, 2023
1 parent d647439 commit 7cf6033
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ public Response Execute(MatchService service, LoggerContainer<BunkumContext> log
Token token,
SerializedRoomData body)
{
if (body.NatType is not { Count: 1 })
{
return BadRequest;
}

GameRoom? usersRoom = service.GetRoomByPlayer(user, token.TokenPlatform, token.TokenGame);
if (usersRoom == null) return BadRequest; // user should already have a room.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public Response Execute(MatchService service, LoggerContainer<BunkumContext> log
Token token,
SerializedRoomData body)
{
if (body.NatType is not { Count: 1 })
{
return BadRequest;
}

if (body.Players == null) return BadRequest;
GameRoom room = service.GetOrCreateRoomByPlayer(user, token.TokenPlatform, token.TokenGame, body.NatType[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public class UpdateRoomDataMethod : IMatchMethod
public Response Execute(MatchService service, LoggerContainer<BunkumContext> logger,
GameDatabaseContext database, GameUser user, Token token, SerializedRoomData body)
{
if (body.NatType is not { Count: 1 })
{
return BadRequest;
}

GameRoom room = service.GetOrCreateRoomByPlayer(user, token.TokenPlatform, token.TokenGame, body.NatType[0]);
if (room.HostId.Id != user.UserId) return Unauthorized;

Expand Down

0 comments on commit 7cf6033

Please sign in to comment.