diff --git a/MCGalaxy/Games/IGame.cs b/MCGalaxy/Games/IGame.cs index 489cb9043..ceae4e516 100644 --- a/MCGalaxy/Games/IGame.cs +++ b/MCGalaxy/Games/IGame.cs @@ -20,37 +20,19 @@ using System; namespace MCGalaxy.Games { public abstract class IGame { - - /// Name of the map this game is running on. public string MapName; - - /// Level instance of the map this game is running on. public Level Map; - - /// Gets whether this game is currently running. public abstract bool Running { get; } /// Whether players are allowed to teleport to others when not in referee mode. - public virtual bool TeleportAllowed { get { return true; } } - + public virtual bool TeleportAllowed { get { return true; } } /// Returns whether this game handled the player sending a chat message. - public virtual bool HandlesChatMessage(Player p, string message) { - return false; - } + public virtual bool HandlesChatMessage(Player p, string message) { return false; } - /// Raised when a player joins the server. public virtual void PlayerJoinedServer(Player p) { } - - /// Raised when a player joins this game. public virtual void PlayerJoinedGame(Player p) { } - - /// Raised when a player leaves this game. public virtual void PlayerLeftGame(Player p) { } - - /// Raised when a player moves to a different map/level. public virtual void PlayerJoinedLevel(Player p, Level lvl, Level oldLvl) { } - - /// Raised when the server is about to send a heartbeat. public virtual void OnHeartbeat(ref string name) { } /// Adjusts the prefix (e.g. title) shown before the player's name in chat. diff --git a/MCGalaxy/Games/LevelPicker.cs b/MCGalaxy/Games/LevelPicker.cs index 9f399f3e4..5aa996387 100644 --- a/MCGalaxy/Games/LevelPicker.cs +++ b/MCGalaxy/Games/LevelPicker.cs @@ -22,11 +22,7 @@ using System.Threading; namespace MCGalaxy.Games { public abstract class LevelPicker { - - /// Level specifically chosen to be used in the next round. public string QueuedMap; - - /// List of maps that have been recently played in this game. public List RecentMaps = new List(); internal string Candidate1 = "", Candidate2 = "", Candidate3 = ""; diff --git a/MCGalaxy/sharkbite.thresher/CommandBuilder.cs b/MCGalaxy/sharkbite.thresher/CommandBuilder.cs index ad958a8af..3a5882f94 100644 --- a/MCGalaxy/sharkbite.thresher/CommandBuilder.cs +++ b/MCGalaxy/sharkbite.thresher/CommandBuilder.cs @@ -41,6 +41,8 @@ namespace Sharkbite.Irc internal const char SPACE = ' '; internal const string SPACE_COLON = " :"; internal const int MAX_COMMAND_SIZE = 512; + internal const int MAX_HOSTNAME_LEN = 63; + internal const int MAX_NICKNAME_LEN = 30; internal const char CtcpQuote = '\u0001'; internal CommandBuilder(Connection connection) { diff --git a/MCGalaxy/sharkbite.thresher/Sender.cs b/MCGalaxy/sharkbite.thresher/Sender.cs index ee48ea031..213b0b9dc 100644 --- a/MCGalaxy/sharkbite.thresher/Sender.cs +++ b/MCGalaxy/sharkbite.thresher/Sender.cs @@ -755,7 +755,7 @@ namespace Sharkbite.Irc if (Rfc2812Util.IsValidChannelName(channel)) { // 11 is PRIVMSG + 2 x Spaces + : + CR + LF - int max = MAX_COMMAND_SIZE - 11 - channel.Length; + int max = MAX_COMMAND_SIZE - 11 - channel.Length - MAX_HOSTNAME_LEN - MAX_NICKNAME_LEN; if (message.Length > max) { string[] parts = BreakUpMessage( message, max ); @@ -806,7 +806,7 @@ namespace Sharkbite.Irc if (Rfc2812Util.IsValidNick(nick)) { // 11 is PRIVMSG + 2 x Spaces + : + CR + LF - int max = MAX_COMMAND_SIZE - 11 - nick.Length; + int max = MAX_COMMAND_SIZE - 11 - nick.Length - MAX_HOSTNAME_LEN - MAX_NICKNAME_LEN; if (message.Length > max) { string[] parts = BreakUpMessage( message, max );