mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-25 14:17:29 -04:00
Remove /reload <map>, as it's obsolete by /reveal all <map> anyways.
This commit is contained in:
parent
c9722526a4
commit
3c17f70f70
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Copyright 2011 MCForge
|
||||
|
||||
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
|
||||
@ -87,10 +87,29 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.SendMessage(p, "/reveal <name> - Reveals the map for <name>.");
|
||||
Player.SendMessage(p, "/reveal all - Reveals for all in the map");
|
||||
Player.SendMessage(p, "/reveal all <map> - Reveals for all in <map>");
|
||||
Player.SendMessage(p, "Will reload the map for anyone. (incl. banned)");
|
||||
Player.SendMessage(p, "/reveal <name> - Reloads the map for <name>.");
|
||||
Player.SendMessage(p, "/reveal all - Reloads for all players in your map");
|
||||
Player.SendMessage(p, "/reveal all <map> - Reloads for all players in <map>");
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CmdReload : Command {
|
||||
|
||||
public override string name { get { return "reload"; } }
|
||||
public override string shortcut { get { return "rd"; } }
|
||||
public override string type { get { return CommandTypes.World; } }
|
||||
public override bool museumUsable { get { return false; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
CmdReveal.ReloadMap(p, p, false);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.SendMessage(p, "%T/reload");
|
||||
Player.SendMessage(p, "%HReloads the map you in, just for you.");
|
||||
Player.SendMessage(p, "%HUse %T/reveal %Hto reload maps for other players.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
Copyright 2011 MCForge
|
||||
|
||||
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
|
||||
|
||||
http://www.osedu.org/licenses/ECL-2.0
|
||||
http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the Licenses are distributed on an "AS IS"
|
||||
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
or implied. See the Licenses for the specific language governing
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace MCGalaxy.Commands {
|
||||
|
||||
public sealed class CmdReload : Command {
|
||||
|
||||
public override string name { get { return "reload"; } }
|
||||
public override string shortcut { get { return "rd"; } }
|
||||
public override string type { get { return CommandTypes.World; } }
|
||||
public override bool museumUsable { get { return false; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
|
||||
public override CommandPerm[] AdditionalPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "The lowest rank that can reload the maps for others", 1) }; }
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null && message == "") {
|
||||
Player.SendMessage(p, "You must give a level name when using the command from console."); return;
|
||||
}
|
||||
if (message == "") { CmdReveal.ReloadMap(p, p, false); return; }
|
||||
|
||||
int minPerm = CommandOtherPerms.GetPerm(this, 1);
|
||||
if (p != null && (int)p.group.Permission < minPerm) {
|
||||
Player.SendMessage(p, "%HYou need to be at least %T" + Group.findPermInt(minPerm).name + " %Hto reload maps."); return;
|
||||
}
|
||||
if (!LevelInfo.ExistsOffline(message)) {
|
||||
Player.SendMessage(p, "The given level \"" + message + "\" does not exist."); return;
|
||||
}
|
||||
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
foreach (Player pl in players) {
|
||||
if (pl.level.name.ToLower() != message.ToLower()) continue;
|
||||
CmdReveal.ReloadMap(p, pl, false);
|
||||
}
|
||||
Player.GlobalMessage("&cThe map, " + message + " has been reloaded!");
|
||||
Server.IRC.Say("The map, " + message + " has been reloaded.");
|
||||
string src = p == null ? "the console" : p.name;
|
||||
Server.s.Log("The map " + message + " was reloaded by " + src);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.SendMessage(p, "%T/reload [map]");
|
||||
Player.SendMessage(p, "%HReloads the given map for all players in that map.");
|
||||
Player.SendMessage(p, "%HIf no map is specified, reloads the map you are in just for you.");
|
||||
int minPerm = CommandOtherPerms.GetPerm(this, 1);
|
||||
Player.SendMessage(p, "%T" + Group.findPermInt(minPerm).name + " %H or above can reload maps for all players.");
|
||||
}
|
||||
}
|
||||
}
|
@ -381,7 +381,6 @@
|
||||
<Compile Include="Commands\World\CmdPause.cs" />
|
||||
<Compile Include="Commands\World\CmdPermissions.cs" />
|
||||
<Compile Include="Commands\World\CmdPhysics.cs" />
|
||||
<Compile Include="Commands\World\CmdReload.cs" />
|
||||
<Compile Include="Commands\World\CmdRestore.cs" />
|
||||
<Compile Include="Commands\World\CmdSave.cs" />
|
||||
<Compile Include="Commands\World\CmdSetspawn.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user