changed craftscore version

This commit is contained in:
Paul Fey 2025-01-14 18:59:14 +01:00
parent 47dfcd5202
commit b98cc644f1
2 changed files with 11 additions and 11 deletions

View file

@ -17,7 +17,7 @@ repositories {
dependencies { dependencies {
implementation 'de.craftsblock:craftsnet:3.2.0-SNAPSHOT' implementation 'de.craftsblock:craftsnet:3.2.0-SNAPSHOT'
implementation 'de.craftsblock.craftscore:CraftsCore:3.7.53-SNAPSHOT' implementation 'de.craftsblock.craftscore:CraftsCore:3.7.60-SNAPSHOT'
implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.google.code.gson:gson:2.10' implementation 'com.google.code.gson:gson:2.10'

View file

@ -26,9 +26,9 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
public void handleMessage(SocketExchange exchange, String message) throws IOException { public void handleMessage(SocketExchange exchange, String message) throws IOException {
WebSocketClient client = exchange.client(); WebSocketClient client = exchange.client();
if (!Validator.isJsonValid(message)) { if (!Validator.isJsonValid(message)) {
client.sendMessage(JsonParser.parse("{}") Json jsonerr = JsonParser.parse("{}");
.set("error", "Send data must be in JSON format") jsonerr.set("error", "Send data must be in JSON format");
.asString()); client.sendMessage(jsonerr.toString());
return; return;
} }
@ -40,11 +40,11 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
JsonObject cosmetic = searchServerCosmetic(type, name); JsonObject cosmetic = searchServerCosmetic(type, name);
Json result = Json.empty() Json result = JsonParser.parse("{}");
.set("id", data.getLong("id")) result.set("id", data.getLong("id"));
.set("search", type) result.set("search", type);
.set("name", name) result.set("name", name);
.set("result", false); result.set("result", false);
if (cosmetic != null) { if (cosmetic != null) {
result.set("result", cosmetic); result.set("result", cosmetic);
@ -67,7 +67,7 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
exchange.broadcast(JsonParser.parse("{}") exchange.broadcast(JsonParser.parse("{}")
.set("uuid", uuid.toString()) .set("uuid", uuid.toString())
.set("cosmetics", bakeData(cosmetics)) .set("cosmetics", bakeData(cosmetics))
.asString()); .toString());
clients.put(client, mapping); clients.put(client, mapping);
CosmeticSocket.cosmetics.put(uuid, mapping); CosmeticSocket.cosmetics.put(uuid, mapping);
} }
@ -96,7 +96,7 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
client.sendMessage(JsonParser.parse("{}") client.sendMessage(JsonParser.parse("{}")
.set("data", array) .set("data", array)
.asString()); .toString());
} }