mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Make many commands use Chat.MessageAll
This commit is contained in:
parent
f96e0ad499
commit
76acf539fc
@ -76,7 +76,7 @@ namespace MCGalaxy.Commands.CPE {
|
||||
if (isBot) {
|
||||
bot.model = model;
|
||||
Entities.UpdateModel(bot.id, model, bot.level, null);
|
||||
Player.GlobalMessage("Bot " + bot.ColoredName + "'s %Smodel was changed to a &c" + model);
|
||||
Chat.MessageAll("Bot {0}'s %Smodel was changed to a &c{1}", bot.ColoredName, model);
|
||||
BotsFile.UpdateBot(bot);
|
||||
} else {
|
||||
who.model = model;
|
||||
|
@ -36,14 +36,14 @@ namespace MCGalaxy.Commands.CPE {
|
||||
if (message == "") message = p.truename;
|
||||
|
||||
Player who = p;
|
||||
PlayerBot pBot = null;
|
||||
PlayerBot bot = null;
|
||||
bool isBot = message.CaselessStarts("bot ");
|
||||
string[] args = message.SplitSpaces(isBot ? 3 : 2);
|
||||
string skin = null;
|
||||
|
||||
if (isBot && args.Length > 2) {
|
||||
pBot = PlayerBot.FindMatches(p, args[1]);
|
||||
if (pBot == null) return;
|
||||
bot = PlayerBot.FindMatches(p, args[1]);
|
||||
if (bot == null) return;
|
||||
skin = args[2];
|
||||
} else if (args.Length >= 2) {
|
||||
isBot = false;
|
||||
@ -66,11 +66,11 @@ namespace MCGalaxy.Commands.CPE {
|
||||
skin = "http://skins.minecraft.net/MinecraftSkins/" + skin.Substring(1) + ".png";
|
||||
|
||||
if (isBot) {
|
||||
pBot.SkinName = skin;
|
||||
pBot.GlobalDespawn();
|
||||
pBot.GlobalSpawn();
|
||||
Player.GlobalMessage("Bot " + pBot.ColoredName + "'s %Sskin was changed to &c" + skin);
|
||||
BotsFile.UpdateBot(pBot);
|
||||
bot.SkinName = skin;
|
||||
bot.GlobalDespawn();
|
||||
bot.GlobalSpawn();
|
||||
Chat.MessageAll("Bot {0}'s %Sskin was changed to &c{1}", bot.ColoredName, skin);
|
||||
BotsFile.UpdateBot(bot);
|
||||
} else {
|
||||
who.skinName = skin;
|
||||
Entities.GlobalDespawn(who, true);
|
||||
|
@ -48,13 +48,13 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
if (!take) {
|
||||
if (Awards.GiveAward(plName, award)) {
|
||||
Player.GlobalMessage(Server.FindColor(plName) + plName + " %Swas awarded: &b" + award);
|
||||
Chat.MessageAll("{0}{1} %Swas awarded: &b{2}", Server.FindColor(plName), plName, award);
|
||||
} else {
|
||||
Player.Message(p, "The player already has that award."); return;
|
||||
}
|
||||
} else {
|
||||
if (Awards.TakeAward(plName, award)) {
|
||||
Player.GlobalMessage(Server.FindColor(plName) + plName + " %Shad their &b" + award + " %Saward removed");
|
||||
Chat.MessageAll("{0}{1} %Shad their &b{2} %Saward removed", Server.FindColor(plName), plName, award);
|
||||
} else {
|
||||
Player.Message(p, "The player didn't have the award you tried to take"); return;
|
||||
}
|
||||
|
@ -40,13 +40,13 @@ namespace MCGalaxy.Commands {
|
||||
if (!Awards.Add(args[0], args[1])) {
|
||||
Player.Message(p, "This award already exists."); return;
|
||||
} else {
|
||||
Player.GlobalMessage("Award added: &6" + args[0] + " : " + args[1]);
|
||||
Chat.MessageAll("Award added: &6{0} : {1}", args[0], args[1]);
|
||||
}
|
||||
} else {
|
||||
if (!Awards.Remove(args[1])) {
|
||||
Player.Message(p, "This award does not exist."); return;
|
||||
} else {
|
||||
Player.GlobalMessage("Award removed: &6" + args[1]);
|
||||
Chat.MessageAll("Award removed: &6{0}", args[1]);
|
||||
}
|
||||
}
|
||||
Awards.Save();
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands {
|
||||
if (amount < 0) { Player.Message(p, "You can't fakepay a negative amount."); return; }
|
||||
if (amount >= 16777215) { Player.Message(p, "You can only fakepay up to 16777215."); return; }
|
||||
|
||||
Player.GlobalMessage(who.ColoredName + " %Swas given " + amount + " " + Server.moneys);
|
||||
Chat.MessageAll("{0} %Swas given {1} {2}", who.ColoredName, amount, Server.moneys);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -186,11 +186,11 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "The last person alive will win!!");
|
||||
} else if (hasPerm) {
|
||||
if (target == "all") {
|
||||
Player.GlobalMessage("Countdown Rules being sent to everyone by " + p.ColoredName + ":");
|
||||
Player.GlobalMessage("The aim of the game is to stay alive the longest.");
|
||||
Player.GlobalMessage("Don't fall in the lava!!");
|
||||
Player.GlobalMessage("Blocks on the ground will disapear randomly, first going yellow, then orange, then red and finally disappering.");
|
||||
Player.GlobalMessage("The last person alive will win!!");
|
||||
Chat.MessageAll("Countdown Rules being sent to everyone by " + p.ColoredName + ":");
|
||||
Chat.MessageAll("The aim of the game is to stay alive the longest.");
|
||||
Chat.MessageAll("Don't fall in the lava!!");
|
||||
Chat.MessageAll("Blocks on the ground will disapear randomly, first going yellow, then orange, then red and finally disappering.");
|
||||
Chat.MessageAll("The last person alive will win!!");
|
||||
Player.Message(p, "Countdown rules sent to everyone");
|
||||
return;
|
||||
} else if (target == "map") {
|
||||
@ -269,7 +269,7 @@ namespace MCGalaxy.Commands {
|
||||
Server.Countdown.mapon.motd = "Welcome to the Countdown map! -hax";
|
||||
|
||||
Server.Countdown.gamestatus = CountdownGameStatus.Enabled;
|
||||
Player.GlobalMessage("Countdown has been enabled!!");
|
||||
Chat.MessageAll("Countdown has been enabled!!");
|
||||
} else {
|
||||
Player.Message(p, "A Game is either already enabled or is already progress");
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
Player.Message(p, "Starting CTF..");
|
||||
Server.ctf = new Auto_CTF();
|
||||
Player.GlobalMessage("A CTF GAME IS STARTING AT CTF! TYPE /goto CTF to join!");
|
||||
Chat.MessageAll("A CTF GAME IS STARTING AT CTF! TYPE /goto CTF to join!");
|
||||
}
|
||||
else if (Server.ctf.started)
|
||||
{
|
||||
@ -54,7 +54,7 @@ namespace MCGalaxy.Commands
|
||||
else if (!Server.ctf.started)
|
||||
{
|
||||
Server.ctf.Start();
|
||||
Player.GlobalMessage("A CTF GAME IS STARTING AT CTF! TYPE /goto CTF to join!");
|
||||
Chat.MessageAll("A CTF GAME IS STARTING AT CTF! TYPE /goto CTF to join!");
|
||||
}
|
||||
}
|
||||
if (message == "stop")
|
||||
|
@ -26,8 +26,8 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
Server.flipHead = !Server.flipHead;
|
||||
if (Server.flipHead) Player.GlobalMessage("All necks were broken");
|
||||
else Player.GlobalMessage("All necks were mended");
|
||||
if (Server.flipHead) Chat.MessageAll("All necks were broken");
|
||||
else Chat.MessageAll("All necks were mended");
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -35,7 +35,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "Cannot disinfect player");
|
||||
} else if (!who.Game.Referee) {
|
||||
Server.zombie.DisinfectPlayer(who);
|
||||
Player.GlobalMessage(who.ColoredName + " %Swas disinfected!");
|
||||
Chat.MessageAll("{0} %Swas disinfected.", who.ColoredName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "Cannot infect player");
|
||||
} else if (!who.Game.Referee) {
|
||||
Server.zombie.InfectPlayer(who);
|
||||
Player.GlobalMessage(who.ColoredName + " %Swas infected!");
|
||||
Chat.MessageAll("{0} %Swas infected.", who.ColoredName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace MCGalaxy.Commands {
|
||||
bool send = !Server.chatmod && !p.muted;
|
||||
if (p.IsAfk) {
|
||||
if (send) {
|
||||
Player.GlobalMessage("-" + p.ColoredName + "%S- is AFK " + message);
|
||||
Chat.MessageAll("-{0}%S- is AFK {1}", p.ColoredName, message);
|
||||
Player.RaisePlayerAction(p, PlayerAction.AFK, message);
|
||||
} else {
|
||||
Player.Message(p, "You are now marked as being AFK.");
|
||||
@ -61,7 +61,7 @@ namespace MCGalaxy.Commands {
|
||||
OnPlayerAFKEvent.Call(p);
|
||||
} else {
|
||||
if (send) {
|
||||
Player.GlobalMessage("-" + p.ColoredName + "%S- is no longer AFK");
|
||||
Chat.MessageAll("-{0}%S- is no longer AFK", p.ColoredName);
|
||||
Player.RaisePlayerAction(p, PlayerAction.UnAFK, message);
|
||||
} else {
|
||||
Player.Message(p, "You are no longer marked as being AFK.");
|
||||
|
@ -36,13 +36,13 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
if (lvl.guns) {
|
||||
Player.GlobalMessage("&9Gun usage has been disabled on &c" + lvl.name + "&9!");
|
||||
Chat.MessageAll("&9Gun usage has been disabled on &c{0}&9!", lvl.name);
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
foreach (Player pl in players)
|
||||
if (pl.level.name.CaselessEq(lvl.name))
|
||||
pl.aiming = false;
|
||||
} else {
|
||||
Player.GlobalMessage("&9Gun usage has been enabled on &c" + lvl.name + "&9!");
|
||||
Chat.MessageAll("&9Gun usage has been enabled on &c{0}&9!", lvl.name);
|
||||
}
|
||||
lvl.guns = !lvl.guns;
|
||||
Level.SaveSettings(lvl);
|
||||
|
@ -37,35 +37,29 @@ namespace MCGalaxy.Commands {
|
||||
switch (args[0].ToLower()) {
|
||||
case "rt":
|
||||
case "reloadthreshold":
|
||||
Player.GlobalMessage("Threshold before drawing reloads map set to &b" + limit);
|
||||
Server.DrawReloadLimit = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Threshold before drawing reloads map set to {0}", ref Server.DrawReloadLimit, limit);
|
||||
return;
|
||||
case "rp":
|
||||
case "restartphysics":
|
||||
Player.GlobalMessage("Custom /rp's limit was changed to &b" + limit);
|
||||
Server.rpLimit = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Custom /rp's limit was changed to {0}", ref Server.rpLimit, limit);
|
||||
return;
|
||||
case "rpnormal":
|
||||
Player.GlobalMessage("Normal /rp's limit set to &b" + limit);
|
||||
Server.rpNormLimit = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Normal /rp's limit set to {0}", ref Server.rpNormLimit, limit);
|
||||
return;
|
||||
case "pu":
|
||||
case "physicsundo":
|
||||
Player.GlobalMessage("Physics undo max entries set to &b" + limit);
|
||||
Server.physUndo = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Physics undo max entries set to {0}", ref Server.physUndo, limit);
|
||||
return;
|
||||
case "gen":
|
||||
case "genlimit":
|
||||
Player.GlobalMessage("Maximum volume of maps players can generate set to &b" + limit);
|
||||
Server.MapGenLimit = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Maximum volume of maps players can generate set to {0}", ref Server.MapGenLimit, limit);
|
||||
return;
|
||||
case "genadmin":
|
||||
case "genadminlimit":
|
||||
case "admingen":
|
||||
case "admingenlimit":
|
||||
Player.GlobalMessage("Maximum volume of maps admins can generate set to &b" + limit);
|
||||
Server.MapGenLimitAdmin = limit;
|
||||
SrvProperties.Save(); return;
|
||||
SetLimit("Maximum volume of maps admins can generate set to &b{0}", ref Server.MapGenLimitAdmin, limit);
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 2) { Player.Message(p, "You need to provide a rank name for this type."); return; }
|
||||
@ -80,13 +74,19 @@ namespace MCGalaxy.Commands {
|
||||
case "mu":
|
||||
case "maxundo":
|
||||
Player.GlobalMessage(grp.ColoredName + "%S's undo limit set to &b" + limit);
|
||||
grp.maxUndo = limit; break;
|
||||
grp.maxUndo = limit; break;
|
||||
default:
|
||||
Help(p); return;
|
||||
}
|
||||
Group.saveGroups(Group.GroupList);
|
||||
}
|
||||
|
||||
static void SetLimit(string format, ref int target, int limit) {
|
||||
Chat.MessageAll(format, "&b" + limit);
|
||||
target = limit;
|
||||
SrvProperties.Save();
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "%T/limit <type> <amount> [rank]");
|
||||
Player.Message(p, "%HSets the limit for <type>");
|
||||
|
@ -29,10 +29,10 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "" && Server.updateTimer.Interval > 1000) {
|
||||
Server.PositionInterval = 100;
|
||||
Player.GlobalMessage("&dLow lag %Sturned &cOFF %S- positions update every &b100%S ms.");
|
||||
Chat.MessageAll("&dLow lag %Sturned &cOFF %S- positions update every &b100%S ms.");
|
||||
} else if (message == "") {
|
||||
Server.PositionInterval = 2000;
|
||||
Player.GlobalMessage("&dLow lag %Sturned &aON %S- positions update every &b2000%S ms.");
|
||||
Chat.MessageAll("&dLow lag %Sturned &aON %S- positions update every &b2000%S ms.");
|
||||
} else {
|
||||
int interval;
|
||||
if (!int.TryParse(message, out interval)) {
|
||||
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands
|
||||
Player.Message(p, "Interval must be between 20 and 2000 milliseconds."); return;
|
||||
}
|
||||
Server.PositionInterval = interval;
|
||||
Player.GlobalMessage("Positions now update every &b" + interval + " %Smilliseconds.");
|
||||
Chat.MessageAll("Positions now update every &b{0} %Smilliseconds.", interval);
|
||||
}
|
||||
Server.updateTimer.Interval = Server.PositionInterval;
|
||||
SrvProperties.Save();
|
||||
|
@ -28,9 +28,9 @@ namespace MCGalaxy.Commands {
|
||||
if (message != "") { Help(p); return; }
|
||||
|
||||
if (Server.chatmod) {
|
||||
Player.GlobalMessage("Chat moderation has been disabled. Everyone can now speak.");
|
||||
Chat.MessageAll("Chat moderation has been disabled. Everyone can now speak.");
|
||||
} else {
|
||||
Player.GlobalMessage("Chat moderation engaged! Silence the plebians!");
|
||||
Chat.MessageAll("Chat moderation engaged! Silence the plebians!");
|
||||
}
|
||||
Server.chatmod = !Server.chatmod;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands.Moderation {
|
||||
if (Server.muted.Contains(message)) {
|
||||
Server.muted.Remove(message);
|
||||
Server.muted.Save();
|
||||
Player.GlobalMessage(message + " %Sis not online but is now &bun-muted");
|
||||
Chat.MessageAll("{0} %Sis not online but is now &bun-muted", message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
Chat.MessageOps(p.ColoredName + " %Sused &a/votekick");
|
||||
Player.GlobalMessage("&9A vote to kick " + who.ColoredName + " %Shas been called!");
|
||||
Player.GlobalMessage("&9Type &aY %Sor &cN %Sto vote.");
|
||||
Chat.MessageAll("&9A vote to kick {0} %Shas been called!", who.ColoredName);
|
||||
Chat.MessageAll("&9Type &aY %Sor &cN %Sto vote.");
|
||||
|
||||
// 1/3rd of the players must vote or nothing happens
|
||||
// Keep it at 0 to disable min number of votes
|
||||
@ -65,7 +65,7 @@ namespace MCGalaxy.Commands {
|
||||
string name = (string)task.State;
|
||||
Player who = PlayerInfo.FindExact(name);
|
||||
if (who == null) {
|
||||
Player.GlobalMessage(name + " was not kicked, as they already left the server."); return;
|
||||
Chat.MessageAll("{0} was not kicked, as they already left the server.", name); return;
|
||||
}
|
||||
|
||||
int netVotesYes = votesYes - votesNo;
|
||||
@ -74,12 +74,12 @@ namespace MCGalaxy.Commands {
|
||||
Server.s.Log("VoteKick results for " + who.DisplayName + ": " + votesYes + " yes and " + votesNo + " no votes.");
|
||||
|
||||
if (votesYes + votesNo < Server.voteKickVotesNeeded) {
|
||||
Player.GlobalMessage("Not enough votes were made. " + who.ColoredName + " %Sshall remain!");
|
||||
Chat.MessageAll("Not enough votes were made. {0} %Sshall remain!", who.ColoredName);
|
||||
} else if (netVotesYes > 0) {
|
||||
Player.GlobalMessage("The people have spoken, " + who.ColoredName + " %Sis gone!");
|
||||
Chat.MessageAll("The people have spoken, {0} %Sis gone!", who.ColoredName);
|
||||
who.Kick("Vote-Kick: The people have spoken!");
|
||||
} else {
|
||||
Player.GlobalMessage(who.ColoredName + " %Sshall remain!");
|
||||
Chat.MessageAll("{0} %Sshall remain!", who.ColoredName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace MCGalaxy.Commands {
|
||||
PlayerActions.ChangeMap(pl, xjailMap);
|
||||
pl.BlockUntilLoad(10);
|
||||
jail.Use(p, message);
|
||||
Player.GlobalMessage(pl.ColoredName + " %Swas XJailed!");
|
||||
Chat.MessageAll("{0} %Swas XJailed!", pl.ColoredName);
|
||||
} else {
|
||||
if (pl.muted) mute.Use(p, message);
|
||||
if (pl.frozen) freeze.Use(p, message);
|
||||
@ -67,7 +67,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
jail.Use(p, message);
|
||||
spawn.Use(pl, "");
|
||||
Player.GlobalMessage(pl.ColoredName + " %Swas released from XJail!");
|
||||
Chat.MessageAll("{0} %Swas released from XJail!", pl.ColoredName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "Time must be positive and greater than zero."); return;
|
||||
}
|
||||
|
||||
Player.GlobalMessage(muter.color + muter.DisplayName + " %Shas been muted for " + time + " seconds");
|
||||
Chat.MessageAll("{0} %Shas been muted for {1} seconds", muter.ColoredName, time);
|
||||
Player.Message(muter, "You have been muted for " + time + " seconds");
|
||||
Thread.Sleep(time * 1000);
|
||||
Command.all.Find("mute").Use(p, muter.name);
|
||||
|
@ -62,9 +62,8 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
LevelInfo.Loaded.Add(lvl);
|
||||
if (p == null || !p.hidden) {
|
||||
Player.GlobalMessage("Level \"" + lvl.name + "\" loaded.");
|
||||
}
|
||||
if (p == null || !p.hidden)
|
||||
Player.GlobalMessage("Level \"{0}\" loaded.", lvl.name);
|
||||
/*try {
|
||||
Gui.Window.thisWindow.UpdatePlayerMapCombo();
|
||||
Gui.Window.thisWindow.UnloadedlistUpdate();
|
||||
|
@ -44,11 +44,11 @@ namespace MCGalaxy.Commands {
|
||||
string path = "text/lockdown/map/" + args[1];
|
||||
if (!File.Exists(path)) {
|
||||
File.Create(path).Dispose();
|
||||
Player.GlobalMessage("The map " + args[1] + " has been locked");
|
||||
Chat.MessageAll("The map {0} has been locked", args[1]);
|
||||
Chat.MessageOps("Locked by: " + ((p == null) ? "Console" : p.name));
|
||||
} else {
|
||||
File.Delete(path);
|
||||
Player.GlobalMessage("The map " + args[1] + " has been unlocked");
|
||||
Chat.MessageAll("The map {0} has been unlocked", args[1]);
|
||||
Chat.MessageOps("Unlocked by: " + ((p == null) ? "Console" : p.name));
|
||||
}
|
||||
} else {
|
||||
@ -64,10 +64,10 @@ namespace MCGalaxy.Commands {
|
||||
PlayerActions.ChangeMap(who, p.level.name);
|
||||
who.BlockUntilLoad(500);
|
||||
}
|
||||
Player.GlobalMessage(who.ColoredName + " %Shas been locked down!");
|
||||
Chat.MessageAll("{0} %Shas been locked down!", who.ColoredName);
|
||||
Chat.MessageOps("Locked by: " + ((p == null) ? "Console" : p.name));
|
||||
} else {
|
||||
Player.GlobalMessage(who.ColoredName + " %Shas been unlocked.");
|
||||
Chat.MessageAll("{0} %Shas been unlocked.", who.ColoredName);
|
||||
Chat.MessageOps("Unlocked by: " + ((p == null) ? "Console" : p.name));
|
||||
}
|
||||
who.jailed = !who.jailed;
|
||||
|
@ -69,7 +69,7 @@ namespace MCGalaxy.Commands.World {
|
||||
}
|
||||
|
||||
string format = seed != "" ? "Level \"{0}\" created with seed \"{1}\"" : "Level \"{0}\" created";
|
||||
Player.GlobalMessage(String.Format(format, name, seed));
|
||||
Chat.MessageAll(format, name, seed);
|
||||
}
|
||||
|
||||
internal static bool CheckMapSize(Player p, int x, int y, int z) {
|
||||
|
@ -49,11 +49,11 @@ namespace MCGalaxy.Commands {
|
||||
lvl.PhysicsEnabled = enabled;
|
||||
lvl.physPause = !lvl.physPause;
|
||||
if (enabled) {
|
||||
Player.GlobalMessage("Physics on " + lvl.name + " were re-enabled.");
|
||||
Chat.MessageAll("Physics on {0} were re-enabled.", lvl.name);
|
||||
} else {
|
||||
Server.MainScheduler.QueueOnce(PauseCallback, lvl.name,
|
||||
TimeSpan.FromSeconds(seconds));
|
||||
Player.GlobalMessage("Physics on " + lvl.name + " were temporarily disabled.");
|
||||
Chat.MessageAll("Physics on {0} were temporarily disabled.", lvl.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ namespace MCGalaxy.Commands {
|
||||
if (lvl == null) return;
|
||||
|
||||
lvl.PhysicsEnabled = true;
|
||||
Player.GlobalMessage("Physics on " + lvl.name + " were re-enabled.");
|
||||
Chat.MessageAll("Physics on {0} were re-enabled.", lvl.name);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands.World {
|
||||
LevelActions.Rename(lvl.name.ToLower(), newName.ToLower());
|
||||
try { Command.all.Find("load").Use(p, newName); }
|
||||
catch { }
|
||||
Player.GlobalMessage("Renamed " + lvl.name + " to " + newName);
|
||||
Chat.MessageAll("Renamed {0} to {1}", lvl.name, newName);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands
|
||||
cmd.Use(p, args + " air");
|
||||
|
||||
CmdPhysics.SetPhysics(p.level, phys);
|
||||
Player.GlobalMessage("Unflooded!");
|
||||
Chat.MessageLevel("Unflooded!");
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Games {
|
||||
MainLoopCore();
|
||||
} catch (Exception ex) {
|
||||
Server.ErrorLog(ex);
|
||||
Player.GlobalMessage("&cZombie survival disabled due to an error.");
|
||||
Chat.MessageAll("&cZombie survival disabled due to an error.");
|
||||
try {
|
||||
ResetState();
|
||||
} catch (Exception ex2) {
|
||||
|
@ -59,7 +59,7 @@ namespace MCGalaxy.Games {
|
||||
CurLevel = level;
|
||||
}
|
||||
|
||||
Player.GlobalMessage("A game of zombie survival is starting on: " + CurLevelName);
|
||||
Chat.MessageAll("A game of zombie survival is starting on: {0}", CurLevelName);
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
foreach (Player p in players) {
|
||||
if (p.level != CurLevel) continue;
|
||||
|
@ -649,10 +649,8 @@ return;
|
||||
} else {
|
||||
Chat.GlobalChatLevel(this, text, true);
|
||||
}
|
||||
|
||||
//IRCBot.Say(name + ": " + text);
|
||||
}
|
||||
catch ( Exception e ) { Server.ErrorLog(e); Player.GlobalMessage("An error occurred: " + e.Message); }
|
||||
catch ( Exception e ) { Server.ErrorLog(e); Chat.MessageAll("An error occurred: {0}", e.Message); }
|
||||
}
|
||||
|
||||
string HandleJoker(string text) {
|
||||
@ -757,7 +755,7 @@ return;
|
||||
//DO NOT REMOVE THE TWO COMMANDS BELOW, /PONY AND /RAINBOWDASHLIKESCOOLTHINGS. -EricKilla
|
||||
if (cmd == "pony") {
|
||||
if (ponycount < 2) {
|
||||
GlobalMessage(color + DisplayName + " %Sjust so happens to be a proud brony! Everyone give " + color + DisplayName + " %Sa brohoof!");
|
||||
Chat.MessageAll("{0} %Sjust so happens to be a proud brony! Everyone give {0} %Sa brohoof!", ColoredName);
|
||||
ponycount++;
|
||||
} else {
|
||||
SendMessage("You have used this command 2 times. You cannot use it anymore! Sorry, Brony!");
|
||||
@ -765,7 +763,7 @@ return;
|
||||
return false;
|
||||
} else if (cmd == "rainbowdashlikescoolthings") {
|
||||
if (rdcount < 2) {
|
||||
GlobalMessage("&1T&2H&3I&4S &5S&6E&7R&8V&9E&aR &bJ&cU&dS&eT &fG&0O&1T &22&30 &4P&CE&7R&DC&EE&9N&1T &5C&6O&7O&8L&9E&aR&b!");
|
||||
Chat.MessageAll("&1T&2H&3I&4S &5S&6E&7R&8V&9E&aR &bJ&cU&dS&eT &fG&0O&1T &22&30 &4P&CE&7R&DC&EE&9N&1T &5C&6O&7O&8L&9E&aR&b!");
|
||||
rdcount++;
|
||||
} else {
|
||||
SendMessage("You have used this command 2 times. You cannot use it anymore! Sorry, Brony!");
|
||||
|
@ -133,7 +133,7 @@ namespace MCGalaxy {
|
||||
CompleteLoginProcess();
|
||||
} catch (Exception e) {
|
||||
Server.ErrorLog(e);
|
||||
Player.GlobalMessage("An error occurred: " + e.Message);
|
||||
Chat.MessageAll("An error occurred: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,12 +379,12 @@ namespace MCGalaxy {
|
||||
void CheckState() {
|
||||
if (Server.muted.Contains(name)) {
|
||||
muted = true;
|
||||
GlobalMessage(DisplayName + " is still muted from the last time they went offline.");
|
||||
Chat.MessageAll("{0} is still muted from the last time they went offline.", DisplayName);
|
||||
Player.Message(this, "!%cYou are still %8muted%c since your last login.");
|
||||
}
|
||||
if (Server.frozen.Contains(name)) {
|
||||
frozen = true;
|
||||
GlobalMessage(DisplayName + " is still frozen from the last time they went offline.");
|
||||
Chat.MessageAll("{0} is still frozen from the last time they went offline.", DisplayName);
|
||||
Player.Message(this, "!%cYou are still %8frozen%c since your last login.");
|
||||
}
|
||||
}
|
||||
|
@ -187,17 +187,10 @@ namespace MCGalaxy {
|
||||
}
|
||||
|
||||
public static List<ChatMessage> Last50Chat = new List<ChatMessage>();
|
||||
public static void GlobalMessage(string message) { GlobalMessage(message, false); }
|
||||
public static void GlobalMessage(string message, bool global) {
|
||||
message = Colors.EscapeColors(message);
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
foreach (Player p in players) {
|
||||
if (p.ignoreAll || (global && p.ignoreGlobal)) continue;
|
||||
|
||||
if (p.level.worldChat && p.Chatroom == null)
|
||||
p.SendMessage(message, !global);
|
||||
}
|
||||
}
|
||||
[Obsolete("Use Chat.MessageAll() instead")]
|
||||
public static void GlobalMessage(string message) { Chat.MessageAll(message); }
|
||||
[Obsolete("Use Chat.MessageAll() instead")]
|
||||
public static void GlobalMessage(string message, bool global) { Chat.MessageAll(message); }
|
||||
|
||||
public static void GlobalIRCMessage(string message) {
|
||||
message = Colors.EscapeColors(message);
|
||||
@ -651,7 +644,7 @@ namespace MCGalaxy {
|
||||
|
||||
muteCooldown = Server.mutespamtime;
|
||||
Command.all.Find("mute").Use(null, name);
|
||||
Player.GlobalMessage(color + DisplayName + " %Shas been &0muted &efor spamming!");
|
||||
Chat.MessageAll("{0} %Shas been &0muted %Sfor spamming!", ColoredName);
|
||||
muteTimer.Elapsed += MuteTimerElapsed;
|
||||
muteTimer.Start();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user