fix(Socket): remove convert to server
Some checks failed
Build the Docker Image / docker (push) Failing after 1m56s
Some checks failed
Build the Docker Image / docker (push) Failing after 1m56s
This commit is contained in:
parent
f080478a2c
commit
1cac23df5d
1 changed files with 0 additions and 15 deletions
|
@ -60,9 +60,6 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
|
||||||
ConcurrentHashMap<String, Object> cosmetics = new ConcurrentHashMap<>();
|
ConcurrentHashMap<String, Object> cosmetics = new ConcurrentHashMap<>();
|
||||||
data.get("cosmetics").getAsJsonObject().entrySet().forEach(entry -> cosmetics.put(entry.getKey(), entry.getValue()));
|
data.get("cosmetics").getAsJsonObject().entrySet().forEach(entry -> cosmetics.put(entry.getKey(), entry.getValue()));
|
||||||
|
|
||||||
|
|
||||||
convertToServer(cosmetics);
|
|
||||||
|
|
||||||
ClientMapping mapping = new ClientMapping(uuid, cosmetics);
|
ClientMapping mapping = new ClientMapping(uuid, cosmetics);
|
||||||
exchange.broadcast(JsonParser.parse("{}")
|
exchange.broadcast(JsonParser.parse("{}")
|
||||||
.set("uuid", uuid.toString())
|
.set("uuid", uuid.toString())
|
||||||
|
@ -100,18 +97,6 @@ public class CosmeticSocket implements SocketHandler, ListenerAdapter {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void convertToServer(ConcurrentHashMap<String, Object> cosmetics) {
|
|
||||||
cosmetics.forEach((type, data) -> {
|
|
||||||
if (!(data instanceof JsonElement element)) return;
|
|
||||||
if (!element.isJsonPrimitive() && !element.getAsJsonPrimitive().isString()) return;
|
|
||||||
|
|
||||||
String name = element.getAsString();
|
|
||||||
JsonObject cosmetic = searchServerCosmetic(type, name);
|
|
||||||
if (cosmetic == null) return;
|
|
||||||
cosmetics.put(type, cosmetic);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private JsonObject searchServerCosmetic(String type, String name) {
|
private JsonObject searchServerCosmetic(String type, String name) {
|
||||||
Json serverCosmetics = CosmeticServer.instance().getServerCosmetics();
|
Json serverCosmetics = CosmeticServer.instance().getServerCosmetics();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue