Exemplo n.º 1
0
  @Override
  public void disconnectIDMismatch(
      MapDifference<Integer, ItemData> s, NetHandler toKill, INetworkManager mgr) {
    boolean criticalMismatch = !s.entriesOnlyOnLeft().isEmpty();
    for (Entry<Integer, ValueDifference<ItemData>> mismatch : s.entriesDiffering().entrySet()) {
      ValueDifference<ItemData> vd = mismatch.getValue();
      if (!vd.leftValue().mayDifferByOrdinal(vd.rightValue())) {
        criticalMismatch = true;
      }
    }

    if (!criticalMismatch) {
      // We'll carry on with this connection, and just log a message instead
      return;
    }
    // Nuke the connection
    ((NetClientHandler) toKill).func_72553_e();
    // Stop GuiConnecting
    GuiConnecting.forceTermination((GuiConnecting) client.field_71462_r);
    // pulse the network manager queue to clear cruft
    mgr.func_74428_b();
    // Nuke the world client
    client.func_71403_a((WorldClient) null);
    // Show error screen
    warnIDMismatch(s, false);
  }
Exemplo n.º 2
0
 public static void forceTermination(GuiConnecting gui) {
   gui.cancelled = true;
   gui.clientHandler = null;
 }
Exemplo n.º 3
0
 /** Sets the NetClientHandler. */
 static NetClientHandler setNetClientHandler(
     GuiConnecting par0GuiConnecting, NetClientHandler par1NetClientHandler) {
   return par0GuiConnecting.clientHandler = par1NetClientHandler;
 }