/** * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new * WorldClient and sets the player initial dimension */ public void handleJoinGame(SPacketJoinGame packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.gameController.playerController = new PlayerControllerMP(this.gameController, this); this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler); this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); this.gameController.loadWorld(this.clientWorldController); this.gameController.player.dimension = packetIn.getDimension(); this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); this.gameController.player.setEntityId(packetIn.getPlayerId()); this.currentServerMaxPlayers = packetIn.getMaxPlayers(); this.gameController.player.setReducedDebug(packetIn.isReducedDebugInfo()); this.gameController.playerController.setGameType(packetIn.getGameType()); this.gameController.gameSettings.sendSettingsToServer(); this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName()))); }
/** * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new * WorldClient and sets the player initial dimension */ public void handleJoinGame(SPacketJoinGame packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.gameController.playerController = new PlayerControllerMP(this.gameController, this); this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler); this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); this.gameController.loadWorld(this.clientWorldController); this.gameController.thePlayer.dimension = packetIn.getDimension(); this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); this.gameController.thePlayer.setEntityId(packetIn.getPlayerId()); this.currentServerMaxPlayers = packetIn.getMaxPlayers(); this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo()); this.gameController.playerController.setGameType(packetIn.getGameType()); this.gameController.gameSettings.sendSettingsToServer(); this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName()))); }
@Override public void handleJoinGame(SPacketJoinGame packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.mc); if (clientWorldController == null) super.handleJoinGame(packetIn); this.mc.playerController = new PlayerControllerMP(this.mc, this); //Replaces the playerController with my own patched PlayerControllerMP ReflectionHelper.set(ObfuscatedField.NetHandlerPlayClient_clientWorldController, clientWorldController, this, new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.mc.mcProfiler)); this.mc.gameSettings.difficulty = packetIn.getDifficulty(); this.mc.loadWorld(ReflectionHelper.get(ObfuscatedField.NetHandlerPlayClient_clientWorldController, clientWorldController, this)); this.mc.player.dimension = packetIn.getDimension(); this.mc.displayGuiScreen(new GuiDownloadTerrain()); this.mc.player.setEntityId(packetIn.getPlayerId()); this.currentServerMaxPlayers = packetIn.getMaxPlayers(); this.mc.player.setReducedDebug(packetIn.isReducedDebugInfo()); this.mc.playerController.setGameType(packetIn.getGameType()); this.mc.gameSettings.sendSettingsToServer(); this.getNetworkManager().sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName()))); }
private boolean handleVanilla(Packet<?> msg) { if (state == ConnectionState.AWAITING_HANDSHAKE && msg instanceof SPacketJoinGame) { handshakeChannel.pipeline().fireUserEventTriggered(msg); } else { FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName()); } return false; }
public int getOverrideDimension(SPacketJoinGame packetIn) { FMLLog.fine("Overriding dimension: using %d", this.overrideLoginDim); return this.overrideLoginDim != 0 ? this.overrideLoginDim : packetIn.getDimension(); }
@Override public void onJoinGame(INetHandler iNet, SPacketJoinGame packet, ServerData serverData, RealmsServer realms) { NetHandlerPlayClient play = (NetHandlerPlayClient) iNet; SocketAddress addr = null; if (!play.getNetworkManager().isLocalChannel()) { addr = play.getNetworkManager().getRemoteAddress(); } tc.onJoin(addr); }
@Override protected void channelRead0(ChannelHandlerContext ctx, SPacketJoinGame msg) throws Exception { if (ctx.channel().isOpen()) { try { try { NetHandlerPlayClient handler = (NetHandlerPlayClient) m_manager.getNetHandler(); Minecraft scheduler = InjectionHandler.readFieldOfType(handler, Minecraft.class); if (!scheduler.isCallingFromMinecraftThread()) { scheduler.addScheduledTask(new Runnable() { public void run() { invoke(msg); } }); throw ThreadQuickExitException.INSTANCE; } else { invoke(msg); } } catch (Exception e) { if (e instanceof ThreadQuickExitException) throw e; Util.logger.logException("Unable to get scheduler!", e); // we died - let vanilla take over! ctx.fireChannelRead(msg); return; } } catch (ThreadQuickExitException var4) { ; } } }
@Override public void onJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer) { UpdateChecker.runUpdateChecks(utils.getChatProxy(), utils.getDisabledUpdates()); }
/** * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new * WorldClient and sets the player initial dimension */ void handleJoinGame(SPacketJoinGame packetIn);