Remove more useless deps
This commit is contained in:
parent
2c37532a0a
commit
3a46a0384d
|
@ -1,2 +1,3 @@
|
||||||
bin/
|
bin/
|
||||||
.gradle/
|
.gradle/
|
||||||
|
build/
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="17" />
|
<bytecodeTargetLevel target="18" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
Binary file not shown.
Binary file not shown.
|
@ -1,228 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.Key;
|
|
||||||
import java.security.KeyFactory;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
import java.security.KeyPairGenerator;
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.security.Security;
|
|
||||||
import java.security.spec.InvalidKeySpecException;
|
|
||||||
import java.security.spec.X509EncodedKeySpec;
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import org.bouncycastle.crypto.BufferedBlockCipher;
|
|
||||||
import org.bouncycastle.crypto.CipherKeyGenerator;
|
|
||||||
import org.bouncycastle.crypto.KeyGenerationParameters;
|
|
||||||
import org.bouncycastle.crypto.engines.AESFastEngine;
|
|
||||||
import org.bouncycastle.crypto.io.CipherInputStream;
|
|
||||||
import org.bouncycastle.crypto.io.CipherOutputStream;
|
|
||||||
import org.bouncycastle.crypto.modes.CFBBlockCipher;
|
|
||||||
import org.bouncycastle.crypto.params.KeyParameter;
|
|
||||||
import org.bouncycastle.crypto.params.ParametersWithIV;
|
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|
||||||
|
|
||||||
public class CryptManager
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Generate a new shared secret AES key from a secure random source
|
|
||||||
*/
|
|
||||||
public static SecretKey createNewSharedKey()
|
|
||||||
{
|
|
||||||
CipherKeyGenerator var0 = new CipherKeyGenerator();
|
|
||||||
var0.init(new KeyGenerationParameters(new SecureRandom(), 128));
|
|
||||||
return new SecretKeySpec(var0.generateKey(), "AES");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static KeyPair createNewKeyPair()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA");
|
|
||||||
var0.initialize(1024);
|
|
||||||
return var0.generateKeyPair();
|
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException var1)
|
|
||||||
{
|
|
||||||
var1.printStackTrace();
|
|
||||||
System.err.println("Key pair generation failed!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute a serverId hash for use by sendSessionRequest()
|
|
||||||
*/
|
|
||||||
public static byte[] getServerIdHash(String par0Str, PublicKey par1PublicKey, SecretKey par2SecretKey)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return digestOperation("SHA-1", new byte[][] {par0Str.getBytes("ISO_8859_1"), par2SecretKey.getEncoded(), par1PublicKey.getEncoded()});
|
|
||||||
}
|
|
||||||
catch (UnsupportedEncodingException var4)
|
|
||||||
{
|
|
||||||
var4.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute a message digest on arbitrary byte[] data
|
|
||||||
*/
|
|
||||||
private static byte[] digestOperation(String par0Str, byte[] ... par1ArrayOfByte)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MessageDigest var2 = MessageDigest.getInstance(par0Str);
|
|
||||||
byte[][] var3 = par1ArrayOfByte;
|
|
||||||
int var4 = par1ArrayOfByte.length;
|
|
||||||
|
|
||||||
for (int var5 = 0; var5 < var4; ++var5)
|
|
||||||
{
|
|
||||||
byte[] var6 = var3[var5];
|
|
||||||
var2.update(var6);
|
|
||||||
}
|
|
||||||
|
|
||||||
return var2.digest();
|
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException var7)
|
|
||||||
{
|
|
||||||
var7.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new PublicKey from encoded X.509 data
|
|
||||||
*/
|
|
||||||
public static PublicKey decodePublicKey(byte[] par0ArrayOfByte)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
X509EncodedKeySpec var1 = new X509EncodedKeySpec(par0ArrayOfByte);
|
|
||||||
KeyFactory var2 = KeyFactory.getInstance("RSA");
|
|
||||||
return var2.generatePublic(var1);
|
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException var3)
|
|
||||||
{
|
|
||||||
var3.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (InvalidKeySpecException var4)
|
|
||||||
{
|
|
||||||
var4.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
System.err.println("Public key reconstitute failed!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decrypt shared secret AES key using RSA private key
|
|
||||||
*/
|
|
||||||
public static SecretKey decryptSharedKey(PrivateKey par0PrivateKey, byte[] par1ArrayOfByte)
|
|
||||||
{
|
|
||||||
return new SecretKeySpec(decryptData(par0PrivateKey, par1ArrayOfByte), "AES");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encrypt byte[] data with RSA public key
|
|
||||||
*/
|
|
||||||
public static byte[] encryptData(Key par0Key, byte[] par1ArrayOfByte)
|
|
||||||
{
|
|
||||||
return cipherOperation(1, par0Key, par1ArrayOfByte);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decrypt byte[] data with RSA private key
|
|
||||||
*/
|
|
||||||
public static byte[] decryptData(Key par0Key, byte[] par1ArrayOfByte)
|
|
||||||
{
|
|
||||||
return cipherOperation(2, par0Key, par1ArrayOfByte);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encrypt or decrypt byte[] data using the specified key
|
|
||||||
*/
|
|
||||||
private static byte[] cipherOperation(int par0, Key par1Key, byte[] par2ArrayOfByte)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return createTheCipherInstance(par0, par1Key.getAlgorithm(), par1Key).doFinal(par2ArrayOfByte);
|
|
||||||
}
|
|
||||||
catch (IllegalBlockSizeException var4)
|
|
||||||
{
|
|
||||||
var4.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (BadPaddingException var5)
|
|
||||||
{
|
|
||||||
var5.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
System.err.println("Cipher data failed!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the Cipher Instance.
|
|
||||||
*/
|
|
||||||
private static Cipher createTheCipherInstance(int par0, String par1Str, Key par2Key)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Cipher var3 = Cipher.getInstance(par1Str);
|
|
||||||
var3.init(par0, par2Key);
|
|
||||||
return var3;
|
|
||||||
}
|
|
||||||
catch (InvalidKeyException var4)
|
|
||||||
{
|
|
||||||
var4.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException var5)
|
|
||||||
{
|
|
||||||
var5.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (NoSuchPaddingException var6)
|
|
||||||
{
|
|
||||||
var6.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
System.err.println("Cipher creation failed!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new BufferedBlockCipher instance
|
|
||||||
*/
|
|
||||||
private static BufferedBlockCipher createBufferedBlockCipher(boolean par0, Key par1Key)
|
|
||||||
{
|
|
||||||
BufferedBlockCipher var2 = new BufferedBlockCipher(new CFBBlockCipher(new AESFastEngine(), 8));
|
|
||||||
var2.init(par0, new ParametersWithIV(new KeyParameter(par1Key.getEncoded()), par1Key.getEncoded(), 0, 16));
|
|
||||||
return var2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static OutputStream encryptOuputStream(SecretKey par0SecretKey, OutputStream par1OutputStream)
|
|
||||||
{
|
|
||||||
return new CipherOutputStream(par1OutputStream, createBufferedBlockCipher(true, par0SecretKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InputStream decryptInputStream(SecretKey par0SecretKey, InputStream par1InputStream)
|
|
||||||
{
|
|
||||||
return new CipherInputStream(par1InputStream, createBufferedBlockCipher(false, par0SecretKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
Security.addProvider(new BouncyCastleProvider());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -91,7 +91,6 @@ public class DedicatedServer extends MinecraftServer implements IServer
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getLogAgent().logInfo("Generating keypair");
|
this.getLogAgent().logInfo("Generating keypair");
|
||||||
this.setKeyPair(CryptManager.createNewKeyPair());
|
|
||||||
this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort());
|
this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort());
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.awt.Toolkit;
|
|
||||||
import java.awt.datatransfer.ClipboardOwner;
|
|
||||||
import java.awt.datatransfer.DataFlavor;
|
|
||||||
import java.awt.datatransfer.StringSelection;
|
|
||||||
import java.awt.datatransfer.Transferable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
|
||||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.TextureLocation;
|
||||||
|
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||||
|
import net.minecraft.src.Minecraft;
|
||||||
|
|
||||||
|
public class GuiScreen extends Gui {
|
||||||
|
public static final boolean isMacOs = Minecraft.getOs() == EnumOS.MACOS;
|
||||||
|
|
||||||
public class GuiScreen extends Gui
|
|
||||||
{
|
|
||||||
/** Reference to the Minecraft object. */
|
/** Reference to the Minecraft object. */
|
||||||
protected Minecraft mc;
|
protected Minecraft mc;
|
||||||
|
|
||||||
|
@ -24,92 +22,70 @@ public class GuiScreen extends Gui
|
||||||
|
|
||||||
/** A list of all the buttons in this container. */
|
/** A list of all the buttons in this container. */
|
||||||
protected List buttonList = new ArrayList();
|
protected List buttonList = new ArrayList();
|
||||||
public boolean allowUserInput;
|
public boolean allowUserInput = false;
|
||||||
|
|
||||||
/** The FontRenderer used by GuiScreen */
|
/** The FontRenderer used by GuiScreen */
|
||||||
protected FontRenderer fontRenderer;
|
protected FontRenderer fontRenderer;
|
||||||
|
public GuiParticle guiParticles;
|
||||||
|
|
||||||
/** The button that was just pressed. */
|
/** The button that was just pressed. */
|
||||||
private GuiButton selectedButton;
|
private GuiButton selectedButton = null;
|
||||||
private int eventButton;
|
private int eventButton = 0;
|
||||||
private long lastMouseEvent;
|
private long field_85043_c = 0L;
|
||||||
private int field_92018_d;
|
private int field_92018_d = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws the screen and all the components in it.
|
* Draws the screen and all the components in it.
|
||||||
*/
|
*/
|
||||||
public void drawScreen(int par1, int par2, float par3)
|
public void drawScreen(int par1, int par2, float par3) {
|
||||||
{
|
for (int var4 = 0; var4 < this.buttonList.size(); ++var4) {
|
||||||
for (int var4 = 0; var4 < this.buttonList.size(); ++var4)
|
GuiButton var5 = (GuiButton) this.buttonList.get(var4);
|
||||||
{
|
|
||||||
GuiButton var5 = (GuiButton)this.buttonList.get(var4);
|
|
||||||
var5.drawButton(this.mc, par1, par2);
|
var5.drawButton(this.mc, par1, par2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
|
* Fired when a key is typed. This is the equivalent of
|
||||||
|
* KeyListener.keyTyped(KeyEvent e).
|
||||||
*/
|
*/
|
||||||
protected void keyTyped(char par1, int par2)
|
protected void keyTyped(char par1, int par2) {
|
||||||
{
|
//if (par2 == 1) {
|
||||||
if (par2 == 1)
|
// this.mc.displayGuiScreen((GuiScreen) null);
|
||||||
{
|
// this.mc.setIngameFocus();
|
||||||
this.mc.displayGuiScreen((GuiScreen)null);
|
//}
|
||||||
this.mc.setIngameFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string stored in the system clipboard.
|
* Returns a string stored in the system clipboard.
|
||||||
*/
|
*/
|
||||||
public static String getClipboardString()
|
public static String getClipboardString() {
|
||||||
{
|
try {
|
||||||
try
|
String s = EaglerAdapter.getClipboard();
|
||||||
{
|
return s == null ? "" : s;
|
||||||
Transferable var0 = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null);
|
}catch(Throwable t) {
|
||||||
|
|
||||||
if (var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor))
|
|
||||||
{
|
|
||||||
return (String)var0.getTransferData(DataFlavor.stringFlavor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception var1)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* store a string in the system clipboard
|
* store a string in the system clipboard
|
||||||
*/
|
*/
|
||||||
public static void setClipboardString(String par0Str)
|
public static void setClipboardString(String par0Str) {
|
||||||
{
|
try {
|
||||||
try
|
EaglerAdapter.setClipboard(par0Str);
|
||||||
{
|
}catch(Throwable t) {
|
||||||
StringSelection var1 = new StringSelection(par0Str);
|
|
||||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null);
|
|
||||||
}
|
|
||||||
catch (Exception var2)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the mouse is clicked.
|
* Called when the mouse is clicked.
|
||||||
*/
|
*/
|
||||||
protected void mouseClicked(int par1, int par2, int par3)
|
protected void mouseClicked(int par1, int par2, int par3) {
|
||||||
{
|
if (par3 == 0) {
|
||||||
if (par3 == 0)
|
for (int var4 = 0; var4 < this.buttonList.size(); ++var4) {
|
||||||
{
|
GuiButton var5 = (GuiButton) this.buttonList.get(var4);
|
||||||
for (int var4 = 0; var4 < this.buttonList.size(); ++var4)
|
|
||||||
{
|
|
||||||
GuiButton var5 = (GuiButton)this.buttonList.get(var4);
|
|
||||||
|
|
||||||
if (var5.mousePressed(this.mc, par1, par2))
|
if (var5.mousePressed(this.mc, par1, par2)) {
|
||||||
{
|
|
||||||
this.selectedButton = var5;
|
this.selectedButton = var5;
|
||||||
this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||||
this.actionPerformed(var5);
|
this.actionPerformed(var5);
|
||||||
|
@ -119,35 +95,33 @@ public class GuiScreen extends Gui
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
|
* Called when the mouse is moved or a mouse button is released. Signature:
|
||||||
* mouseMove, which==0 or which==1 is mouseUp
|
* (mouseX, mouseY, which) which==-1 is mouseMove, which==0 or which==1 is
|
||||||
|
* mouseUp
|
||||||
*/
|
*/
|
||||||
protected void mouseMovedOrUp(int par1, int par2, int par3)
|
protected void mouseMovedOrUp(int par1, int par2, int par3) {
|
||||||
{
|
if (this.selectedButton != null && par3 == 0) {
|
||||||
if (this.selectedButton != null && par3 == 0)
|
|
||||||
{
|
|
||||||
this.selectedButton.mouseReleased(par1, par2);
|
this.selectedButton.mouseReleased(par1, par2);
|
||||||
this.selectedButton = null;
|
this.selectedButton = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected void func_85041_a(int par1, int par2, int par3, long par4) {
|
||||||
* Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY,
|
}
|
||||||
* lastButtonClicked & timeSinceMouseClick.
|
|
||||||
*/
|
|
||||||
protected void mouseClickMove(int par1, int par2, int par3, long par4) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
* Fired when a control is clicked. This is the equivalent of
|
||||||
|
* ActionListener.actionPerformed(ActionEvent e).
|
||||||
*/
|
*/
|
||||||
protected void actionPerformed(GuiButton par1GuiButton) {}
|
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call
|
* Causes the screen to lay out its subcomponents again. This is the equivalent
|
||||||
* Container.validate()
|
* of the Java call Container.validate()
|
||||||
*/
|
*/
|
||||||
public void setWorldAndResolution(Minecraft par1Minecraft, int par2, int par3)
|
public void setWorldAndResolution(Minecraft par1Minecraft, int par2, int par3) {
|
||||||
{
|
this.guiParticles = new GuiParticle(par1Minecraft);
|
||||||
this.mc = par1Minecraft;
|
this.mc = par1Minecraft;
|
||||||
this.fontRenderer = par1Minecraft.fontRenderer;
|
this.fontRenderer = par1Minecraft.fontRenderer;
|
||||||
this.width = par2;
|
this.width = par2;
|
||||||
|
@ -159,20 +133,18 @@ public class GuiScreen extends Gui
|
||||||
/**
|
/**
|
||||||
* Adds the buttons (and other controls) to the screen in question.
|
* Adds the buttons (and other controls) to the screen in question.
|
||||||
*/
|
*/
|
||||||
public void initGui() {}
|
public void initGui() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delegates mouse and keyboard input.
|
* Delegates mouse and keyboard input.
|
||||||
*/
|
*/
|
||||||
public void handleInput()
|
public void handleInput() {
|
||||||
{
|
while (EaglerAdapter.mouseNext()) {
|
||||||
while (EaglerAdapter.mouseNext())
|
|
||||||
{
|
|
||||||
this.handleMouseInput();
|
this.handleMouseInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (EaglerAdapter.keysNext())
|
while (EaglerAdapter.keysNext()) {
|
||||||
{
|
|
||||||
this.handleKeyboardInput();
|
this.handleKeyboardInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,56 +152,48 @@ public class GuiScreen extends Gui
|
||||||
/**
|
/**
|
||||||
* Handles mouse input.
|
* Handles mouse input.
|
||||||
*/
|
*/
|
||||||
public void handleMouseInput()
|
public void handleMouseInput() {
|
||||||
{
|
|
||||||
int var1 = EaglerAdapter.mouseGetEventX() * this.width / this.mc.displayWidth;
|
int var1 = EaglerAdapter.mouseGetEventX() * this.width / this.mc.displayWidth;
|
||||||
int var2 = this.height - EaglerAdapter.mouseGetEventY() * this.height / this.mc.displayHeight - 1;
|
int var2 = this.height - EaglerAdapter.mouseGetEventY() * this.height / this.mc.displayHeight - 1;
|
||||||
int var3 = EaglerAdapter.mouseGetEventButton();
|
|
||||||
|
|
||||||
if (EaglerAdapter.mouseGetEventButtonState())
|
if (EaglerAdapter.mouseGetEventButtonState()) {
|
||||||
{
|
if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) {
|
||||||
if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eventButton = var3;
|
this.eventButton = EaglerAdapter.mouseGetEventButton();
|
||||||
this.lastMouseEvent = Minecraft.getSystemTime();
|
this.field_85043_c = Minecraft.getSystemTime();
|
||||||
this.mouseClicked(var1, var2, this.eventButton);
|
this.mouseClicked(var1, var2, this.eventButton);
|
||||||
}
|
} else if (EaglerAdapter.mouseGetEventButton() != -1) {
|
||||||
else if (var3 != -1)
|
if (this.mc.gameSettings.touchscreen && --this.field_92018_d > 0) {
|
||||||
{
|
|
||||||
if (this.mc.gameSettings.touchscreen && --this.field_92018_d > 0)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eventButton = -1;
|
this.eventButton = -1;
|
||||||
this.mouseMovedOrUp(var1, var2, var3);
|
this.mouseMovedOrUp(var1, var2, EaglerAdapter.mouseGetEventButton());
|
||||||
}
|
} else if (this.eventButton != -1 && this.field_85043_c > 0L) {
|
||||||
else if (this.eventButton != -1 && this.lastMouseEvent > 0L)
|
long var3 = Minecraft.getSystemTime() - this.field_85043_c;
|
||||||
{
|
this.func_85041_a(var1, var2, this.eventButton, var3);
|
||||||
long var4 = Minecraft.getSystemTime() - this.lastMouseEvent;
|
|
||||||
this.mouseClickMove(var1, var2, this.eventButton, var4);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles keyboard input.
|
* Handles keyboard input.
|
||||||
*/
|
*/
|
||||||
public void handleKeyboardInput()
|
public void handleKeyboardInput() {
|
||||||
{
|
if (EaglerAdapter.getEventKeyState()) {
|
||||||
if (EaglerAdapter.getEventKeyState())
|
|
||||||
{
|
|
||||||
int var1 = EaglerAdapter.getEventKey();
|
int var1 = EaglerAdapter.getEventKey();
|
||||||
char var2 = EaglerAdapter.getEventChar();
|
char var2 = EaglerAdapter.getEventChar();
|
||||||
|
|
||||||
if (var1 == 87)
|
if (var1 == 87) {
|
||||||
{
|
|
||||||
this.mc.toggleFullscreen();
|
this.mc.toggleFullscreen();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (isMacOs && var1 == 28 && var2 == 0) {
|
||||||
|
// var1 = 29;
|
||||||
|
//}
|
||||||
|
|
||||||
this.keyTyped(var2, var1);
|
this.keyTyped(var2, var1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,68 +201,72 @@ public class GuiScreen extends Gui
|
||||||
/**
|
/**
|
||||||
* Called from the main game loop to update the screen.
|
* Called from the main game loop to update the screen.
|
||||||
*/
|
*/
|
||||||
public void updateScreen() {}
|
public void updateScreen() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the screen is unloaded. Used to disable keyboard repeat events
|
* Called when the screen is unloaded. Used to disable keyboard repeat events
|
||||||
*/
|
*/
|
||||||
public void onGuiClosed() {}
|
public void onGuiClosed() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png
|
* Draws either a gradient over the background screen (when it exists) or a flat
|
||||||
|
* gradient over background.png
|
||||||
*/
|
*/
|
||||||
public void drawDefaultBackground()
|
public void drawDefaultBackground() {
|
||||||
{
|
|
||||||
this.drawWorldBackground(0);
|
this.drawWorldBackground(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawWorldBackground(int par1)
|
public void drawWorldBackground(int par1) {
|
||||||
{
|
if (this.mc.theWorld != null) {
|
||||||
if (this.mc.theWorld != null)
|
|
||||||
{
|
|
||||||
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
|
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
this.drawBackground(par1);
|
this.drawBackground(par1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final TextureLocation tex_background = new TextureLocation("/gui/background.png");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws the background (i is always 0 as of 1.2.2)
|
* Draws the background (i is always 0 as of 1.2.2)
|
||||||
*/
|
*/
|
||||||
public void drawBackground(int par1)
|
public void drawBackground(int par1) {
|
||||||
{
|
|
||||||
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
||||||
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
|
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
|
||||||
Tessellator var2 = Tessellator.instance;
|
Tessellator var2 = Tessellator.instance;
|
||||||
optionsBackground.bindTexture();
|
tex_background.bindTexture();
|
||||||
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
float var3 = 32.0F;
|
float var3 = 32.0F;
|
||||||
var2.startDrawingQuads();
|
var2.startDrawingQuads();
|
||||||
var2.setColorOpaque_I(4210752);
|
var2.setColorOpaque_I(4210752);
|
||||||
var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)par1));
|
var2.addVertexWithUV(0.0D, (double) this.height, 0.0D, 0.0D, (double) ((float) this.height / var3 + (float) par1));
|
||||||
var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)par1));
|
var2.addVertexWithUV((double) this.width, (double) this.height, 0.0D, (double) ((float) this.width / var3), (double) ((float) this.height / var3 + (float) par1));
|
||||||
var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)par1);
|
var2.addVertexWithUV((double) this.width, 0.0D, 0.0D, (double) ((float) this.width / var3), (double) par1);
|
||||||
var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)par1);
|
var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double) par1);
|
||||||
var2.draw();
|
var2.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
* Returns true if this GUI should pause the game when it is displayed in
|
||||||
|
* single-player
|
||||||
*/
|
*/
|
||||||
public boolean doesGuiPauseGame()
|
public boolean doesGuiPauseGame() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void confirmClicked(boolean par1, int par2) {}
|
public void confirmClicked(boolean par1, int par2) {
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isCtrlKeyDown() {
|
public static boolean isCtrlKeyDown() {
|
||||||
return EaglerAdapter.isKeyDown(29) || EaglerAdapter.isKeyDown(157) || EaglerAdapter.isKeyDown(219) || EaglerAdapter.isKeyDown(220);
|
return EaglerAdapter.isKeyDown(29) || EaglerAdapter.isKeyDown(157) || (isMacOs && (EaglerAdapter.isKeyDown(28) || EaglerAdapter.isKeyDown(219) || EaglerAdapter.isKeyDown(220)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isShiftKeyDown() {
|
public static boolean isShiftKeyDown() {
|
||||||
return EaglerAdapter.isKeyDown(42) || EaglerAdapter.isKeyDown(54);
|
return EaglerAdapter.isKeyDown(42) || EaglerAdapter.isKeyDown(54);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean blockHotKeys() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class IntegratedServer extends MinecraftServer
|
||||||
this.setAllowPvp(true);
|
this.setAllowPvp(true);
|
||||||
this.setAllowFlight(true);
|
this.setAllowFlight(true);
|
||||||
this.serverLogAgent.logInfo("Generating keypair");
|
this.serverLogAgent.logInfo("Generating keypair");
|
||||||
this.setKeyPair(CryptManager.createNewKeyPair());
|
//this.setKeyPair(CryptManager.createNewKeyPair());
|
||||||
this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j());
|
this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j());
|
||||||
this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName());
|
this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -554,6 +554,13 @@ public class Minecraft
|
||||||
this.displayHeight = var2.getHeight();
|
this.displayHeight = var2.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EnumOS getOs() {
|
||||||
|
String var0 = EaglerAdapter.getUserAgent().toLowerCase();
|
||||||
|
return var0.contains("win") ? EnumOS.WINDOWS
|
||||||
|
: (var0.contains("mac") ? EnumOS.MACOS
|
||||||
|
: (var0.contains("solaris") ? EnumOS.SOLARIS : (var0.contains("sunos") ? EnumOS.SOLARIS : (var0.contains("linux") ? EnumOS.LINUX : (var0.contains("unix") ? EnumOS.LINUX : EnumOS.UNKNOWN)))));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a new screen.
|
* Displays a new screen.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -122,12 +122,6 @@ public class NetLoginHandler extends NetHandler
|
||||||
public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey)
|
public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey)
|
||||||
{
|
{
|
||||||
PrivateKey var2 = this.mcServer.getKeyPair().getPrivate();
|
PrivateKey var2 = this.mcServer.getKeyPair().getPrivate();
|
||||||
this.sharedKey = par1Packet252SharedKey.getSharedKey(var2);
|
|
||||||
|
|
||||||
if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2)))
|
|
||||||
{
|
|
||||||
this.raiseErrorAndDisconnect("Invalid client reply");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.myTCPConnection.addToSendQueue(new Packet252SharedKey());
|
this.myTCPConnection.addToSendQueue(new Packet252SharedKey());
|
||||||
}
|
}
|
||||||
|
@ -143,17 +137,9 @@ public class NetLoginHandler extends NetHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
this.field_92079_k = true;
|
this.field_92079_k = true;
|
||||||
|
|
||||||
if (this.mcServer.isServerInOnlineMode())
|
|
||||||
{
|
|
||||||
(new ThreadLoginVerifier(this)).start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.field_72544_i = true;
|
this.field_72544_i = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void handleLogin(Packet1Login par1Packet1Login) {}
|
public void handleLogin(Packet1Login par1Packet1Login) {}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,6 @@ public class Packet252SharedKey extends Packet
|
||||||
|
|
||||||
public Packet252SharedKey(SecretKey par1SecretKey, PublicKey par2PublicKey, byte[] par3ArrayOfByte)
|
public Packet252SharedKey(SecretKey par1SecretKey, PublicKey par2PublicKey, byte[] par3ArrayOfByte)
|
||||||
{
|
{
|
||||||
this.sharedKey = par1SecretKey;
|
|
||||||
this.sharedSecret = CryptManager.encryptData(par2PublicKey, par1SecretKey.getEncoded());
|
|
||||||
this.verifyToken = CryptManager.encryptData(par2PublicKey, par3ArrayOfByte);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,30 +54,7 @@ public class Packet252SharedKey extends Packet
|
||||||
*/
|
*/
|
||||||
public int getPacketSize()
|
public int getPacketSize()
|
||||||
{
|
{
|
||||||
return 2 + this.sharedSecret.length + 2 + this.verifyToken.length;
|
return 2 + 162 + 2 + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return secretKey, decrypting it from the sharedSecret byte array if needed
|
|
||||||
*/
|
|
||||||
public SecretKey getSharedKey(PrivateKey par1PrivateKey)
|
|
||||||
{
|
|
||||||
return par1PrivateKey == null ? this.sharedKey : (this.sharedKey = CryptManager.decryptSharedKey(par1PrivateKey, this.sharedSecret));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the secret AES sharedKey (used by client only)
|
|
||||||
*/
|
|
||||||
public SecretKey getSharedKey()
|
|
||||||
{
|
|
||||||
return this.getSharedKey((PrivateKey)null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return verifyToken
|
|
||||||
*/
|
|
||||||
public byte[] getVerifyToken(PrivateKey par1PrivateKey)
|
|
||||||
{
|
|
||||||
return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class Packet253ServerAuthData extends Packet
|
||||||
public void readPacketData(DataInput par1DataInput) throws IOException
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
||||||
{
|
{
|
||||||
this.serverId = readString(par1DataInput, 20);
|
this.serverId = readString(par1DataInput, 20);
|
||||||
this.publicKey = CryptManager.decodePublicKey(readBytesFromStream(par1DataInput));
|
readBytesFromStream(par1DataInput);
|
||||||
this.verifyToken = readBytesFromStream(par1DataInput);
|
this.verifyToken = readBytesFromStream(par1DataInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import argo.jdom.JdomParser;
|
|
||||||
import argo.jdom.JsonNode;
|
|
||||||
import argo.jdom.JsonRootNode;
|
|
||||||
import argo.jdom.JsonStringNode;
|
|
||||||
import argo.saj.InvalidSyntaxException;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -121,56 +116,7 @@ public class StatFileWriter
|
||||||
|
|
||||||
public static Map func_77453_b(String par0Str)
|
public static Map func_77453_b(String par0Str)
|
||||||
{
|
{
|
||||||
HashMap var1 = new HashMap();
|
return new HashMap();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String var2 = "local";
|
|
||||||
StringBuilder var3 = new StringBuilder();
|
|
||||||
JsonRootNode var4 = (new JdomParser()).parse(par0Str);
|
|
||||||
List var5 = var4.getArrayNode(new Object[] {"stats-change"});
|
|
||||||
Iterator var6 = var5.iterator();
|
|
||||||
|
|
||||||
while (var6.hasNext())
|
|
||||||
{
|
|
||||||
JsonNode var7 = (JsonNode)var6.next();
|
|
||||||
Map var8 = var7.getFields();
|
|
||||||
Entry var9 = (Entry)var8.entrySet().iterator().next();
|
|
||||||
int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).getText());
|
|
||||||
int var11 = Integer.parseInt(((JsonNode)var9.getValue()).getText());
|
|
||||||
boolean var12 = true;
|
|
||||||
StatBase var13 = StatList.getOneShotStat(var10);
|
|
||||||
|
|
||||||
if (var13 == null)
|
|
||||||
{
|
|
||||||
var12 = false;
|
|
||||||
var13 = (new StatPlaceholder(var10)).registerStat();
|
|
||||||
}
|
|
||||||
|
|
||||||
var3.append(StatList.getOneShotStat(var10).statGuid).append(",");
|
|
||||||
var3.append(var11).append(",");
|
|
||||||
|
|
||||||
if (var12)
|
|
||||||
{
|
|
||||||
var1.put(var13, Integer.valueOf(var11));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MD5String var15 = new MD5String(var2);
|
|
||||||
String var16 = var15.getMD5String(var3.toString());
|
|
||||||
|
|
||||||
if (!var16.equals(var4.getStringValue(new Object[] {"checksum"})))
|
|
||||||
{
|
|
||||||
System.out.println("CHECKSUM MISMATCH");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (InvalidSyntaxException var14)
|
|
||||||
{
|
|
||||||
var14.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return var1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String func_77441_a(String par0Str, String par1Str, Map par2Map)
|
public static String func_77441_a(String par0Str, String par1Str, Map par2Map)
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class TcpConnection implements INetworkManager
|
||||||
{
|
{
|
||||||
if (!this.theNetHandler.isServerHandler())
|
if (!this.theNetHandler.isServerHandler())
|
||||||
{
|
{
|
||||||
this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey();
|
//this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.encryptOuputStream();
|
this.encryptOuputStream();
|
||||||
|
@ -320,7 +320,7 @@ public class TcpConnection implements INetworkManager
|
||||||
{
|
{
|
||||||
if (this.theNetHandler.isServerHandler())
|
if (this.theNetHandler.isServerHandler())
|
||||||
{
|
{
|
||||||
this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey(this.field_74463_A);
|
//this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey(this.field_74463_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.decryptInputStream();
|
this.decryptInputStream();
|
||||||
|
@ -487,7 +487,7 @@ public class TcpConnection implements INetworkManager
|
||||||
{
|
{
|
||||||
this.isInputBeingDecrypted = true;
|
this.isInputBeingDecrypted = true;
|
||||||
InputStream var1 = this.networkSocket.getInputStream();
|
InputStream var1 = this.networkSocket.getInputStream();
|
||||||
this.socketInputStream = new DataInputStream(CryptManager.decryptInputStream(this.sharedKeyForEncryption, var1));
|
//this.socketInputStream = new DataInputStream(CryptManager.decryptInputStream(this.sharedKeyForEncryption, var1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -497,8 +497,8 @@ public class TcpConnection implements INetworkManager
|
||||||
{
|
{
|
||||||
this.socketOutputStream.flush();
|
this.socketOutputStream.flush();
|
||||||
this.isOutputEncrypted = true;
|
this.isOutputEncrypted = true;
|
||||||
BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.sharedKeyForEncryption, this.networkSocket.getOutputStream()), 5120);
|
//BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.sharedKeyForEncryption, this.networkSocket.getOutputStream()), 5120);
|
||||||
this.socketOutputStream = new DataOutputStream(var1);
|
//this.socketOutputStream = new DataOutputStream(var1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
|
|
||||||
class ThreadLoginVerifier extends Thread
|
|
||||||
{
|
|
||||||
/** The login handler that spawned this thread. */
|
|
||||||
final NetLoginHandler loginHandler;
|
|
||||||
|
|
||||||
ThreadLoginVerifier(NetLoginHandler par1NetLoginHandler)
|
|
||||||
{
|
|
||||||
this.loginHandler = par1NetLoginHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String var1 = (new BigInteger(CryptManager.getServerIdHash(NetLoginHandler.getServerId(this.loginHandler), NetLoginHandler.getLoginMinecraftServer(this.loginHandler).getKeyPair().getPublic(), NetLoginHandler.getSharedKey(this.loginHandler)))).toString(16);
|
|
||||||
URL var2 = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(NetLoginHandler.getClientUsername(this.loginHandler), "UTF-8") + "&serverId=" + URLEncoder.encode(var1, "UTF-8"));
|
|
||||||
BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openConnection(NetLoginHandler.getLoginMinecraftServer(this.loginHandler).getServerProxy()).getInputStream()));
|
|
||||||
String var4 = var3.readLine();
|
|
||||||
var3.close();
|
|
||||||
|
|
||||||
if (!"YES".equals(var4))
|
|
||||||
{
|
|
||||||
this.loginHandler.raiseErrorAndDisconnect("Failed to verify username!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
NetLoginHandler.func_72531_a(this.loginHandler, true);
|
|
||||||
}
|
|
||||||
catch (Exception var5)
|
|
||||||
{
|
|
||||||
this.loginHandler.raiseErrorAndDisconnect("Failed to verify username! [internal error " + var5 + "]");
|
|
||||||
var5.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue