Clean up stale references to the Player stored in the NetworkRegistry,
closes #100
This commit is contained in:
parent
23c89ec054
commit
09558e9e15
5 changed files with 7 additions and 6 deletions
|
@ -304,9 +304,9 @@ public class FMLNetworkHandler
|
|||
NetworkRegistry.instance().connectionOpened(netClientHandler, server, networkManager);
|
||||
}
|
||||
|
||||
public static void onConnectionClosed(NetworkManager manager)
|
||||
public static void onConnectionClosed(NetworkManager manager, EntityPlayer player)
|
||||
{
|
||||
NetworkRegistry.instance().connectionClosed(manager);
|
||||
NetworkRegistry.instance().connectionClosed(manager, player);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -207,12 +207,13 @@ public class NetworkRegistry
|
|||
}
|
||||
}
|
||||
|
||||
void connectionClosed(NetworkManager manager)
|
||||
void connectionClosed(NetworkManager manager, EntityPlayer player)
|
||||
{
|
||||
for (IConnectionHandler handler : connectionHandlers)
|
||||
{
|
||||
handler.connectionClosed(manager);
|
||||
}
|
||||
activeChannels.removeAll(player);
|
||||
}
|
||||
|
||||
void generateChannelRegistration(EntityPlayer player, NetHandler netHandler, NetworkManager manager)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
if (this.field_74472_n && this.field_74473_o.isEmpty())
|
||||
{
|
||||
this.field_74485_r.func_72515_a(this.field_74481_v, this.field_74480_w);
|
||||
+ FMLNetworkHandler.onConnectionClosed(this);
|
||||
+ FMLNetworkHandler.onConnectionClosed(this, this.field_74485_r.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
if (this.field_74441_e && this.field_74442_b.isEmpty())
|
||||
{
|
||||
this.field_74440_d.func_72515_a(this.field_74438_f, this.field_74439_g);
|
||||
+ FMLNetworkHandler.onConnectionClosed(this);
|
||||
+ FMLNetworkHandler.onConnectionClosed(this, this.field_74440_d.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
{
|
||||
this.field_72555_g.func_74429_a(p_72546_1_);
|
||||
this.field_72555_g.func_74423_d();
|
||||
+ FMLNetworkHandler.onConnectionClosed(this.field_72555_g);
|
||||
+ FMLNetworkHandler.onConnectionClosed(this.field_72555_g, this.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue