diff --git a/MCGalaxy/Commands/Information/CmdAbout.cs b/MCGalaxy/Commands/Information/CmdAbout.cs index 26a36bfa7..bfe66c074 100644 --- a/MCGalaxy/Commands/Information/CmdAbout.cs +++ b/MCGalaxy/Commands/Information/CmdAbout.cs @@ -47,7 +47,7 @@ namespace MCGalaxy.Commands.Info { Player.Message(p, "Retrieving block change records.."); bool foundAny = false; - ListFromDatabase(p, ref foundAny, names, x, y, z); + ListFromDatabase(p, ref foundAny, x, y, z); using (IDisposable rLock = p.level.BlockDB.Locker.AccquireRead(30 * 1000)) { if (rLock != null) { p.level.BlockDB.FindChangesAt(x, y, z, @@ -70,8 +70,7 @@ namespace MCGalaxy.Commands.Info { return true; } - static void ListFromDatabase(Player p, ref bool foundAny, Dictionary names, - ushort x, ushort y, ushort z) { + static void ListFromDatabase(Player p, ref bool foundAny, ushort x, ushort y, ushort z) { if (!Database.TableExists("Block" + p.level.name)) return; using (DataTable Blocks = Database.Backend.GetRows("Block" + p.level.name, "*", "WHERE X=@0 AND Y=@1 AND Z=@2", x, y, z)) { @@ -116,8 +115,6 @@ namespace MCGalaxy.Commands.Info { BlockDBChange.Output(p, name, entry); } - static ushort U16(object x) { return ushort.Parse(x.ToString()); } - public override void Help(Player p) { Player.Message(p, "%T/about"); Player.Message(p, "%HOutputs the change/edit history for a block."); diff --git a/MCGalaxy/Commands/Information/CmdMapInfo.cs b/MCGalaxy/Commands/Information/CmdMapInfo.cs index afea914b5..004d1c4e6 100644 --- a/MCGalaxy/Commands/Information/CmdMapInfo.cs +++ b/MCGalaxy/Commands/Information/CmdMapInfo.cs @@ -154,10 +154,6 @@ namespace MCGalaxy.Commands.Info { data.Likes, data.Dislikes); } - static string JoinNames(List items, Player p) { - return items.Join(name => PlayerInfo.GetColoredName(p, name)); - } - static string GetRealmMapOwner(string lvlName) { bool plus = Server.ClassicubeAccountPlus; // Early out when accounts have + and map doesn't. diff --git a/MCGalaxy/Commands/Information/CmdOpStats.cs b/MCGalaxy/Commands/Information/CmdOpStats.cs index 630c15cbd..89dd03c49 100644 --- a/MCGalaxy/Commands/Information/CmdOpStats.cs +++ b/MCGalaxy/Commands/Information/CmdOpStats.cs @@ -96,16 +96,6 @@ namespace MCGalaxy.Commands.Info { return value == "today" || value == "yesterday" || value == "thismonth" || value == "lastmonth" || value == "all"; } - static void DoQuery(Player p, string group, string start, string end, string name, string cmd, string msg) { - DataTable table = Database.Backend.GetRows( - "Opstats", "COUNT(ID)" ,"WHERE Time >= @0 AND Time < @1 AND " + - "Name LIKE @2 AND Cmd LIKE @3 AND Cmdmsg " + msg, start, end, name, cmd); - - // don't use colour codes in cli or gui - Player.Message(p, (p == null ? "" : "&a") + group + (p == null ? "" : "&5") + table.Rows[0]["COUNT(id)"]); - table.Dispose(); - } - static int Query(string start, string end, string name, string cmd, string msg = "!=''") { using (DataTable table = Database.Backend.GetRows( "Opstats", "COUNT(ID)" ,"WHERE Time >= @0 AND Time < @1 AND " + diff --git a/MCGalaxy/Commands/Information/CmdPlayers.cs b/MCGalaxy/Commands/Information/CmdPlayers.cs index 0e3d2015f..b830b96b0 100644 --- a/MCGalaxy/Commands/Information/CmdPlayers.cs +++ b/MCGalaxy/Commands/Information/CmdPlayers.cs @@ -114,8 +114,6 @@ namespace MCGalaxy.Commands.Info { } } - static Section MakeSection(string title) { return MakeSection(Group.standard, title); } - static Section MakeSection(Group group, string title) { Section sec; sec.group = group; diff --git a/MCGalaxy/Commands/World/CmdBlockProperties.cs b/MCGalaxy/Commands/World/CmdBlockProperties.cs index 2ffa7d5d8..afe75b9bd 100644 --- a/MCGalaxy/Commands/World/CmdBlockProperties.cs +++ b/MCGalaxy/Commands/World/CmdBlockProperties.cs @@ -145,7 +145,7 @@ namespace MCGalaxy.Commands.World { Player.Message(p, "Block {0} is {1}: {2}", BlockName(scope, lvl, block), type, getter(props) ? "&aYes" : "&cNo"); - OnPropsChanged(scope, lvl, block, false); + OnPropsChanged(scope, lvl, block); } static void SetEnum(Player p, BlockProps[] scope, ExtBlock block, string msg) { @@ -156,7 +156,7 @@ namespace MCGalaxy.Commands.World { scope[block.Index].AnimalAI = ai; Player.Message(p, "Animal AI for {0} set to: {1}", BlockName(scope, lvl, block), ai); - OnPropsChanged(scope, lvl, block, true); + OnPropsChanged(scope, lvl, block); } static void SetDeathMessage(Player p, BlockProps[] scope, ExtBlock block, string msg) { @@ -170,11 +170,11 @@ namespace MCGalaxy.Commands.World { Player.Message(p, "Death message for {0} set to: {1}", BlockName(scope, lvl, block), msg); } - OnPropsChanged(scope, lvl, block, false); + OnPropsChanged(scope, lvl, block); } - static void OnPropsChanged(BlockProps[] scope, Level level, ExtBlock block, bool physics) { + static void OnPropsChanged(BlockProps[] scope, Level level, ExtBlock block) { scope[block.Index].Changed = true; if (scope == Block.Props) { diff --git a/MCGalaxy/Commands/World/CmdImport.cs b/MCGalaxy/Commands/World/CmdImport.cs index 7bd8539cf..b1ece94bf 100644 --- a/MCGalaxy/Commands/World/CmdImport.cs +++ b/MCGalaxy/Commands/World/CmdImport.cs @@ -61,8 +61,6 @@ namespace MCGalaxy.Commands.World { Player.Message(p, "Converted map!"); } - enum FileType { Mcf, Fcm, Dat, Cw }; - public override void Help(Player p) { Player.Message(p, "%T/import [name]"); Player.Message(p, "%HImports a map file with that name."); diff --git a/MCGalaxy/Commands/World/CmdMap.cs b/MCGalaxy/Commands/World/CmdMap.cs index 81b7c95a6..5941de28f 100644 --- a/MCGalaxy/Commands/World/CmdMap.cs +++ b/MCGalaxy/Commands/World/CmdMap.cs @@ -126,15 +126,6 @@ namespace MCGalaxy.Commands.World { GetBool(lvl.Buildable), GetBool(lvl.Deletable)); } - internal static void SetBool(Player p, Level lvl, ref bool target, string name, bool negate = false) { - target = !target; - bool display = negate ? !target : target; - lvl.ChatLevel(name + GetBool(display)); - - if (p == null || p.level != lvl) - Player.Message(p, name + GetBool(display, p == null)); - } - static string GetBool(bool value, bool console = false) { return console ? (value ? "ON" : "OFF") : (value ? "&aON" : "&cOFF"); } diff --git a/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs b/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs index 181283318..3e3ad0dae 100644 --- a/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs +++ b/MCGalaxy/Drawing/DrawOps/WriteDrawOp.cs @@ -51,11 +51,11 @@ namespace MCGalaxy.Drawing.Ops { pos = p1; foreach (char c in Text) { - DrawLetter(Player, Level, c, brush, output); + DrawLetter(Player, c, brush, output); } } - void DrawLetter(Player p, Level lvl, char c, Brush brush, DrawOpOutput output) { + void DrawLetter(Player p, char c, Brush brush, DrawOpOutput output) { if ((int)c >= 256 || letters[(int)c] == null) { Player.Message(p, "\"" + c + "\" is not currently supported, replacing with space."); pos.X = (ushort)(pos.X + dirX * 4 * Scale); diff --git a/MCGalaxy/Drawing/Image/IPaletteMatcher.cs b/MCGalaxy/Drawing/Image/IPaletteMatcher.cs index df0a3969f..5456a03bc 100644 --- a/MCGalaxy/Drawing/Image/IPaletteMatcher.cs +++ b/MCGalaxy/Drawing/Image/IPaletteMatcher.cs @@ -99,7 +99,7 @@ namespace MCGalaxy.Drawing { public byte BestMatch(byte R, byte G, byte B, out bool backLayer) { backLayer = false; - return BestMatch(R, G, B, out backLayer); + return BestMatch(R, G, B); } diff --git a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs index f6d69029f..1ba23b72c 100644 --- a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs +++ b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs @@ -85,55 +85,6 @@ namespace MCGalaxy.Network { bot.connection.Listener.OnPrivateNotice -= Listener_OnPrivateNotice; } - - #region In-game event handlers - - void Player_PlayerAction(Player p, PlayerAction action, - string message, bool stealth) { - if (!bot.Enabled) return; - string msg = null; - - if (action == PlayerAction.AFK && !p.hidden) - msg = p.ColoredName + " %Sis AFK " + message; - else if (action == PlayerAction.UnAFK && !p.hidden) - msg = p.ColoredName + " %Sis no longer AFK"; - else if (action == PlayerAction.Joker) - msg = p.ColoredName + " %Sis now a &aJ&bo&ck&5e&9r%S"; - else if (action == PlayerAction.Unjoker) - msg = p.ColoredName + " %Sis no longer a &aJ&bo&ck&5e&9r%S"; - else if (action == PlayerAction.Me) - msg = "*" + p.DisplayName + " " + message; - else if (action == PlayerAction.Review) - msg = p.ColoredName + " %Sis requesting a review."; - else if (action == PlayerAction.JoinWorld && Server.ircShowWorldChanges && !p.hidden) - msg = p.ColoredName + " %Swent to &8" + message; - - if (msg != null) bot.Say(msg, stealth); - } - - void Player_PlayerDisconnect(Player p, string reason) { - if (!bot.Enabled || p.hidden) return; - if (!Server.guestLeaveNotify && p.Rank <= LevelPermission.Guest) return; - - bot.Say(p.DisplayName + " %Sleft the game (" + reason + "%S)", false); - } - - void Player_PlayerConnect(Player p) { - if (!bot.Enabled || p.hidden) return; - if (!Server.guestJoinNotify && p.Rank <= LevelPermission.Guest) return; - - bot.Say(p.DisplayName + " %Sjoined the game", false); - } - - void Player_PlayerChat(Player p, string message) { - if (!bot.Enabled) return; - if (message.Trim(trimChars) == "") return; - - string name = Server.ircPlayerTitles ? p.FullName : p.group.prefix + p.ColoredName; - bot.Say(name + "%S: " + message, p.opchat); - } - #endregion - void Listener_OnAction(UserInfo user, string channel, string description) { Player.GlobalIRCMessage(String.Format("%I(IRC) * {0} {1}", user.Nick, description));