Remove IP addresses from game tokens and matchmaking

This commit is contained in:
sudokoko 2024-03-17 21:41:10 -04:00
parent a9944ec74d
commit 5283001511
No known key found for this signature in database
GPG key ID: 248D68C664937395
13 changed files with 44 additions and 73 deletions

View file

@ -87,7 +87,6 @@ public class MatchController : ControllerBase
{
case UpdateMyPlayerData playerData:
{
MatchHelper.SetUserLocation(user.UserId, token.UserLocation);
Room? room = RoomHelper.FindRoomByUser(user.UserId, token.GameVersion, token.Platform, true);
if (playerData.RoomState != null)
@ -95,19 +94,13 @@ public class MatchController : ControllerBase
room.State = (RoomState)playerData.RoomState;
break;
}
// Check how many people are online in release builds, disabled for debug for ..well debugging.
#if DEBUG
case FindBestRoom diveInData:
#else
case FindBestRoom diveInData when MatchHelper.UserLocations.Count > 1:
#endif
{
FindBestRoomResponse? response = RoomHelper.FindBestRoom(this.database,
user,
token.GameVersion,
diveInData.RoomSlot,
token.Platform,
token.UserLocation);
token.Platform);
if (response == null) return this.NotFound();
@ -117,7 +110,7 @@ public class MatchController : ControllerBase
return this.Ok($"[{{\"StatusCode\":200}},{serialized}]");
}
case CreateRoom createRoom when !MatchHelper.UserLocations.IsEmpty:
case CreateRoom createRoom:
{
List<int> users = new();
foreach (string playerUsername in createRoom.Players)