From 412952be5b68e985b46c5304ee6a0c1ba8dcad2e Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Sat, 12 Oct 2013 23:10:23 -0700 Subject: [PATCH] Prevent session from being printed to the console, also make sure the username is not empty. Causes a lot of bugs further down the line. --- .../net/minecraft/client/Minecraft.java.patch | 9 ++++++++ .../net/minecraft/util/Session.java.patch | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 patches/minecraft/net/minecraft/util/Session.java.patch diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 40ad4ecca..d642b0249 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -17,6 +17,15 @@ @SideOnly(Side.CLIENT) public class Minecraft implements IPlayerUsage { +@@ -308,7 +318,7 @@ + this.startTimerHackThread(); + this.session = par1Session; + this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); +- this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); ++ //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid... + this.isDemo = par5; + this.displayWidth = par2; + this.displayHeight = par3; @@ -416,7 +426,7 @@ try diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch new file mode 100644 index 000000000..05cd8c0ef --- /dev/null +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -0,0 +1,22 @@ +--- ../src_base/minecraft/net/minecraft/util/Session.java ++++ ../src_work/minecraft/net/minecraft/util/Session.java +@@ -11,6 +11,19 @@ + + public Session(String par1Str, String par2Str) + { ++ if (par1Str == null || par1Str.isEmpty()) ++ { ++ par1Str = "MissingName"; ++ par2Str = "NotValid"; ++ System.out.println("========================================================="); ++ System.out.println("Warning the username was not set for this session, typically"); ++ System.out.println("this means you installed Forge incorrectly. We have set your"); ++ System.out.println("name to \"MissingName\" and your session to nothing. Please"); ++ System.out.println("check your instation and post a console log from the launcher"); ++ System.out.println("when asking for help!"); ++ System.out.println("========================================================="); ++ ++ } + this.username = par1Str; + this.sessionId = par2Str; + }