mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 12:42:22 -04:00
Now do partial rank name matching in /viewranks
This commit is contained in:
parent
4336855f80
commit
c2a318ea1d
@ -34,8 +34,8 @@ namespace MCGalaxy.Commands {
|
|||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (message == "") { Player.Message(p, "Available ranks: " + Group.concatList()); return; }
|
if (message == "") { Player.Message(p, "Available ranks: " + Group.concatList()); return; }
|
||||||
Group grp = message.CaselessEq("banned") ?
|
Group grp = message.CaselessEq("banned") ?
|
||||||
Group.findPerm(LevelPermission.Banned) : Group.Find(message);
|
Group.findPerm(LevelPermission.Banned) : Group.FindMatches(p, message);
|
||||||
if (grp == null) { Player.Message(p, "Could not find group"); return; }
|
if (grp == null) return;
|
||||||
|
|
||||||
string list = grp.playerList.All().Join(", ");
|
string list = grp.playerList.All().Join(", ");
|
||||||
if (list.Length == 0) {
|
if (list.Length == 0) {
|
||||||
|
@ -161,7 +161,7 @@ namespace MCGalaxy.Eco {
|
|||||||
int lasttrueprice = 0;
|
int lasttrueprice = 0;
|
||||||
foreach (Group group in Group.GroupList) {
|
foreach (Group group in Group.GroupList) {
|
||||||
if (group.Permission > Group.Find(MaxRank).Permission) break;
|
if (group.Permission > Group.Find(MaxRank).Permission) break;
|
||||||
if (group.Permission <= Group.Find(Server.defaultRank).Permission) continue;
|
if (group.Permission <= Group.standard.Permission) continue;
|
||||||
|
|
||||||
Rank rank = FindRank(group.name);
|
Rank rank = FindRank(group.name);
|
||||||
if (rank == null) {
|
if (rank == null) {
|
||||||
|
@ -121,8 +121,8 @@ namespace MCGalaxy.Games
|
|||||||
}
|
}
|
||||||
//Map stuff
|
//Map stuff
|
||||||
lvl.setPhysics(3);
|
lvl.setPhysics(3);
|
||||||
lvl.permissionbuild = Group.Find(Server.defaultRank).Permission;
|
lvl.permissionbuild = Group.standard.Permission;
|
||||||
lvl.permissionvisit = Group.Find(Server.defaultRank).Permission;
|
lvl.permissionvisit = Group.standard.Permission;
|
||||||
lvl.Killer = true;
|
lvl.Killer = true;
|
||||||
//Seting Up Some Player stuff
|
//Seting Up Some Player stuff
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ namespace MCGalaxy {
|
|||||||
public static void MessageBlock(Player p, string action, byte block) {
|
public static void MessageBlock(Player p, string action, byte block) {
|
||||||
StringBuilder builder = new StringBuilder("Only ");
|
StringBuilder builder = new StringBuilder("Only ");
|
||||||
Block.Blocks perms = Block.BlockList[block];
|
Block.Blocks perms = Block.BlockList[block];
|
||||||
Formatter.PrintRanks(perms.lowestRank, perms.allow, perms.disallow, builder);
|
PrintRanks(perms.lowestRank, perms.allow, perms.disallow, builder);
|
||||||
|
|
||||||
builder.Append( " %Scan ").Append(action);
|
builder.Append( " %Scan ").Append(action);
|
||||||
builder.Append(Block.Name(block)).Append(".");
|
builder.Append(Block.Name(block)).Append(".");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user