diff --git a/Commands/Chat/CmdNick.cs b/Commands/Chat/CmdNick.cs index 2b8247278..54d7b60b7 100644 --- a/Commands/Chat/CmdNick.cs +++ b/Commands/Chat/CmdNick.cs @@ -56,21 +56,21 @@ namespace MCGalaxy.Commands { else SetNick(p, who, args); } - static void SetBotNick(Player p, PlayerBot pBot, string[] args) { + static void SetBotNick(Player p, PlayerBot bot, string[] args) { string newName = args.Length > 2 ? args[2] : ""; if (newName == "") { - pBot.DisplayName = pBot.name; - Player.GlobalMessage("Bot " + pBot.ColoredName + "'s %Sreverted to their original name."); + bot.DisplayName = bot.name; + Chat.MessageAll("Bot {0}'s %Sreverted to their original name.", bot.ColoredName); } else { string nameTag = newName.CaselessEq("empty") ? "" : newName; if (newName.Length >= 30) { Player.Message(p, "Name must be under 30 letters."); return; } - Player.GlobalMessage("Bot " + pBot.ColoredName + "'s %Sname was set to " + nameTag + "%S."); - pBot.DisplayName = newName; + Chat.MessageAll("Bot {0}'s %Sname was set to {1}%S.", bot.ColoredName, nameTag); + bot.DisplayName = newName; } - pBot.GlobalDespawn(); - pBot.GlobalSpawn(); - BotsFile.UpdateBot(pBot); + bot.GlobalDespawn(); + bot.GlobalSpawn(); + BotsFile.UpdateBot(bot); } static void SetNick(Player p, Player who, string[] args) { diff --git a/Commands/Chat/CmdSay.cs b/Commands/Chat/CmdSay.cs index 592191172..5fe8acbdc 100644 --- a/Commands/Chat/CmdSay.cs +++ b/Commands/Chat/CmdSay.cs @@ -30,7 +30,7 @@ namespace MCGalaxy.Commands { if (message == "") { Help(p); return; } message = Colors.EscapeColors(message); - Player.GlobalMessage(message); + Chat.MessageAll(message); Server.IRC.Say(message); } diff --git a/Commands/Fun/CmdLavaSurvival.cs b/Commands/Fun/CmdLavaSurvival.cs index 9e1e7e896..69a74c3f1 100644 --- a/Commands/Fun/CmdLavaSurvival.cs +++ b/Commands/Fun/CmdLavaSurvival.cs @@ -57,7 +57,7 @@ namespace MCGalaxy.Commands switch (Server.lava.Start(s.Length > 1 ? s[1] : "")) { case 0: - Player.GlobalMessage("Lava Survival has started! Join the fun with /ls go"); + Chat.MessageAll("Lava Survival has started! Join the fun with /ls go"); return; case 1: Player.Message(p, "There is already an active Lava Survival game."); @@ -78,7 +78,7 @@ namespace MCGalaxy.Commands switch (Server.lava.Stop()) { case 0: - Player.GlobalMessage("Lava Survival has ended! We hope you had fun!"); + Chat.MessageAll("Lava Survival has ended! We hope you had fun!"); return; case 1: Player.Message(p, "There isn't an active Lava Survival game."); diff --git a/Commands/Moderation/CmdBan.cs b/Commands/Moderation/CmdBan.cs index 9a71e2075..91ce50c69 100644 --- a/Commands/Moderation/CmdBan.cs +++ b/Commands/Moderation/CmdBan.cs @@ -51,14 +51,14 @@ namespace MCGalaxy.Commands.Moderation { string banMsg = null; if (who == null) { banMsg = target + " &f(offline) %Swas &8banned %Sby " + banner + "%S." + banReason; - Player.GlobalMessage(banMsg); + Chat.MessageAll(banMsg); } else { if (stealth) { banMsg = who.ColoredName + " %Swas STEALTH &8banned %Sby " + banner + "%S." + banReason; Chat.MessageOps(banMsg); } else { banMsg = who.ColoredName + " %Swas &8banned %Sby " + banner + "%S." + banReason; - Player.GlobalMessage(banMsg); + Chat.MessageAll(banMsg); } who.color = ""; } diff --git a/Commands/Moderation/CmdSetRank.cs b/Commands/Moderation/CmdSetRank.cs index fde2653ae..1913aec78 100644 --- a/Commands/Moderation/CmdSetRank.cs +++ b/Commands/Moderation/CmdSetRank.cs @@ -52,10 +52,10 @@ namespace MCGalaxy.Commands.Moderation { if (who == null) { rankMsg = name + " &f(offline)%S's rank was set to " + newRank.ColoredName + "%S. (" + reason + "%S)"; - Player.GlobalMessage(rankMsg); + Chat.MessageAll(rankMsg); } else { rankMsg = who.ColoredName + "%S's rank was set to " + newRank.ColoredName + "%S. (" + reason + "%S)"; - Player.GlobalMessage(rankMsg); + Chat.MessageAll(rankMsg); who.SendMessage("You are now ranked " + newRank.ColoredName + "%S, type /help for your new set of commands."); } diff --git a/Commands/Moderation/CmdShutdown.cs b/Commands/Moderation/CmdShutdown.cs index 98a071fcc..ddcf8a11a 100644 --- a/Commands/Moderation/CmdShutdown.cs +++ b/Commands/Moderation/CmdShutdown.cs @@ -69,7 +69,7 @@ namespace MCGalaxy.Commands { } static void Log(string message) { - Player.GlobalMessage("&4" + message); + Chat.MessageAll("&4" + message); Server.s.Log(message); } diff --git a/Commands/Moderation/CmdWarn.cs b/Commands/Moderation/CmdWarn.cs index 24bdf355b..25f5e7f33 100644 --- a/Commands/Moderation/CmdWarn.cs +++ b/Commands/Moderation/CmdWarn.cs @@ -37,7 +37,7 @@ namespace MCGalaxy.Commands.Moderation { string warnedby = (p == null) ? "(console)" : p.ColoredName; Player.GlobalMessage(warnedby + " %ewarned " + who.ColoredName + " %ebecause:"); - Player.GlobalMessage("&c" + reason); + Chat.MessageAll("&c" + reason); Server.IRC.Say(warnedby + " %ewarned " + who.ColoredName + " %efor: %c" + reason); Server.s.Log(warnedby + " warned " + who.name); diff --git a/Commands/World/CmdLoad.cs b/Commands/World/CmdLoad.cs index e74f27862..fec961cd6 100644 --- a/Commands/World/CmdLoad.cs +++ b/Commands/World/CmdLoad.cs @@ -63,7 +63,7 @@ namespace MCGalaxy.Commands { LevelInfo.Loaded.Add(lvl); if (p == null || !p.hidden) - Player.GlobalMessage("Level \"{0}\" loaded.", lvl.name); + Chat.MessageAll("Level \"{0}\" loaded.", lvl.name); /*try { Gui.Window.thisWindow.UpdatePlayerMapCombo(); Gui.Window.thisWindow.UnloadedlistUpdate(); diff --git a/Commands/World/CmdSave.cs b/Commands/World/CmdSave.cs index a78efe1b7..fe8a7332d 100644 --- a/Commands/World/CmdSave.cs +++ b/Commands/World/CmdSave.cs @@ -42,7 +42,7 @@ namespace MCGalaxy.Commands { Server.ErrorLog(ex); } } - Player.GlobalMessage("All levels have been saved."); + Chat.MessageAll("All levels have been saved."); } else { string[] args = message.Split(' '); if (message == "") { @@ -67,10 +67,10 @@ namespace MCGalaxy.Commands { if (restoreName == "") { Server.s.Log("Backup " + num + " saved for " + lvl.name); - Player.GlobalMessage("Backup " + num + " saved for " + lvl.name); + Chat.MessageAll("Backup {0} saved for {1}", num, lvl.name); } else { Server.s.Log(lvl.name + " had a backup created named &b" + restoreName); - Player.GlobalMessage(lvl.name + " had a backup created named &b" + restoreName); + Chat.MessageAll("{1} had a backup created named &b{0}", restoreName, lvl.name); } } diff --git a/Commands/World/CmdUnflood.cs b/Commands/World/CmdUnflood.cs index 8cf628d5e..923094d3c 100644 --- a/Commands/World/CmdUnflood.cs +++ b/Commands/World/CmdUnflood.cs @@ -43,7 +43,7 @@ namespace MCGalaxy.Commands cmd.Use(p, args + " air"); CmdPhysics.SetPhysics(p.level, phys); - Chat.MessageLevel("Unflooded!"); + Chat.MessageLevel(p.level, "Unflooded!"); } public override void Help(Player p) { diff --git a/Commands/building/CmdUndo.cs b/Commands/building/CmdUndo.cs index 1470a6303..4f6701a37 100644 --- a/Commands/building/CmdUndo.cs +++ b/Commands/building/CmdUndo.cs @@ -161,7 +161,7 @@ namespace MCGalaxy.Commands.Building { op.seconds = seconds; DrawOp.DoDrawOp(op, null, p, new Vec3S32[] { Vec3U16.MaxVal, Vec3U16.MaxVal } ); - Player.GlobalMessage("Physics were undone &b" + seconds + " %Sseconds"); + Chat.MessageAll("Physics were undone &b{0} %Sseconds", seconds); Server.s.Log( "Physics were undone &b" + seconds + " %Sseconds"); p.level.Save(true); } diff --git a/Commands/other/CmdSummon.cs b/Commands/other/CmdSummon.cs index 195a4dfd2..7f2bbafbc 100644 --- a/Commands/other/CmdSummon.cs +++ b/Commands/other/CmdSummon.cs @@ -42,7 +42,7 @@ namespace MCGalaxy.Commands { pl.SendMessage("You were summoned by " + p.ColoredName + "%S."); } } - Player.GlobalMessage(p.ColoredName + " %Ssummoned everyone!"); + Chat.MessageAll("{0} %Ssummoned everyone!", p.ColoredName); return; } diff --git a/Games/Countdown/CountdownGame.Game.cs b/Games/Countdown/CountdownGame.Game.cs index a392596ad..aa24dc71a 100644 --- a/Games/Countdown/CountdownGame.Game.cs +++ b/Games/Countdown/CountdownGame.Game.cs @@ -26,7 +26,7 @@ namespace MCGalaxy.Games { if (!Server.Countdown.players.Contains(p)) { Server.Countdown.players.Add(p); Player.Message(p, "You've joined the Countdown game!!"); - Player.GlobalMessage(p.name + " has joined Countdown!!"); + Chat.MessageAll("{0} has joined Countdown!!", p.name); if (p.level != Server.Countdown.mapon) PlayerActions.ChangeMap(p, "countdown"); p.playerofcountdown = true; diff --git a/Games/Countdown/CountdownGame.cs b/Games/Countdown/CountdownGame.cs index 89678d773..766953db5 100644 --- a/Games/Countdown/CountdownGame.cs +++ b/Games/Countdown/CountdownGame.cs @@ -284,7 +284,7 @@ namespace MCGalaxy.Games { Player.Message(pl, "The countdown game was canceled!"); Command.all.Find("spawn").Use(pl, ""); } - Player.GlobalMessage("The countdown game was canceled!!"); + Chat.MessageAll("The countdown game was canceled!!"); gamestatus = CountdownGameStatus.Enabled; playersleftlist.Clear(); players.Clear(); diff --git a/Levels/Level.Physics.cs b/Levels/Level.Physics.cs index e88fd8848..b366001c1 100644 --- a/Levels/Level.Physics.cs +++ b/Levels/Level.Physics.cs @@ -82,7 +82,7 @@ namespace MCGalaxy { setPhysics(0); ClearPhysics(); - Player.GlobalMessage("Physics shutdown on &b" + name); + Chat.MessageAll("Physics shutdown on &b{0}", name); Server.s.Log("Physics shutdown on " + name); if (PhysicsStateChanged != null) PhysicsStateChanged(this, PhysicsState.Stopped); diff --git a/Levels/Level.cs b/Levels/Level.cs index bd8225fcd..d2caebc2a 100644 --- a/Levels/Level.cs +++ b/Levels/Level.cs @@ -255,7 +255,7 @@ namespace MCGalaxy { } } catch (Exception e) { Server.s.Log("FAILED TO SAVE :" + name); - Player.GlobalMessage("FAILED TO SAVE :" + name); + Chat.MessageAll("FAILED TO SAVE :{0}", name); Server.ErrorLog(e); } GC.Collect(); diff --git a/Player/Player.Login.cs b/Player/Player.Login.cs index d4aede357..021e7edd2 100644 --- a/Player/Player.Login.cs +++ b/Player/Player.Login.cs @@ -231,7 +231,7 @@ namespace MCGalaxy { CheckOutdatedClient(); } catch (Exception e) { Server.ErrorLog(e); - Player.GlobalMessage("An error occurred: " + e.Message); + Chat.MessageAll("An error occurred: {0}", e.Message); } //OpenClassic Client Check diff --git a/Player/Player.cs b/Player/Player.cs index a2ad58fea..a4073e6fd 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -204,7 +204,7 @@ namespace MCGalaxy { } public static void GlobalMessage(Player from, string message) { - if (from == null) GlobalMessage(message, false); + if (from == null) Chat.MessageAll(message); else SendChatFrom(from, message, false); } diff --git a/Server/Server.cs b/Server/Server.cs index 8ca7818ad..27a4d5e74 100644 --- a/Server/Server.cs +++ b/Server/Server.cs @@ -370,7 +370,7 @@ namespace MCGalaxy { static void RandomMessage(SchedulerTask task) { if (Player.number != 0 && messages.Count > 0) - Player.GlobalMessage(messages[new Random().Next(0, messages.Count)]); + Chat.MessageAll(messages[new Random().Next(0, messages.Count)]); } internal void SettingsUpdate() { diff --git a/util/App.cs b/util/App.cs index 99adc7597..89715349e 100644 --- a/util/App.cs +++ b/util/App.cs @@ -69,12 +69,12 @@ namespace MCGalaxy.Gui { if (Server.autoupdate || p != null) { - Player.GlobalMessage("Updating in &f" + timeLeft + " %Sseconds."); + Chat.MessageAll("Updating in &f{0} %Sseconds.", timeLeft); Server.s.Log("Updating in " + timeLeft + " seconds."); timeLeft = timeLeft - 1; if (timeLeft < 0) { - Player.GlobalMessage("---UPDATING SERVER---"); + Chat.MessageAll("---UPDATING SERVER---"); Server.s.Log("---UPDATING SERVER---"); countDown.Stop(); countDown.Dispose(); @@ -83,7 +83,7 @@ namespace MCGalaxy.Gui } else { - Player.GlobalMessage("Stopping auto restart."); + Chat.MessageAll("Stopping auto restart."); Server.s.Log("Stopping auto restart."); countDown.Stop(); countDown.Dispose();