mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-30 00:55:18 -04:00
Core: Fix /lockdown showing map name twice and tidy up /team.
This commit is contained in:
parent
9eb1491d15
commit
ed0767b1a7
@ -36,29 +36,21 @@ namespace MCGalaxy.Commands {
|
|||||||
string[] args = message.SplitSpaces(2);
|
string[] args = message.SplitSpaces(2);
|
||||||
|
|
||||||
switch (args[0].ToLower()) {
|
switch (args[0].ToLower()) {
|
||||||
case "owner":
|
case "owner": HandleOwner(p, args); return;
|
||||||
HandleOwner(p, args); break;
|
case "kick": HandleKick(p, args); return;
|
||||||
case "kick":
|
case "color": HandleColor(p, args); return;
|
||||||
HandleKick(p, args); break;
|
case "create": HandleCreate(p, args); return;
|
||||||
case "color":
|
case "join": HandleJoin(p, args); return;
|
||||||
HandleColor(p, args); break;
|
case "invite": HandleInvite(p, args); return;
|
||||||
case "create":
|
case "leave": HandleLeave(p, args); return;
|
||||||
HandleCreate(p, args); break;
|
case "members": HandleMembers(p, args); return;
|
||||||
case "join":
|
}
|
||||||
HandleJoin(p, args); break;
|
|
||||||
case "invite":
|
|
||||||
HandleInvite(p, args); break;
|
|
||||||
case "leave":
|
|
||||||
HandleLeave(p, args); break;
|
|
||||||
case "members":
|
|
||||||
HandleMembers(p, args); break;
|
|
||||||
default:
|
|
||||||
Team team = p.Game.Team;
|
Team team = p.Game.Team;
|
||||||
if (team == null) {
|
if (team == null) {
|
||||||
Player.Message(p, "You need to be in a team first to send a team message."); return;
|
Player.Message(p, "You need to be in a team first to send a team message."); return;
|
||||||
}
|
}
|
||||||
team.Chat(p, message); break;
|
team.Chat(p, message);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleOwner(Player p, string[] args) {
|
void HandleOwner(Player p, string[] args) {
|
||||||
@ -71,6 +63,10 @@ namespace MCGalaxy.Commands {
|
|||||||
|
|
||||||
Player who = PlayerInfo.FindMatches(p, args[1]);
|
Player who = PlayerInfo.FindMatches(p, args[1]);
|
||||||
if (who == null) return;
|
if (who == null) return;
|
||||||
|
|
||||||
|
if (p.name != team.Owner) {
|
||||||
|
Player.Message(p, "Only the team owner can set a new team owner."); return;
|
||||||
|
}
|
||||||
team.Owner = who.name;
|
team.Owner = who.name;
|
||||||
team.Action(who, "set the team owner to " + who.ColoredName);
|
team.Action(who, "set the team owner to " + who.ColoredName);
|
||||||
Team.SaveList();
|
Team.SaveList();
|
||||||
|
@ -41,7 +41,7 @@ namespace MCGalaxy.Commands {
|
|||||||
if (!Formatter.ValidName(p, args[1], "level")) return;
|
if (!Formatter.ValidName(p, args[1], "level")) return;
|
||||||
|
|
||||||
bool unlocking = Server.lockdown.Contains(args[1]);
|
bool unlocking = Server.lockdown.Contains(args[1]);
|
||||||
Chat.MessageAll("The map {0} has been {0}locked", args[1], unlocking ? "un" : "");
|
Chat.MessageAll("The map {0} has been {1}locked", args[1], unlocking ? "un" : "");
|
||||||
string srcName = (p == null) ? "(console)" : p.ColoredName;
|
string srcName = (p == null) ? "(console)" : p.ColoredName;
|
||||||
|
|
||||||
if (unlocking) {
|
if (unlocking) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user