Skip to content
This repository has been archived by the owner on May 26, 2018. It is now read-only.

Commit

Permalink
Update realms library to 1.3.1, and implement network latch when conn…
Browse files Browse the repository at this point in the history
…ecting to Realms. Tested and working.
  • Loading branch information
LexManos committed Jul 12, 2014
1 parent 692d955 commit c2119eb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jsons/1.7.10-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion jsons/1.7.10-rel.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion jsons/1.7.10.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions src/main/java/cpw/mods/fml/client/FMLClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,17 @@ public void connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry)
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ public void completeClientHandshake()

public void abortClientHandshake(String type)
{
FMLLog.log(Level.INFO, "Aborting client handshake \"%s\"", type);
FMLCommonHandler.instance().waitForPlayClient();
completeClientSideConnection(ConnectionType.valueOf(type));
}
Expand Down

0 comments on commit c2119eb

Please sign in to comment.