Skip to content

Commit 6d33200

Browse files
committed
fix: proper gameId usage
1 parent 3742634 commit 6d33200

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

commons/src/main/java/net/swofty/commons/protocol/objects/orchestrator/ChooseGameProtocolObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public String serialize(ChooseGameMessage value) {
2727
public ChooseGameMessage deserialize(String json) {
2828
JSONObject obj = new JSONObject(json);
2929
return new ChooseGameMessage(
30-
UUID.fromString(obj.getString("player")),
30+
UUID.fromString(obj.getString("uuid")),
3131
UnderstandableProxyServer.singleFromJSON(obj.getJSONObject("server")),
3232
obj.getString("gameId")
3333
);

service.generic/src/main/java/net/swofty/service/generic/redis/ServiceToServerManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public static CompletableFuture<Map<UUID, JSONObject>> kickFromGUI(List<UUID> se
206206

207207
public static CompletableFuture<Map<UUID, JSONObject>> gameInformation(UUID serverUUID, UUID playerUUID, String gameId) {
208208
JSONObject message = new JSONObject()
209-
.put("playerUUID", playerUUID)
209+
.put("uuid", playerUUID)
210210
.put("game-id", gameId);
211211

212212
return sendToServers(List.of(serverUUID), FromServiceChannels.GAME_INFORMATION, message);

type.bedwarsgame/src/main/java/net/swofty/type/bedwarsgame/game/Game.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@
2323
import net.swofty.type.bedwarsgame.user.BedWarsPlayer;
2424
import net.swofty.type.bedwarsgame.user.ExperienceCause;
2525
import net.swofty.commons.BedwarsGameType;
26-
import net.swofty.type.bedwarsgeneric.data.BedWarsDataHandler;
2726
import net.swofty.type.bedwarsgeneric.game.MapsConfig;
28-
import net.swofty.type.generic.data.datapoints.DatapointMapStringLong;
2927
import net.swofty.type.generic.user.HypixelPlayer;
30-
import net.swofty.type.generic.utility.MathUtility;
3128
import org.tinylog.Logger;
3229

3330
import java.util.*;
@@ -95,12 +92,12 @@ public void join(BedWarsPlayer player) {
9592
countdown.startCountdown();
9693
}
9794

98-
BedWarsDataHandler data = BedWarsDataHandler.getUser(player);
95+
/*BedWarsDataHandler data = BedWarsDataHandler.getUser(player);
9996
if (data != null) {
10097
var counts = data.get(BedWarsDataHandler.Data.MAP_JOIN_COUNTS, DatapointMapStringLong.class).getValue();
10198
counts.put(mapEntry.getId(), counts.getOrDefault(mapEntry.getId(), 0L) + 1);
10299
data.get(BedWarsDataHandler.Data.MAP_JOIN_COUNTS, DatapointMapStringLong.class).setValue(counts);
103-
}
100+
}*/
104101
}
105102

106103
/**

type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/OrchestratorConnector.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.swofty.commons.ServiceType;
66
import net.swofty.commons.UnderstandableProxyServer;
77
import net.swofty.commons.protocol.objects.orchestrator.ChooseGameProtocolObject;
8-
import net.swofty.commons.protocol.objects.orchestrator.GetMapsProtocolObject;
98
import net.swofty.commons.protocol.objects.orchestrator.GetServerForMapProtocolObject;
109
import net.swofty.proxyapi.ProxyService;
1110
import net.swofty.type.generic.user.HypixelPlayer;
@@ -64,7 +63,7 @@ public void sendToGame(BedwarsGameType gameType, @Nullable String map) {
6463
findGameServer(gameType, map).thenAccept(pair -> {
6564
if (pair.first != null) {
6665
ChooseGameProtocolObject.ChooseGameMessage message =
67-
new ChooseGameProtocolObject.ChooseGameMessage(player.getUuid(), pair.first, gameType.toString());
66+
new ChooseGameProtocolObject.ChooseGameMessage(player.getUuid(), pair.first, pair.second);
6867

6968
PROXY_SERVICE.handleRequest(message)
7069
.exceptionally(throwable -> {

type.generic/src/main/java/net/swofty/type/generic/redis/service/RedisGameMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public FromServiceChannels getChannel() {
1919
@Override
2020
public JSONObject onMessage(JSONObject message) {
2121
UUID uuid = UUID.fromString(message.getString("uuid"));
22-
String originType = message.getString("game-id");
22+
String gameId = message.getString("game-id");
2323

24-
game.put(uuid, originType);
24+
game.put(uuid, gameId);
2525
return new JSONObject();
2626
}
2727
}

0 commit comments

Comments
 (0)