-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn about invalid gameprofiles for debugging
- Loading branch information
Showing
2 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 0fcae61702e187698c7ed971e6f46a5bccd6a2d1 Mon Sep 17 00:00:00 2001 | ||
From 2b95e40a883b305e569238322099dcdf1dc0de84 Mon Sep 17 00:00:00 2001 | ||
From: Samsuik <[email protected]> | ||
Date: Tue, 9 May 2023 16:10:11 +0100 | ||
Subject: [PATCH] mc dev imports | ||
|
@@ -5400,6 +5400,72 @@ index 000000000..22d7c2ab3 | |
+ | ||
+ } | ||
+} | ||
diff --git a/src/main/java/net/minecraft/server/OpList.java b/src/main/java/net/minecraft/server/OpList.java | ||
new file mode 100644 | ||
index 000000000..26b4e44b0 | ||
--- /dev/null | ||
+++ b/src/main/java/net/minecraft/server/OpList.java | ||
@@ -0,0 +1,60 @@ | ||
+package net.minecraft.server; | ||
+ | ||
+import com.google.gson.JsonObject; | ||
+import com.mojang.authlib.GameProfile; | ||
+import java.io.File; | ||
+import java.util.Iterator; | ||
+ | ||
+public class OpList extends JsonList<GameProfile, OpListEntry> { | ||
+ | ||
+ public OpList(File file) { | ||
+ super(file); | ||
+ } | ||
+ | ||
+ protected JsonListEntry<GameProfile> a(JsonObject jsonobject) { | ||
+ return new OpListEntry(jsonobject); | ||
+ } | ||
+ | ||
+ public String[] getEntries() { | ||
+ String[] astring = new String[this.e().size()]; | ||
+ int i = 0; | ||
+ | ||
+ OpListEntry oplistentry; | ||
+ | ||
+ for (Iterator iterator = this.e().values().iterator(); iterator.hasNext(); astring[i++] = ((GameProfile) oplistentry.getKey()).getName()) { | ||
+ oplistentry = (OpListEntry) iterator.next(); | ||
+ } | ||
+ | ||
+ return astring; | ||
+ } | ||
+ | ||
+ public boolean b(GameProfile gameprofile) { | ||
+ OpListEntry oplistentry = (OpListEntry) this.get(gameprofile); | ||
+ | ||
+ return oplistentry != null ? oplistentry.b() : false; | ||
+ } | ||
+ | ||
+ protected String c(GameProfile gameprofile) { | ||
+ return gameprofile.getId().toString(); | ||
+ } | ||
+ | ||
+ public GameProfile a(String s) { | ||
+ Iterator iterator = this.e().values().iterator(); | ||
+ | ||
+ OpListEntry oplistentry; | ||
+ | ||
+ do { | ||
+ if (!iterator.hasNext()) { | ||
+ return null; | ||
+ } | ||
+ | ||
+ oplistentry = (OpListEntry) iterator.next(); | ||
+ } while (!s.equalsIgnoreCase(((GameProfile) oplistentry.getKey()).getName())); | ||
+ | ||
+ return (GameProfile) oplistentry.getKey(); | ||
+ } | ||
+ | ||
+ protected String a(GameProfile object) { // Blossom - decompile fix | ||
+ return this.c((GameProfile) object); | ||
+ } | ||
+} | ||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutBlockAction.java b/src/main/java/net/minecraft/server/PacketPlayOutBlockAction.java | ||
new file mode 100644 | ||
index 000000000..cfb92ead8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From ad02a7a0d44ae1edcee12660f646c73f2aa8587b Mon Sep 17 00:00:00 2001 | ||
From: Samsuik <[email protected]> | ||
Date: Sun, 2 Jun 2024 13:53:04 +0100 | ||
Subject: [PATCH] warn about invalid gameprofiles | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java | ||
index 0ffb3277c..7cc24ed2c 100644 | ||
--- a/src/main/java/net/minecraft/server/PlayerList.java | ||
+++ b/src/main/java/net/minecraft/server/PlayerList.java | ||
@@ -411,6 +411,11 @@ public abstract class PlayerList { | ||
public EntityPlayer attemptLogin(LoginListener loginlistener, GameProfile gameprofile, String hostname) { | ||
// Moved from processLogin | ||
UUID uuid = EntityHuman.a(gameprofile); | ||
+ // Blossom start - warn about invalid gameprofiles | ||
+ if (gameprofile.getId() == null) { | ||
+ f.warn("User {} was not assigned a uuid before login", gameprofile.getName(), new Throwable()); | ||
+ } | ||
+ // Blossom end | ||
ArrayList arraylist = Lists.newArrayList(); | ||
|
||
EntityPlayer entityplayer; | ||
-- | ||
2.40.0.windows.1 | ||
|