mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-14 17:55:09 -04:00
Extra permission for seeing state/province in /location
This commit is contained in:
parent
e7140e0408
commit
ca1d16c0fa
@ -26,6 +26,9 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
public override string shortcut { get { return "GeoIP"; } }
|
public override string shortcut { get { return "GeoIP"; } }
|
||||||
public override string type { get { return CommandTypes.Moderation; } }
|
public override string type { get { return CommandTypes.Moderation; } }
|
||||||
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
||||||
|
public override CommandPerm[] ExtraPerms {
|
||||||
|
get { return new[] { new CommandPerm(LevelPermission.Admin, "can see state/province") }; }
|
||||||
|
}
|
||||||
|
|
||||||
class GeoInfo {
|
class GeoInfo {
|
||||||
[ConfigString] public string region;
|
[ConfigString] public string region;
|
||||||
@ -60,9 +63,10 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
if (elems == null) elems = ConfigElement.GetAll(typeof(GeoInfo));
|
if (elems == null) elems = ConfigElement.GetAll(typeof(GeoInfo));
|
||||||
obj.Deserialise(elems, info);
|
obj.Deserialise(elems, info);
|
||||||
|
|
||||||
|
|
||||||
|
string suffix = HasExtraPerm(p, data.Rank, 1) ? "&b{1}%S/&b{2}" : "&b{2}";
|
||||||
string target = name == null ? ip : "of " + PlayerInfo.GetColoredName(p, name);
|
string target = name == null ? ip : "of " + PlayerInfo.GetColoredName(p, name);
|
||||||
p.Message("The IP {0} %Shas been traced to: &b{1}%S/&b{2}",
|
p.Message("The IP {0} %Straces to: " + suffix, target, info.region, info.country);
|
||||||
target, info.region, info.country);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
@ -70,4 +74,4 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
p.Message("%HTracks down location of the given IP, or IP player is on.");
|
p.Message("%HTracks down location of the given IP, or IP player is on.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user