Beispiel #1
0
        public override void Use(Player p, string message)
        {
            Player who = message == "" ? p : PlayerInfo.Find(message);

            if (message == "")
            {
                message = p.name;
            }
            if (who == null || !Entities.CanSee(p, who))
            {
                Player.SendMessage(p, "\"" + message + "\" is offline! Using /whowas instead.");
                Command.all.Find("whowas").Use(p, message); return;
            }

            WhoInfo info   = new WhoInfo();
            string  prefix = who.title == "" ? "" : "[" + who.titlecolor + who.title + who.color + "] ";

            info.FullName    = prefix + who.ColoredName;
            info.Name        = who.name;
            info.Group       = who.group;
            info.Money       = who.money; info.Deaths = who.overallDeath;
            info.TotalBlocks = who.overallBlocks; info.LoginBlocks = who.loginBlocks;
            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.RoundsTotal   = who.Game.TotalRoundsSurvived;
            info.RoundsMax     = who.Game.MaxRoundsSurvived;
            info.InfectedTotal = who.Game.TotalInfected;
            info.InfectedMax   = who.Game.MaxInfected;
            WhoInfo.Output(p, info, CheckAdditionalPerm(p));
        }
Beispiel #2
0
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p); return;
            }
            int    matches;
            Player pl = PlayerInfo.FindOrShowMatches(p, message, out matches);

            if (matches > 1)
            {
                return;
            }
            if (matches == 1)
            {
                Player.SendMessage(p, pl.color + pl.name + " %Sis online, using /whois instead.");
                Command.all.Find("whois").Use(p, message); return;
            }

            if (!Player.ValidName(message))
            {
                Player.SendMessage(p, "\"" + message + "\" is not a valid player name."); return;
            }
            OfflinePlayer target = PlayerInfo.FindOffline(message, true);

            if (target == null)
            {
                Player.SendMessage(p, "\"" + message + "\" was not found in the database.");
                Player.SendMessage(p, "Note you must use a player's full account name."); return;
            }

            Group  group  = Group.Find(Group.findPlayer(message));
            string color  = target.color == "" ? group.color : target.color;
            string prefix = target.title == "" ? "" : "[" + target.titleColor + target.title + color + "] ";

            WhoInfo info = new WhoInfo();

            info.FullName    = prefix + color + target.name.TrimEnd('+');
            info.Name        = target.name;
            info.Group       = group;
            info.Money       = int.Parse(target.money); info.Deaths = int.Parse(target.deaths);
            info.TotalBlocks = long.Parse(target.blocks); info.LoginBlocks = -1;
            info.TimeSpent   = target.totalTime.ParseDBTime();
            info.First       = DateTime.Parse(target.firstLogin);
            info.Last        = DateTime.Parse(target.lastLogin);
            info.Logins      = int.Parse(target.logins); info.Kicks = int.Parse(target.kicks);
            info.IP          = target.ip;

            if (Server.zombie.Running)
            {
                ZombieStats stats = Server.zombie.LoadZombieStats(target.name);
                info.RoundsTotal = stats.TotalRounds; info.InfectedTotal = stats.TotalInfected;
                info.RoundsMax   = stats.MaxRounds; info.InfectedMax = stats.MaxInfected;
            }
            WhoInfo.Output(p, info, CheckAdditionalPerm(p));
        }
Beispiel #3
0
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                message = p.name;
            }
            int    matches;
            Player pl = PlayerInfo.FindMatches(p, message, out matches);

            if (matches > 1)
            {
                return;
            }

            WhoInfo info;

            if (matches == 1)
            {
                info = FromOnline(pl);
            }
            else
            {
                if (!Formatter.ValidName(p, message, "player"))
                {
                    return;
                }
                Player.Message(p, "Searching database for the player..");
                PlayerData target = PlayerInfo.FindOfflineMatches(p, message);
                if (target == null)
                {
                    return;
                }
                info = FromOffline(target, message);
            }
            WhoInfo.Output(p, info, CheckExtraPerm(p));
        }