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.

This commit is contained in:
Lex Manos 2013-10-12 23:10:23 -07:00
parent 465525119c
commit 412952be5b
2 changed files with 31 additions and 0 deletions

View file

@ -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

View file

@ -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;
}