using System; using System.Collections.Generic; using System.Linq; using System.Text; using MinecraftClient.Crypto; using MinecraftClient.Mapping; namespace MinecraftClient.Protocol { /// /// Interface for the Minecraft protocol handler. /// A protocol handler is used to communicate with the Minecraft server. /// This interface allows to abstract from the underlying minecraft version in other parts of the program. /// The protocol handler will take care of parsing and building the appropriate network packets. /// public interface IMinecraftCom : IDisposable, IAutoComplete { /// /// Start the login procedure once connected to the server /// /// True if login was successful bool Login(); /// /// Disconnect from the server /// /// Reason void Disconnect(); /// /// Get max length for chat messages /// /// Max length, in characters int GetMaxChatMessageLength(); /// /// Send a chat message or command to the server /// /// Text to send /// True if successfully sent bool SendChatMessage(string message); /// /// Allow to respawn after death /// /// True if packet successfully sent bool SendRespawnPacket(); /// /// Inform the server of the client being used to connect /// /// Client string describing the client /// True if brand info was successfully sent bool SendBrandInfo(string brandInfo); /// /// Inform the server of the client's Minecraft settings /// /// Client language eg en_US /// View distance, in chunks /// Game difficulty (client-side...) /// Chat mode (allows muting yourself) /// Show chat colors /// Show skin layers /// 1.9+ main hand /// True if client settings were successfully sent bool SendClientSettings(string language, byte viewDistance, byte difficulty, byte chatMode, bool chatColors, byte skinParts, byte mainHand); /// /// Send a location update telling that we moved to that location /// /// The new location /// True if the player is on the ground /// The new yaw (optional) /// The new pitch (optional) /// True if packet was successfully sent bool SendLocationUpdate(Location location, bool onGround, float? yaw, float? pitch); /// /// Send a plugin channel packet to the server. /// /// /// Channel to send packet on /// packet Data /// True if message was successfully sent bool SendPluginChannelPacket(string channel, byte[] data); } }