diff --git a/Commands/Information/CmdAfk.cs b/Commands/Information/CmdAfk.cs index ba75c8eef..94da20b4d 100644 --- a/Commands/Information/CmdAfk.cs +++ b/Commands/Information/CmdAfk.cs @@ -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"); } } diff --git a/Commands/Information/CmdWhois.cs b/Commands/Information/CmdWhois.cs index 6d6e6d213..7735f0592 100644 --- a/Commands/Information/CmdWhois.cs +++ b/Commands/Information/CmdWhois.cs @@ -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; diff --git a/Commands/Information/WhoInfo.cs b/Commands/Information/WhoInfo.cs index 46ba25e47..03ff4f7b8 100644 --- a/Commands/Information/WhoInfo.cs +++ b/Commands/Information/WhoInfo.cs @@ -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 + diff --git a/Player/Player.cs b/Player/Player.cs index 5308998a6..b0d3cc498 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -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];