using System; using System.Net; namespace Robust.Client { /// /// Top level class that controls the game logic of the client. /// [NotContentImplementable] public interface IBaseClient { /// /// Default port that the client tries to connect to if no other port is specified. /// ushort DefaultPort { get; } /// /// Current RunLevel that the client is at. /// ClientRunLevel RunLevel { get; } /// /// Various bits of config info received when setting up a session. /// //TODO: Move this to the CVar system? ServerInfo? GameInfo { get; } /// /// A player name to use when connecting to the server instead of the one found in the configuration. /// string? PlayerNameOverride { get; set; } string? LastDisconnectReason { get; } /// /// Raised when the client RunLevel is changed. /// event EventHandler RunLevelChanged; /// /// Raised when the player successfully joins the server. /// event EventHandler PlayerJoinedServer; /// /// Raised when the player switches to the game. /// event EventHandler PlayerJoinedGame; /// /// Raised right before the player leaves the server. /// event EventHandler PlayerLeaveServer; /// /// Call this after BaseClient has been created. This sets up the object to its initial state. Only call this once. /// void Initialize(); /// /// Connects the Initialized BaseClient to a remote server. /// void ConnectToServer(string ip, ushort port) { ConnectToServer(new DnsEndPoint(ip, port)); } void ConnectToServer(DnsEndPoint endPoint); /// /// Disconnects the connected BaseClient from a remote server. /// void DisconnectFromServer(string reason); /// /// Starts the single player mode. /// void StartSinglePlayer(); /// /// Stops the single player mode. /// void StopSinglePlayer(); } }