Make /banx IP ban again.

This commit is contained in:
UnknownShadow200 2016-05-23 16:11:37 +10:00
parent 87d8b9f6a1
commit df4a1847a5
17 changed files with 33 additions and 61 deletions

View File

@ -17,10 +17,8 @@
*/
using System;
namespace MCGalaxy.Commands {
public sealed class CmdBan : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdBan : Command {
public override string name { get { return "ban"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -15,10 +15,8 @@
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
namespace MCGalaxy.Commands {
public sealed class CmdBanEdit : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdBanEdit : Command {
public override string name { get { return "banedit"; } }
public override string shortcut { get { return "be"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -15,10 +15,8 @@
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
namespace MCGalaxy.Commands
{
public sealed class CmdBaninfo : Command
{
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdBaninfo : Command {
public override string name { get { return "baninfo"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -21,7 +21,7 @@ using System.Data;
using System.Linq;
using MCGalaxy.SQL;
namespace MCGalaxy.Commands {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdBanip : Command {
public override string name { get { return "banip"; } }
public override string shortcut { get { return "bi"; } }

View File

@ -18,10 +18,8 @@
using System.IO;
using System.Text;
namespace MCGalaxy.Commands
{
public sealed class CmdBanlist : Command
{
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdBanlist : Command {
public override string name { get { return "banlist"; } }
public override string shortcut { get { return "bl"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -16,8 +16,7 @@ using System;
using System.IO;
using System.Text;
namespace MCGalaxy.Commands {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdDelTempRank : Command {
public override string name { get { return "deltemprank"; } }
public override string shortcut { get { return "dtr"; } }

View File

@ -1,9 +1,7 @@
using System;
namespace MCGalaxy.Commands {
namespace MCGalaxy.Commands.Moderation {
public class CmdDemote : Command {
public override string name { get { return "demote"; } }
public override string shortcut { get { return "de"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -18,13 +18,11 @@
using System;
using System.IO;
namespace MCGalaxy.Commands
{
public sealed class CmdMute : Command
{
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdMute : Command {
public override string name { get { return "mute"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return CommandTypes.Moderation; } }
public override string type { get { return CommandTypes.Moderation; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public CmdMute() { }

View File

@ -1,9 +1,7 @@
using System;
namespace MCGalaxy.Commands {
namespace MCGalaxy.Commands.Moderation {
public class CmdPromote : Command {
public override string name { get { return "promote"; } }
public override string shortcut { get { return "pr"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -17,10 +17,8 @@
*/
using System;
using System.IO;
namespace MCGalaxy.Commands
{
public sealed class CmdSetRank : Command
{
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdSetRank : Command {
public override string name { get { return "setrank"; } }
public override string shortcut { get { return "rank"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -17,10 +17,8 @@
*/
using System;
namespace MCGalaxy.Commands {
public sealed class CmdTempBan : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdTempBan : Command {
public override string name { get { return "tempban"; } }
public override string shortcut { get { return "tb"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -15,10 +15,8 @@ permissions and limitations under the Licenses.
using System;
using System.IO;
namespace MCGalaxy.Commands {
public sealed class CmdTempRank : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdTempRank : Command {
public override string name { get { return "temprank"; } }
public override string shortcut { get { return "tr"; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -15,9 +15,8 @@ permissions and limitations under the Licenses.
using System;
using System.IO;
namespace MCGalaxy.Commands {
public sealed class CmdTempRankInfo : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdTempRankInfo : Command {
public override string name { get { return "temprankinfo"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -13,8 +13,8 @@ or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using System.IO;
namespace MCGalaxy.Commands {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdTempRankList : Command {
public override string name { get { return "tempranklist"; } }
public override string shortcut { get { return "trl"; } }

View File

@ -56,14 +56,11 @@ namespace MCGalaxy.Commands
if (!Server.bannedIP.Contains(message)) { Player.Message(p, message + " doesn't seem to be banned..."); return; }
Server.bannedIP.Remove(message); Server.bannedIP.Save("banned-ip.txt", false);
if (p != null)
{
if (p != null) {
Server.IRC.Say(message.ToLower() + " was un-ip-banned by " + p.name + ".");
Server.s.Log("IP-UNBANNED: " + message.ToLower() + " by " + p.name + ".");
Player.GlobalMessage(message + " was &8un-ip-banned %Sby " + p.ColoredName + "%S.");
}
else
{
} else {
Server.IRC.Say(message.ToLower() + " was un-ip-banned by (console).");
Server.s.Log("IP-UNBANNED: " + message.ToLower() + " by (console).");
Player.GlobalMessage(message + " was &8un-ip-banned %Sby (console).");

View File

@ -15,10 +15,8 @@
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
namespace MCGalaxy.Commands {
public sealed class CmdWarn : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdWarn : Command {
public override string name { get { return "warn"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return CommandTypes.Moderation; } }

View File

@ -15,10 +15,8 @@
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
namespace MCGalaxy.Commands {
public sealed class CmdXban : Command {
namespace MCGalaxy.Commands.Moderation {
public sealed class CmdXban : Command {
public override string name { get { return "xban"; } }
public override string shortcut { get { return "banx"; } }
public override string type { get { return CommandTypes.Moderation; } }
@ -32,13 +30,14 @@ namespace MCGalaxy.Commands {
string name = message.Split(' ')[0];
Player who = PlayerInfo.Find(name);
Command.all.Find("ban").Use(p, message);
Command.all.Find("banip").Use(p, "@" + name);
if (who != null)
Command.all.Find("kick").Use(p, message);
Command.all.Find("undo").Use(p, name + " all");
}
public override void Help(Player p) {
Player.Message(p, "/xban [name] [message]- Bans, undoes, and kicks [name] with [message], if specified.");
Player.Message(p, "/xban [name] [message]- Bans, IP bans, undoes, and kicks [name] with [message], if specified.");
}
}
}