public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; if (Handler.GetTerrainEnabled()) { ConsoleIO.WriteLineFormatted("§e[错误]§c世界交互 暂不支持此版本"); Handler.SetTerrainEnabled(false); } if (handler.GetInventoryEnabled()) { ConsoleIO.WriteLineFormatted("§e[错误]§c物品栏交互暂不支持此版本"); handler.SetInventoryEnabled(false); } if (handler.GetEntityHandlingEnabled()) { ConsoleIO.WriteLineFormatted("§e[错误]§c实体交互暂不支持此版本"); handler.SetEntityHandlingEnabled(false); } }
public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; if (Handler.GetTerrainEnabled()) { ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); Handler.SetTerrainEnabled(false); } if (handler.GetInventoryEnabled()) { ConsoleIO.WriteLineFormatted("§8Inventories are currently not handled for that MC version."); handler.SetInventoryEnabled(false); } if (handler.GetEntityHandlingEnabled()) { ConsoleIO.WriteLineFormatted("§8Entities are currently not handled for that MC version."); handler.SetEntityHandlingEnabled(false); } }
public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; if (Handler.GetTerrainEnabled()) { Translations.WriteLineFormatted("extra.terrainandmovement_disabled"); Handler.SetTerrainEnabled(false); } if (handler.GetInventoryEnabled()) { Translations.WriteLineFormatted("extra.inventory_disabled"); handler.SetInventoryEnabled(false); } if (handler.GetEntityHandlingEnabled()) { Translations.WriteLineFormatted("extra.entity_disabled"); handler.SetEntityHandlingEnabled(false); } }
public RespawnHandler(IMinecraftComHandler handler, DataTypes dataTypes, WorldInfo worldInfo, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.worldInfo = worldInfo; this.protocolversion = protocolversion; }
public Protocol18PacketHandler(int protocolVersion, DataTypes dataTypes, IMinecraftComHandler handler, IPacketReadWriter packetSender, Protocol18Terrain pTerrain, Protocol18Forge pForge, WorldInfo worldInfo, Protocol18Handler protocol18Handler, Player player) { this.protocolversion = protocolVersion; MultiVersionHandler blockHandler = new MultiVersionHandler(protocolVersion); blockHandler.addPacketHandler(new BlockChangeHandler17(handler, dataTypes), (int)McVersion.V17). addPacketHandler(new BlockChangeHandler18(handler, dataTypes), (int)McVersion.V18); packetHandlers.Add(PacketIncomingType.BlockChange, blockHandler); packetHandlers.Add(PacketIncomingType.KeepAlive, new KeepAliveHandler(packetSender)); packetHandlers.Add(PacketIncomingType.JoinGame, new JoinGameHandler(handler, dataTypes, worldInfo, protocolVersion)); packetHandlers.Add(PacketIncomingType.ChatMessage, new ChatMessageHandler(handler, dataTypes)); packetHandlers.Add(PacketIncomingType.Respawn, new RespawnHandler(handler, dataTypes, worldInfo, protocolVersion)); packetHandlers.Add(PacketIncomingType.PlayerPositionAndLook, new PlayerPositionAndLookHandler(packetSender, dataTypes, handler, player, protocolVersion)); packetHandlers.Add(PacketIncomingType.ChunkData, new ChunkDataHandler(handler, dataTypes, pTerrain, worldInfo, protocolVersion)); packetHandlers.Add(PacketIncomingType.MultiBlockChange, new MultiBlockChangeHandler(handler, dataTypes, protocolVersion)); packetHandlers.Add(PacketIncomingType.MapChunkBulk, new MapChunkBulkHandler(handler, dataTypes, protocolVersion, pTerrain, worldInfo)); packetHandlers.Add(PacketIncomingType.UnloadChunk, new UnloadChunkHandler(handler, dataTypes, protocolVersion)); packetHandlers.Add(PacketIncomingType.PlayerListUpdate, new PlayerListUpdateHandler(handler, dataTypes, protocolVersion)); packetHandlers.Add(PacketIncomingType.TabCompleteResult, new TabCompleteResultHandler(handler, dataTypes, protocol18Handler, protocolVersion)); packetHandlers.Add(PacketIncomingType.PluginMessage, new PluginMessageHandler(handler, dataTypes, pForge, worldInfo, protocolVersion)); packetHandlers.Add(PacketIncomingType.KickPacket, new KickHandler(handler, dataTypes)); packetHandlers.Add(PacketIncomingType.NetworkCompressionTreshold, new NetworkCompressionThresholdHandler(handler, dataTypes, protocol18Handler, protocolVersion)); packetHandlers.Add(PacketIncomingType.OpenWindow, new OpenWindowHandler(player, dataTypes)); packetHandlers.Add(PacketIncomingType.CloseWindow, new CloseWindowHandler(dataTypes, player)); packetHandlers.Add(PacketIncomingType.WindowItems, new WindowItemsHandler(player, dataTypes)); packetHandlers.Add(PacketIncomingType.ResourcePackSend, new ResourecePackSendHandler(dataTypes, packetSender, protocolVersion)); }
public TabCompleteResultHandler(IMinecraftComHandler handler, DataTypes dataTypes, Protocol18Handler protocol18Handler, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.protocol18Handler = protocol18Handler; this.protocolversion = protocolversion; }
public NetworkCompressionThresholdHandler(IMinecraftComHandler handler, DataTypes dataTypes, Protocol18Handler Protocol18Handler, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.Protocol18Handler = Protocol18Handler; this.protocolversion = protocolversion; }
public PlayerPositionAndLookHandler(IPacketReadWriter packetSender, DataTypes dataTypes, IMinecraftComHandler handler, Player player, int protocolversion) { this.dataTypes = dataTypes; this.packetSender = packetSender; this.handler = handler; this.player = player; this.protocolversion = protocolversion; }
public MapChunkBulkHandler(IMinecraftComHandler handler, DataTypes dataTypes, int protocolversion, Protocol18Terrain pTerrain, WorldInfo worldInfo) { this.handler = handler; this.dataTypes = dataTypes; this.protocolversion = protocolversion; this.pTerrain = pTerrain; this.worldInfo = worldInfo; }
public Protocol18Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); ChatParser.InitTranslations(); this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; }
public Protocol17Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); ChatParser.InitTranslations(); this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; }
/// <summary> /// Initialize a new Forge protocol handler /// </summary> /// <param name="forgeInfo">Forge Server Information</param> /// <param name="protocolVersion">Minecraft protocol version</param> /// <param name="dataTypes">Minecraft data types handler</param> public Protocol18Forge(ForgeInfo forgeInfo, int protocolVersion, DataTypes dataTypes, Protocol18Handler protocol18, IMinecraftComHandler mcHandler) { this.forgeInfo = forgeInfo; this.protocolversion = protocolVersion; this.dataTypes = dataTypes; this.protocol18 = protocol18; this.mcHandler = mcHandler; }
public ChunkDataHandler(IMinecraftComHandler handler, DataTypes dataTypes, Protocol18Terrain protocol18Terrain, WorldInfo worldInfo, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.pTerrain = protocol18Terrain; this.worldInfo = worldInfo; this.protocolversion = protocolversion; }
public PluginMessageHandler(IMinecraftComHandler handler, DataTypes dataTypes, Protocol18Forge pForge, WorldInfo worldInfo, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.pForge = pForge; this.worldInfo = worldInfo; this.protocolversion = protocolversion; }
/// <summary> /// Get a protocol handler for the specified Minecraft version /// </summary> /// <param name="Client">Tcp Client connected to the server</param> /// <param name="ProtocolVersion">Protocol version to handle</param> /// <param name="Handler">Handler with the appropriate callbacks</param> /// <returns></returns> public static IMinecraftCom getProtocolHandler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1) return new Protocol16Handler(Client, ProtocolVersion, Handler); int[] supportedVersions_Protocol17 = { 4, 5 }; if (Array.IndexOf(supportedVersions_Protocol17, ProtocolVersion) > -1) return new Protocol17Handler(Client, ProtocolVersion, Handler); int[] supportedVersions_Protocol18 = { 47 }; if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1) return new Protocol18Handler(Client, ProtocolVersion, Handler); throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported."); }
public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); //Null obj pattern? }
public Protocol18Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler, ForgeInfo ForgeInfo) { ConsoleIO.SetAutoCompleteEngine(this); ChatParser.InitTranslations(); this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; this.forgeInfo = ForgeInfo; if (Settings.TerrainAndMovements && protocolversion > MC18Version) { ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); Settings.TerrainAndMovements = false; } }
public Protocol18Handler(TcpClient Client, int protocolVersion, IMinecraftComHandler handler, ForgeInfo forgeInfo, Player player) { this.player = player; ConsoleIO.SetAutoCompleteEngine(this); ChatParser.InitTranslations(); connectionInfo = new ConnectionInfo(new SocketWrapper(Client), 0); this.dataTypes = new DataTypes(protocolVersion); this.protocolversion = protocolVersion; this.handler = handler; this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, handler); this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler); if (protocolversion > (int)McVersion.V1142) { ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); //Modify client pool for terrain? } if (player.GetInventoryEnabled() && protocolversion > (int)McVersion.V114) { ConsoleIO.WriteLineFormatted("§8Inventories are currently not handled for that MC version."); player.SetInventoryEnabled(false); } if (protocolversion >= (int)McVersion.V18) { if (protocolVersion >= (int)McVersion.V114) { Block.Palette = new Palette114(); } else { Block.Palette = new Palette113(); } } else { Block.Palette = new Palette112(); } packetReadWriter = new Protocol18PacketReadWriter(connectionInfo, dataTypes, protocolVersion); packetHandler = new Protocol18PacketHandler(protocolVersion, dataTypes, handler, packetReadWriter, pTerrain, pForge, worldInfo, this, player); pForge.packetReadWriter = packetReadWriter; }
public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { //ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; /*if (Settings.TerrainAndMovements) * { * //ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); * Settings.TerrainAndMovements = false; * }*/ }
public Protocol16Handler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { ConsoleIO.SetAutoCompleteEngine(this); if (protocolversion >= 72) { ChatParser.InitTranslations(); } this.c = Client; this.protocolversion = ProtocolVersion; this.handler = Handler; if (Settings.TerrainAndMovements) { ConsoleIO.WriteLineFormatted("§2[HtBot]§a Terreno e Movimentos não são suportados nessa versão do Minecraft."); Settings.TerrainAndMovements = false; } }
public Protocol18Handler(TcpClient Client, int protocolVersion, IMinecraftComHandler handler, ForgeInfo forgeInfo) { ConsoleIO.SetAutoCompleteEngine(this); ChatParser.InitTranslations(); this.socketWrapper = new SocketWrapper(Client); this.dataTypes = new DataTypes(protocolVersion); this.protocolversion = protocolVersion; this.handler = handler; this.pForge = new Protocol18Forge(forgeInfo, protocolVersion, dataTypes, this, handler); this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler); if (handler.GetTerrainEnabled() && protocolversion > MC1142Version) { ConsoleIO.WriteLineFormatted("§8Terrain & Movements currently not handled for that MC version."); handler.SetTerrainEnabled(false); } if (handler.GetInventoryEnabled() && protocolversion > MC114Version) { ConsoleIO.WriteLineFormatted("§8Inventories are currently not handled for that MC version."); handler.SetInventoryEnabled(false); } if (protocolversion >= MC113Version) { if (protocolVersion > MC1142Version && handler.GetTerrainEnabled()) { throw new NotImplementedException("Please update block types handling for this Minecraft version. See Material.cs"); } if (protocolVersion >= MC114Version) { Block.Palette = new Palette114(); } else { Block.Palette = new Palette113(); } } else { Block.Palette = new Palette112(); } }
public MultiBlockChangeHandler(IMinecraftComHandler handler, DataTypes dataTypes, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.protocolversion = protocolversion; }
/// <summary> /// Get a protocol handler for the specified Minecraft version /// </summary> /// <param name="Client">Tcp Client connected to the server</param> /// <param name="ProtocolVersion">Protocol version to handle</param> /// <param name="Handler">Handler with the appropriate callbacks</param> /// <returns></returns> public static IMinecraftCom GetProtocolHandler(TcpClient Client, int ProtocolVersion, ForgeInfo forgeInfo, IMinecraftComHandler Handler) { int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1) { return(new Protocol16Handler(Client, ProtocolVersion, Handler)); } int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485 }; if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1) { return(new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo)); } throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported."); }
public KickHandler(IMinecraftComHandler handler, DataTypes dataTypes) { this.handler = handler; this.dataTypes = dataTypes; }
public UnloadChunkHandler(IMinecraftComHandler handler, DataTypes dataTypes, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.protocolversion = protocolversion; }
public ChatMessageHandler(IMinecraftComHandler handler, DataTypes dataTypes) { this.handler = handler; this.dataTypes = dataTypes; }
/// <summary> /// Get a protocol handler for the specified Minecraft version /// </summary> /// <param name="Client">Tcp Client connected to the server</param> /// <param name="ProtocolVersion">Protocol version to handle</param> /// <param name="Handler">Handler with the appropriate callbacks</param> /// <returns></returns> public static IMinecraftCom GetProtocolHandler(TcpClient Client, int ProtocolVersion, ForgeInfo forgeInfo, IMinecraftComHandler Handler) { int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1) { return(new Protocol16Handler(Client, ProtocolVersion, Handler)); } int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575, 578, 735, 736, 751, 753, 754 }; if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1) { return(new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo)); } throw new NotSupportedException(Translations.Get("exception.version_unsupport", ProtocolVersion)); }
/// <summary> /// Get a protocol handler for the specified Minecraft version /// </summary> /// <param name="Client">Tcp Client connected to the server</param> /// <param name="ProtocolVersion">Protocol version to handle</param> /// <param name="Handler">Handler with the appropriate callbacks</param> /// <returns></returns> public static IMinecraftCom getProtocolHandler(TcpClient Client, int ProtocolVersion, IMinecraftComHandler Handler) { int[] supportedVersions_Protocol16 = { 51, 60, 61, 72, 73, 74, 78 }; if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1) { return(new Protocol16Handler(Client, ProtocolVersion, Handler)); } int[] supportedVersions_Protocol17 = { 4, 5 }; if (Array.IndexOf(supportedVersions_Protocol17, ProtocolVersion) > -1) { return(new Protocol17Handler(Client, ProtocolVersion, Handler)); } int[] supportedVersions_Protocol18 = { 47 }; if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1) { return(new Protocol18Handler(Client, ProtocolVersion, Handler)); } throw new NotSupportedException("The protocol version no." + ProtocolVersion + " is not supported."); }
public bool Connect(ServerConnectionInfo serverInfo, Player player, int protocolVersion, ForgeInfo forgeInfo, IMinecraftComHandler minecraftComHandler) { client = ProxyHandler.startNewTcpClient(serverInfo.ServerIP, serverInfo.ServerPort); //client.Connect(serverInfo.ServerIP, serverInfo.ServerPort); client.ReceiveBufferSize = 1024 * 1024; communicationHandler = ProtocolHandler.GetProtocolHandler(client, protocolVersion, forgeInfo, minecraftComHandler, player); return(login()); //send login packets }
/// <summary> /// Initialize a new Terrain Decoder /// </summary> /// <param name="protocolVersion">Minecraft Protocol Version</param> /// <param name="dataTypes">Minecraft Protocol Data Types</param> public Protocol18Terrain(int protocolVersion, DataTypes dataTypes, IMinecraftComHandler handler) { this.protocolversion = protocolVersion; this.dataTypes = dataTypes; this.handler = handler; }
public PlayerListUpdateHandler(IMinecraftComHandler handler, DataTypes dataTypes, int protocolversion) { this.handler = handler; this.dataTypes = dataTypes; this.protocolversion = protocolversion; }
public BlockChangeHandler17(IMinecraftComHandler handler, DataTypes dataTypes) { this.handler = handler; this.dataTypes = dataTypes; }