Update realms library to 1.3.1, and implement network latch when connecting to Realms. Tested and working.

This commit is contained in:
Lex Manos 2014-07-11 17:56:07 -07:00
parent 7cd70b3f26
commit e6e019896f
6 changed files with 21 additions and 3 deletions

View file

@ -79,7 +79,7 @@
"name": "lzma:lzma:0.0.1"
},
{
"name": "com.mojang:realms:1.2.10"
"name": "com.mojang:realms:1.3.1"
},
{
"name": "org.apache.commons:commons-compress:1.8.1"

View file

@ -117,7 +117,7 @@
"serverreq":true
},
{
"name": "com.mojang:realms:1.2.10"
"name": "com.mojang:realms:1.3.1"
},
{
"name": "org.apache.commons:commons-compress:1.8.1"

View file

@ -8,7 +8,7 @@
"assets": "1.7.10",
"libraries": [
{
"name": "com.mojang:realms:1.2.10"
"name": "com.mojang:realms:1.3.1"
},
{
"name": "org.apache.commons:commons-compress:1.8.1"

View file

@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/realms/RealmsConnect.java
+++ ../src-work/minecraft/net/minecraft/realms/RealmsConnect.java
@@ -40,6 +40,7 @@
try
{
+ cpw.mods.fml.client.FMLClientHandler.instance().connectToRealmsServer(p_connect_1_, p_connect_2_);
inetaddress = InetAddress.getByName(p_connect_1_);
if (RealmsConnect.this.aborted)

View file

@ -820,10 +820,17 @@ public class FMLClientHandler implements IFMLSidedHandler
playClientBlock = new CountDownLatch(1);
}
public void connectToRealmsServer(String host, int port)
{
playClientBlock = new CountDownLatch(1);
}
private CountDownLatch playClientBlock;
public void setPlayClient(NetHandlerPlayClient netHandlerPlayClient)
{
if (playClientBlock == null)
playClientBlock = new CountDownLatch(1);
playClientBlock.countDown();
this.currentPlayClient = new WeakReference<NetHandlerPlayClient>(netHandlerPlayClient);
}

View file

@ -454,6 +454,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
public void abortClientHandshake(String type)
{
FMLLog.log(Level.INFO, "Aborting client handshake \"%s\"", type);
FMLCommonHandler.instance().waitForPlayClient();
completeClientSideConnection(ConnectionType.valueOf(type));
}