Bots should not rotate on spawn (Thanks goodlyay), j/join should alias to /goto. (Thanks azmi2299), hidden players should not show up in .who (Thanks FabTheZen).

This commit is contained in:
UnknownShadow200 2016-02-11 23:10:12 +11:00
parent 395a59a182
commit e267b31d4f
5 changed files with 12 additions and 7 deletions

View File

@ -64,7 +64,7 @@ namespace MCGalaxy.Commands {
} }
public override void Help(Player p) { public override void Help(Player p) {
Player.SendMessage(p, "/pcount - Lists the clients players are using, and who uses which client."); Player.SendMessage(p, "/pclients - Lists the clients players are using, and who uses which client.");
} }
} }
} }

View File

@ -31,10 +31,10 @@ namespace MCGalaxy.Commands
public CmdPlayers() { } public CmdPlayers() { }
public override void Use(Player p, string message) { public override void Use(Player p, string message) {
DisplayPlayers(p, message, text => Player.SendMessage(p, text)); DisplayPlayers(p, message, text => Player.SendMessage(p, text), true);
} }
public static void DisplayPlayers(Player p, string message, Action<string> output) { public static void DisplayPlayers(Player p, string message, Action<string> output, bool showHidden) {
if (message != "") { if (message != "") {
Group grp = Group.Find(message); Group grp = Group.Find(message);
if( grp == null ) { if( grp == null ) {
@ -45,6 +45,7 @@ namespace MCGalaxy.Commands
foreach (Player pl in PlayerInfo.players) { foreach (Player pl in PlayerInfo.players) {
if (pl.group != grp) continue; if (pl.group != grp) continue;
if (pl.hidden && !showHidden) continue;
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) { if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) {
string name = Colors.StripColours(pl.DisplayName); string name = Colors.StripColours(pl.DisplayName);
if (Server.afkset.Contains(pl.name)) name += "-afk"; if (Server.afkset.Contains(pl.name)) name += "-afk";
@ -75,6 +76,7 @@ namespace MCGalaxy.Commands
int totalPlayers = 0; int totalPlayers = 0;
foreach (Player pl in PlayerInfo.players) { foreach (Player pl in PlayerInfo.players) {
if (pl.hidden && !showHidden) continue;
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) { if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) {
totalPlayers++; totalPlayers++;
string name = Colors.StripColours(pl.DisplayName); string name = Colors.StripColours(pl.DisplayName);

View File

@ -171,7 +171,7 @@ namespace MCGalaxy {
string ircCmd = parts[0].ToLower(); string ircCmd = parts[0].ToLower();
if (ircCmd == ".who" || ircCmd == ".players") { if (ircCmd == ".who" || ircCmd == ".players") {
try { try {
CmdPlayers.DisplayPlayers(null, "", text => Pm(user.Nick, text)); CmdPlayers.DisplayPlayers(null, "", text => Pm(user.Nick, text), false);
} catch (Exception e) { } catch (Exception e) {
Server.ErrorLog(e); Server.ErrorLog(e);
} }
@ -207,7 +207,7 @@ namespace MCGalaxy {
string ircCmd = parts[0].ToLower(); string ircCmd = parts[0].ToLower();
if (ircCmd == ".who" || ircCmd == ".players") { if (ircCmd == ".who" || ircCmd == ".players") {
try { try {
CmdPlayers.DisplayPlayers(null, "", text => Say(text, false, true)); CmdPlayers.DisplayPlayers(null, "", text => Say(text, false, true), false);
} catch (Exception e) { } catch (Exception e) {
Server.ErrorLog(e); Server.ErrorLog(e);
} }

View File

@ -2035,6 +2035,8 @@ return;
case "zz": cmd = "static"; message = "cuboid " + message; break; case "zz": cmd = "static"; message = "cuboid " + message; break;
case "fetch": cmd = "summon"; break; case "fetch": cmd = "summon"; break;
case "ranks": cmd = "help"; message = "ranks"; break; case "ranks": cmd = "help"; message = "ranks"; break;
case "j":
case "join": cmd = "goto"; break;
default: retry = false; break; //Unknown command, then default: retry = false; break; //Unknown command, then
} }

View File

@ -90,6 +90,7 @@ namespace MCGalaxy {
} }
} }
} }
movement = false;
if (Waypoints.Count == 0) if (Waypoints.Count == 0)
{ {
@ -115,7 +116,7 @@ namespace MCGalaxy {
else else
{ {
bool skip = false; bool skip = false;
movement = false;
retry: switch (Waypoints[currentPoint].type) retry: switch (Waypoints[currentPoint].type)
{ {
@ -270,7 +271,7 @@ namespace MCGalaxy {
if (currentPoint == Waypoints.Count) currentPoint = 0; if (currentPoint == Waypoints.Count) currentPoint = 0;
} }
if (!movement) if (!movement && Waypoints.Count > 0)
{ {
if (rot[0] < 245) rot[0] += 8; if (rot[0] < 245) rot[0] += 8;
else rot[0] = 0; else rot[0] = 0;