mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Remove xnick/xtitle/xcolor/xmodel/xtcolor and integrate them into part of their respective commands.
This commit is contained in:
parent
c03effc8c2
commit
c87c60fa35
@ -27,17 +27,29 @@ namespace MCGalaxy.Commands.CPE {
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "+ can change the model of other players") }; }
|
||||
}
|
||||
public override CommandAlias[] Aliases {
|
||||
get { return new[] { new CommandAlias("xmodel", "-own") }; }
|
||||
}
|
||||
static char[] trimChars = { ' ' };
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (CheckSuper(p, message, "player or bot name")) return;
|
||||
message = p.name;
|
||||
if (message == "") message = p.name;
|
||||
|
||||
Player who = p;
|
||||
PlayerBot pBot = null;
|
||||
bool isBot = message.CaselessStarts("bot ");
|
||||
string[] args = message.Split(trimChars, isBot ? 3 : 2);
|
||||
string model = null;
|
||||
|
||||
if (args[0].CaselessEq("-own")) {
|
||||
if (Player.IsSuper(p)) { SuperRequiresArgs(p, "player name"); return; }
|
||||
args[0] = p.name;
|
||||
if (args.Length == 1) message = "humanoid";
|
||||
}
|
||||
|
||||
if (isBot && args.Length > 2) {
|
||||
pBot = PlayerBot.FindOrShowMatches(p, args[1]);
|
||||
@ -78,33 +90,9 @@ namespace MCGalaxy.Commands.CPE {
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/model [name] [model] - Sets the model of that player.");
|
||||
Player.Message(p, "/model bot [name] [model] - Sets the model of that bot.");
|
||||
HelpModels(p);
|
||||
}
|
||||
|
||||
protected void HelpModels(Player p) {
|
||||
Player.Message(p, "Available models: Chibi, Chicken, Creeper, Giant, Humanoid, Pig, Sheep, Spider, Skeleton, Zombie.");
|
||||
Player.Message(p, "To set a block model, use a block ID for the model name.");
|
||||
Player.Message(p, "For setting scaling models, put \"|[scale]\" after the model name (not supported by all clients).");
|
||||
}
|
||||
}
|
||||
|
||||
public class CmdXModel : CmdModel {
|
||||
|
||||
public override string name { get { return "xmodel"; } }
|
||||
public override string shortcut { get { return "xm"; } }
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); }
|
||||
string model = message == "" ? "humanoid" : message;
|
||||
base.Use(p, p.name + " " + model);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/xm [model] - Sets your own model.");
|
||||
HelpModels(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy)
|
||||
|
||||
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||
the GNU General Public License, Version 3 (the "Licenses"); you may
|
||||
not use this file except in compliance with the Licenses. You may
|
||||
obtain a copy of the Licenses at
|
||||
@ -21,7 +21,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
public override string name { get { return "color"; } }
|
||||
public override string shortcut { get { return ""; } }
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override string type { get { return CommandTypes.Chat; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
@ -32,6 +32,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] args = message.Split(' ');
|
||||
if (args[0].CaselessEq("-own")) {
|
||||
if (Player.IsSuper(p)) { SuperRequiresArgs(p, "player name"); return; }
|
@ -18,8 +18,7 @@
|
||||
using System;
|
||||
using MCGalaxy;
|
||||
|
||||
namespace MCGalaxy.Commands {
|
||||
|
||||
namespace MCGalaxy.Commands {
|
||||
public class CmdNick : Command {
|
||||
|
||||
public override string name { get { return "nick"; } }
|
||||
@ -27,26 +26,36 @@ namespace MCGalaxy.Commands {
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||
public CmdNick() { }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "+ can change the nick of other players") }; }
|
||||
}
|
||||
public override CommandAlias[] Aliases {
|
||||
get { return new[] { new CommandAlias("xnick", "-own") }; }
|
||||
}
|
||||
static char[] trimChars = { ' ' };
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] parts = message.Split(trimChars, 2);
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
if (args[0].CaselessEq("-own")) {
|
||||
if (Player.IsSuper(p)) { SuperRequiresArgs(p, "player name"); return; }
|
||||
args[0] = p.name;
|
||||
}
|
||||
|
||||
Player who = PlayerInfo.FindOrShowMatches(p, parts[0]);
|
||||
Player who = PlayerInfo.FindOrShowMatches(p, args[0]);
|
||||
if (who == null) return;
|
||||
if (p != null && who.group.Permission > p.group.Permission) {
|
||||
MessageTooHighRank(p, "change the nick of", true); return;
|
||||
}
|
||||
if (who != p && !CheckExtraPerm(p)) { MessageNeedPerms(p, "can change the nick of other players."); return; }
|
||||
|
||||
string newName = parts.Length > 1 ? parts[1] : "";
|
||||
string newName = args.Length > 1 ? args[1] : "";
|
||||
if (newName == "") {
|
||||
who.DisplayName = who.truename;
|
||||
Player.SendChatFrom(who, who.FullName + "%S has reverted their nick to their original name.", false);
|
||||
Player.SendChatFrom(who, who.FullName + "%S reverted their nick to their original name.", false);
|
||||
} else {
|
||||
if (newName.Length >= 30) { Player.Message(p, "Nick must be under 30 letters."); return; }
|
||||
Player.SendChatFrom(who, who.FullName + "%S has changed their nick to " + who.color + newName + "%S.", false);
|
||||
Player.SendChatFrom(who, who.FullName + "%S changed their nick to " + who.color + newName + "%S.", false);
|
||||
who.DisplayName = newName;
|
||||
}
|
||||
|
||||
@ -56,26 +65,9 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/nick <player> [newName] - Gives <player> the nick of [newName].");
|
||||
Player.Message(p, "If no [newName] is given, the player's nick is reverted to their original name.");
|
||||
Player.Message(p, "/nick <player> [nick] - Sets the nick of <player>");
|
||||
Player.Message(p, "If no [nick] is given, reverts player's nick to their original name.");
|
||||
}
|
||||
}
|
||||
|
||||
public class CmdXNick : CmdNick {
|
||||
|
||||
public override string name { get { return "xnick"; } }
|
||||
public override string shortcut { get { return "xnickname"; } }
|
||||
public CmdXNick() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message != "") message = " " + message;
|
||||
base.Use(p, p.name + message);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/xnick [newName] - Gives you the nick of [newName].");
|
||||
Player.Message(p, "If no [newName] is given, your nick is reverted to your original name.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Copyright 2010 MCLawl Team - Written by Valek (Modified for use with MCGalaxy)
|
||||
|
||||
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||
the GNU General Public License, Version 3 (the "Licenses"); you may
|
||||
not use this file except in compliance with the Licenses. You may
|
||||
obtain a copy of the Licenses at
|
||||
@ -16,26 +16,35 @@
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using MCGalaxy.SQL;
|
||||
namespace MCGalaxy.Commands {
|
||||
|
||||
namespace MCGalaxy.Commands {
|
||||
public class CmdTColor : Command {
|
||||
|
||||
public override string name { get { return "tcolor"; } }
|
||||
public override string shortcut { get { return ""; } }
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override string type { get { return CommandTypes.Chat; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
||||
public CmdTColor() { }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "+ can change the title color of other players") }; }
|
||||
}
|
||||
public override CommandAlias[] Aliases {
|
||||
get { return new[] { new CommandAlias("tcolour"), new CommandAlias("xtcolor", "-own") }; }
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] args = message.Split(' ');
|
||||
if (args[0].CaselessEq("-own")) {
|
||||
if (Player.IsSuper(p)) { SuperRequiresArgs(p, "player name"); return; }
|
||||
args[0] = p.name;
|
||||
}
|
||||
|
||||
Player who = PlayerInfo.FindOrShowMatches(p, args[0]);
|
||||
if (who == null) return;
|
||||
if (p != null && who.group.Permission > p.group.Permission) {
|
||||
Player.Message(p, "Cannot change the title color of someone of greater rank"); return;
|
||||
MessageTooHighRank(p, "change the title color of", true); return;
|
||||
}
|
||||
if (who != p && !CheckExtraPerm(p)) { MessageNeedPerms(p, "can change the title color of other players."); return; }
|
||||
|
||||
ParameterisedQuery query = ParameterisedQuery.Create();
|
||||
if (args.Length == 1) {
|
||||
@ -59,33 +68,9 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/tcolor <player> [color] - Gives <player> the title color of [color].");
|
||||
Player.Message(p, "/tcolor <player> [color] - Sets the title color of [player]");
|
||||
Player.Message(p, "If no [color] is specified, title color is removed.");
|
||||
HelpColors(p);
|
||||
}
|
||||
|
||||
protected void HelpColors(Player p) {
|
||||
Player.Message(p, "&0black &1navy &2green &3teal &4maroon &5purple &6gold &7silver");
|
||||
Player.Message(p, "&8gray &9blue &alime &baqua &cred &dpink &eyellow &fwhite");
|
||||
Player.Message(p, "To see a list of all colors, use /help colors.");
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CmdXTColor : CmdTColor {
|
||||
|
||||
public override string name { get { return "xtcolor"; } }
|
||||
public override string shortcut { get { return ""; } }
|
||||
public CmdXTColor() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message != "") message = " " + message;
|
||||
base.Use(p, p.name + message);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/xtcolor [color] - Gives you the title color of [color].");
|
||||
Player.Message(p, "If no [color] is specified, title color is removed.");
|
||||
HelpColors(p);
|
||||
}
|
||||
}
|
||||
}
|
@ -25,20 +25,30 @@ namespace MCGalaxy.Commands {
|
||||
public override string type { get { return CommandTypes.Other; } }
|
||||
public override bool museumUsable { get { return true; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
||||
public CmdTitle() { }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Admin, "+ can change the title of other players") }; }
|
||||
}
|
||||
public override CommandAlias[] Aliases {
|
||||
get { return new[] { new CommandAlias("xtitle", "-own") }; }
|
||||
}
|
||||
static char[] trimChars = { ' ' };
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] parts = message.Split(trimChars, 2);
|
||||
|
||||
Player who = PlayerInfo.FindOrShowMatches(p, parts[0]);
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
if (args[0].CaselessEq("-own")) {
|
||||
if (Player.IsSuper(p)) { SuperRequiresArgs(p, "player name"); return; }
|
||||
args[0] = p.name;
|
||||
}
|
||||
|
||||
Player who = PlayerInfo.FindOrShowMatches(p, args[0]);
|
||||
if (who == null) return;
|
||||
if (p != null && who.group.Permission > p.group.Permission) {
|
||||
MessageTooHighRank(p, "change the title of", true); return;
|
||||
}
|
||||
if (who != p && !CheckExtraPerm(p)) { MessageNeedPerms(p, "can change the title of other players."); return; }
|
||||
|
||||
string newTitle = parts.Length > 1 ? parts[1] : "";
|
||||
string newTitle = args.Length > 1 ? args[1] : "";
|
||||
ParameterisedQuery query = ParameterisedQuery.Create();
|
||||
if (newTitle != "")
|
||||
newTitle = newTitle.Replace("[", "").Replace("]", "");
|
||||
@ -59,25 +69,8 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/title <player> [title] - Gives <player> the [title].");
|
||||
Player.Message(p, "If no [title] is given, the player's title is removed.");
|
||||
}
|
||||
}
|
||||
|
||||
public class CmdXTitle : CmdTitle {
|
||||
|
||||
public override string name { get { return "xtitle"; } }
|
||||
public override string shortcut { get { return ""; } }
|
||||
public CmdXTitle() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message != "") message = " " + message;
|
||||
base.Use(p, p.name + message);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "/xtitle [title] - Gives you the [title].");
|
||||
Player.Message(p, "If no [title] is given, your title is removed.");
|
||||
Player.Message(p, "/title <player> [title] - Sets the title of <player>");
|
||||
Player.Message(p, "If no [title] is given, removes player's title.");
|
||||
}
|
||||
}
|
||||
}
|
@ -164,6 +164,7 @@
|
||||
<Compile Include="Commands\building\DrawCmd.cs" />
|
||||
<Compile Include="Commands\Chat\CmdAdminChat.cs" />
|
||||
<Compile Include="Commands\Chat\CmdChatRoom.cs" />
|
||||
<Compile Include="Commands\Chat\CmdColor.cs" />
|
||||
<Compile Include="Commands\Chat\CmdEat.cs" />
|
||||
<Compile Include="Commands\Chat\CmdEmote.cs" />
|
||||
<Compile Include="Commands\Chat\CmdGlobalCLS.cs" />
|
||||
@ -171,11 +172,14 @@
|
||||
<Compile Include="Commands\Chat\CmdHug.cs" />
|
||||
<Compile Include="Commands\Chat\CmdIgnore.cs" />
|
||||
<Compile Include="Commands\Chat\CmdMe.cs" />
|
||||
<Compile Include="Commands\Chat\CmdNick.cs" />
|
||||
<Compile Include="Commands\Chat\CmdOpChat.cs" />
|
||||
<Compile Include="Commands\Chat\CmdPlayerCLS.cs" />
|
||||
<Compile Include="Commands\Chat\CmdRankMsg.cs" />
|
||||
<Compile Include="Commands\Chat\CmdRoll.cs" />
|
||||
<Compile Include="Commands\Chat\CmdSay.cs" />
|
||||
<Compile Include="Commands\Chat\CmdTColor.cs" />
|
||||
<Compile Include="Commands\Chat\CmdTitle.cs" />
|
||||
<Compile Include="Commands\Chat\CmdWhisper.cs" />
|
||||
<Compile Include="Commands\CmdOverseer.cs" />
|
||||
<Compile Include="Commands\Command.cs" />
|
||||
@ -320,7 +324,6 @@
|
||||
<Compile Include="Commands\other\CmdBack.cs" />
|
||||
<Compile Include="Commands\other\CmdC4.cs" />
|
||||
<Compile Include="Commands\other\CmdChain.cs" />
|
||||
<Compile Include="Commands\other\CmdColor.cs" />
|
||||
<Compile Include="Commands\other\cmdCTFADSFD.cs" />
|
||||
<Compile Include="Commands\other\CmdDescend.cs" />
|
||||
<Compile Include="Commands\other\CmdDisagree.cs" />
|
||||
@ -335,7 +338,6 @@
|
||||
<Compile Include="Commands\other\CmdLogoutMessage.cs" />
|
||||
<Compile Include="Commands\other\CmdMain.cs" />
|
||||
<Compile Include="Commands\other\CmdMove.cs" />
|
||||
<Compile Include="Commands\other\CmdNick.cs" />
|
||||
<Compile Include="Commands\other\CmdPass.cs" />
|
||||
<Compile Include="Commands\other\CmdRepeat.cs" />
|
||||
<Compile Include="Commands\other\CmdReport.cs" />
|
||||
@ -348,9 +350,7 @@
|
||||
<Compile Include="Commands\other\CmdSetPass.cs" />
|
||||
<Compile Include="Commands\other\CmdSpawn.cs" />
|
||||
<Compile Include="Commands\other\CmdSummon.cs" />
|
||||
<Compile Include="Commands\other\CmdTColor.cs" />
|
||||
<Compile Include="Commands\other\CmdTimer.cs" />
|
||||
<Compile Include="Commands\other\CmdTitle.cs" />
|
||||
<Compile Include="Commands\other\CmdTnt.cs" />
|
||||
<Compile Include="Commands\other\CmdTp.cs" />
|
||||
<Compile Include="Commands\other\CmdTpA.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user