whois should show if a player is afk, closes #154.

This commit is contained in:
UnknownShadow200 2016-05-04 17:08:34 +10:00
parent ac852e5897
commit f0f3b38bc0
4 changed files with 10 additions and 9 deletions

View File

@ -38,27 +38,24 @@ namespace MCGalaxy.Commands
if (message == "list") {
foreach (string s in Server.afkset) {
Player pl = PlayerInfo.FindExact(s);
if (pl == null || !Entities.CanSee(p, pl)) continue;
Player pl = PlayerInfo.FindExact(s);
if (pl == null || !Entities.CanSee(p, pl)) continue;
Player.SendMessage(p, s);
}
return;
}
if (p.joker)
message = "";
if (p.joker) message = "";
if (!Server.afkset.Contains(p.name)) {
p.afkStart = DateTime.Now;
p.afkMessage = message;
Server.afkset.Add(p.name);
if (p.muted)
message = "";
Player.GlobalMessage("-" + p.ColoredName + "%S- is AFK " + message);
//IRCBot.Say(p.name + " is AFK " + message);
Server.IRC.Say(p.DisplayName + " is AFK " + message);
} else {
Server.afkset.Remove(p.name);
p.afkMessage = null;
Player.GlobalMessage("-" + p.ColoredName + "%S- is no longer AFK");
//IRCBot.Say(p.name + " is no longer AFK");
Server.IRC.Say(p.DisplayName + " is no longer AFK");
}
}

View File

@ -47,7 +47,7 @@ namespace MCGalaxy.Commands {
info.TimeSpent = who.time; info.TimeOnline = DateTime.Now - who.timeLogged;
info.First = who.firstLogin;
info.Logins = who.totalLogins; info.Kicks = who.totalKicked;
info.IP = who.ip;
info.IP = who.ip; info.AfkMessage = who.afkMessage;
info.RoundsTotal = who.Game.TotalRoundsSurvived;
info.RoundsMax = who.Game.MaxRoundsSurvived;

View File

@ -30,6 +30,7 @@ namespace MCGalaxy.Commands {
public string IP;
public int RoundsTotal, RoundsMax;
public int InfectedTotal, InfectedMax;
public string AfkMessage;
public static void Output(Player p, WhoInfo who, bool canSeeIP) {
Player.SendMessage(p, who.FullName + " %S(" + who.Name + ") has:");
@ -79,6 +80,8 @@ namespace MCGalaxy.Commands {
if (Server.useWhitelist&& Server.whiteList.Contains(who.Name))
Player.SendMessage(p, ">> Player is &fWhitelisted");
}
if (who.AfkMessage != null)
Player.SendMessage(p, ">> Is &aAFK %S(" + who.AfkMessage + "%S)");
if (!Server.zombie.Running) return;
Player.SendMessage(p, ">> Survived &a" + who.RoundsTotal +

View File

@ -72,6 +72,7 @@ namespace MCGalaxy {
public bool cmdTimer = false;
public bool UsingWom = false;
public string BrushName = "normal", DefaultBrushArgs = "";
public string afkMessage;
byte[] buffer = new byte[0];
byte[] tempbuffer = new byte[0xFF];