示例#1
0
        private static void OnNumberOfPlayers(SteamUserStats.NumberOfPlayersCallback callback)
        {
            JobAction job;

            if (!JobManager.TryRemoveJob(callback.JobID, out job) || !job.IsCommand)
            {
                return;
            }

            var request = job.CommandRequest;

            if (callback.Result != EResult.OK)
            {
                CommandHandler.ReplyToCommand(request.Command, "Unable to request player count: {0}{1}", Colors.RED, callback.Result);
            }
            else if (request.Target == 0)
            {
                CommandHandler.ReplyToCommand(
                    request.Command,
                    "{0}{1:N0}{2} people praising lord Gaben right now, influence:{3} {4}",
                    Colors.OLIVE, callback.NumPlayers, Colors.NORMAL,
                    Colors.DARKBLUE, SteamDB.GetAppURL(753, "graphs")
                    );
            }
            else
            {
                CommandHandler.ReplyToCommand(
                    request.Command,
                    "People playing {0}{1}{2} right now: {3}{4:N0}{5} -{6} {7}",
                    Colors.BLUE, Steam.GetAppName(request.Target), Colors.NORMAL,
                    Colors.OLIVE, callback.NumPlayers, Colors.NORMAL,
                    Colors.DARKBLUE, SteamDB.GetAppURL(request.Target, "graphs")
                    );
            }
        }
示例#2
0
        void OnNumPlayers(SteamUserStats.NumberOfPlayersCallback callback)
        {
            var req = GetRequest(r => r.JobID == callback.JobID);

            if (req == null)
            {
                return;
            }

            OnNumPlayers(new PlayerCountHandler.PlayerCountDetails {
                AppID = req.AppID, Result = callback.Result, Count = callback.NumPlayers
            }, req);
        }
示例#3
0
        void OnNumPlayers(SteamUserStats.NumberOfPlayersCallback callback)
        {
            var req = GetRequest(r => r.JobID == callback.JobID);

            if (req == null)
            {
                return;
            }

            if (callback.Result != EResult.OK)
            {
                IRC.Instance.Send(req.Channel, "{0}: Unable to request player counts for {1}: {2}", req.Requester.Nickname, GetAppName(req.GameID.AppID), callback.Result);
                return;
            }

            IRC.Instance.Send(req.Channel, "{0}: {1} players: {2}", req.Requester.Nickname, GetAppName(req.GameID.AppID), callback.NumPlayers);
        }
示例#4
0
        public void OnNumberOfPlayers(SteamUserStats.NumberOfPlayersCallback callback, JobID jobID)
        {
            var request = IRCRequests.Find(r => r.JobID == jobID);

            if (request == null)
            {
                return;
            }

            IRCRequests.Remove(request);

            if (callback.Result != EResult.OK)
            {
                CommandHandler.ReplyToCommand(request.Command, "{0}{1}{2}: Unable to request player count: {3}", Colors.OLIVE, request.Command.Nickname, Colors.NORMAL, callback.Result);
            }
            else if (request.Target == 0)
            {
                CommandHandler.ReplyToCommand(request.Command, "{0}{1}{2}: {3}{4:N0}{5} people praising lord Gaben right now, influence:{6} {7}", Colors.OLIVE, request.Command.Nickname, Colors.NORMAL, Colors.OLIVE, callback.NumPlayers, Colors.NORMAL, Colors.DARK_BLUE, SteamDB.GetGraphURL(0));
            }
            else
            {
                string graphUrl = string.Empty;
                string name     = GetAppName(request.Target);

                using (MySqlDataReader Reader = DbWorker.ExecuteReader("SELECT `AppID` FROM `ImportantApps` WHERE (`Graph` = 1 OR `MaxPlayers` > 0) AND `AppID` = @AppID", new MySqlParameter("AppID", request.Target)))
                {
                    if (Reader.Read())
                    {
                        graphUrl = string.Format("{0} -{1} {2}", Colors.NORMAL, Colors.DARK_BLUE, SteamDB.GetGraphURL(request.Target));
                    }
                }

                CommandHandler.ReplyToCommand(request.Command, "{0}{1}{2}: People playing {3}{4}{5} right now: {6}{7:N0}{8} -{9} {10}{11}",
                                              Colors.OLIVE, request.Command.Nickname, Colors.NORMAL,
                                              Colors.OLIVE, name, Colors.NORMAL,
                                              Colors.GREEN, callback.NumPlayers, Colors.NORMAL,
                                              Colors.DARK_BLUE, SteamDB.GetAppURL(request.Target), graphUrl);
            }
        }