using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MinecraftClient.Protocol { /// /// Interface for the MinecraftCom Handler. /// It defines some callbacks that the MinecraftCom handler must have. /// It allows the protocol handler to abstract from the other parts of the program. /// public interface IMinecraftComHandler { /* The MinecraftCom Hanler must * provide these getters */ int GetServerPort(); string GetServerHost(); string GetUsername(); string GetUserUUID(); string GetSessionID(); string[] GetOnlinePlayers(); /// /// This method is called when the protocol handler receives a chat message /// void OnTextReceived(string text); /// /// This method is called when a new player joins the game /// /// UUID of the player /// Name of the player void OnPlayerJoin(Guid uuid, string name); /// /// This method is called when a player has left the game /// /// UUID of the player void OnPlayerLeave(Guid uuid); /// /// This method is called when the connection has been lost /// void OnConnectionLost(ChatBot.DisconnectReason reason, string message); /// /// Called ~10 times per second (10 ticks per second) /// Useful for updating bots in other parts of the program /// void OnUpdate(); } }