コード例 #1
0
ファイル: InsaneBalancer.cs プロジェクト: ratdart/Procon-1
        public void processNewPlayer(CPunkbusterInfo cpbiPlayer) {
            if (this.players.ContainsKey(cpbiPlayer.SoldierName))
                this.players[cpbiPlayer.SoldierName].pbinfo = cpbiPlayer;
            else {
                lock (mutex) {

                    // add new player to the queue, and wake the stats fetching loop
                    if (!(new_player_queue.ContainsKey(cpbiPlayer.SoldierName) ||
                          players.ContainsKey(cpbiPlayer.SoldierName) ||
                          new_players_batch.ContainsKey(cpbiPlayer.SoldierName))) {
                        DebugWrite("Queueing ^b" + cpbiPlayer.SoldierName + "^n for stats fetching", 1);
                        new_player_queue.Add(cpbiPlayer.SoldierName, cpbiPlayer);
                        wake_handle.Set();
                    }

                }
            }
        }
コード例 #2
0
ファイル: InsaneBalancer.cs プロジェクト: ratdart/Procon-1
        public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) {

            if (cpbiPlayer == null)
                return;

            processNewPlayer(cpbiPlayer);
        }
コード例 #3
0
        private void m_prcClient_PunkbusterPlayerInfo(PRoConClient sender, CPunkbusterInfo pbInfo) {
            this.InvokeIfRequired(() => {
                this.PropogatingIndexChange = true;

                if (this.Players.ContainsKey(pbInfo.SoldierName) == true) {

                    AdditionalPlayerInfo sapiAdditional;

                    if (this.Players[pbInfo.SoldierName].Tag == null) {
                        sapiAdditional = new AdditionalPlayerInfo();
                        sapiAdditional.ResolvedHostName = String.Empty;
                    }
                    else {
                        sapiAdditional = (AdditionalPlayerInfo)this.Players[pbInfo.SoldierName].Tag;
                    }

                    sapiAdditional.Punkbuster = pbInfo;

                    this.Players[pbInfo.SoldierName].Tag = sapiAdditional;

                    this.Players[pbInfo.SoldierName].Text = pbInfo.SlotID;

                    //string strCountryCode = this.m_frmMain.GetCountryCode(pbInfo.Ip);
                    if (this.Main.iglFlags.Images.ContainsKey(pbInfo.PlayerCountryCode + ".png") == true && this.Players[sapiAdditional.Punkbuster.SoldierName].ImageIndex < 0) {
                        this.Players[pbInfo.SoldierName].ImageIndex = this.Main.iglFlags.Images.IndexOfKey(pbInfo.PlayerCountryCode + ".png");
                    }

                    this.RefreshSelectedPlayer();
                }

                this.PropogatingIndexChange = false;
            });
        }
コード例 #4
0
ファイル: InsaneBalancer.cs プロジェクト: ratdart/Procon-1
 public void OnPunkbusterplayerStatsCmd(CPunkbusterInfo cpbiPlayer) {
 }
コード例 #5
0
ファイル: AdKats.cs プロジェクト: jamesonp/AdKats
 public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
 {
     try
     {
         this.DebugWrite("OPPI: OnPunkbusterPlayerInfo fired!", 7);
         AdKat_Player targetPlayer = null;
         Boolean callBanCheck = false;
         if (this.playerDictionary.TryGetValue(cpbiPlayer.SoldierName, out targetPlayer))
         {
             this.DebugWrite("OPPI: PB player already in the player list.", 6);
             callBanCheck = (targetPlayer.player_ip == null);
             //Update the player with pb info
             targetPlayer.PBPlayerInfo = cpbiPlayer;
             targetPlayer.player_pbguid = cpbiPlayer.GUID;
             targetPlayer.player_slot = cpbiPlayer.SlotID;
             targetPlayer.player_ip = cpbiPlayer.Ip;
             if (callBanCheck)
             {
                 this.DebugWrite("OPPI: Queueing existing player for another ban check.", 6);
                 this.queuePlayerForBanCheck(targetPlayer);
             }
         }
         this.DebugWrite("OPPI: Player slot: " + cpbiPlayer.SlotID, 7);
         this.DebugWrite("OPPI: OnPunkbusterPlayerInfo finished!", 7);
     }
     catch (Exception e)
     {
         this.ConsoleException(e.ToString());
     }
 }
コード例 #6
0
ファイル: AdKats.cs プロジェクト: Chicago847/AdKats
 public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
 {
     try {
         this.DebugWrite("OPPI: OnPunkbusterPlayerInfo fired!", 7);
         lock (this._PlayersMutex) {
             AdKatsPlayer targetPlayer = null;
             if (this._PlayerDictionary.TryGetValue(cpbiPlayer.SoldierName, out targetPlayer)) {
                 this.DebugWrite("OPPI: PB player already in the player list.", 7);
                 Boolean updatePlayer = (targetPlayer.player_ip == null);
                 //Update the player with pb info
                 targetPlayer.PBPlayerInfo = cpbiPlayer;
                 targetPlayer.player_pbguid = cpbiPlayer.GUID;
                 targetPlayer.player_slot = cpbiPlayer.SlotID;
                 targetPlayer.player_ip = cpbiPlayer.Ip.Split(':')[0];
                 if (updatePlayer) {
                     this.DebugWrite("OPPI: Queueing existing player " + targetPlayer.player_name + " for update.", 4);
                     this.UpdatePlayer(targetPlayer);
                     //If using ban enforcer, queue player for update
                     if (this._UseBanEnforcer) {
                         this.QueuePlayerForBanCheck(targetPlayer);
                     }
                 }
             }
             this.DebugWrite("OPPI: Player slot: " + cpbiPlayer.SlotID, 7);
         }
         this.DebugWrite("OPPI: OnPunkbusterPlayerInfo finished!", 7);
     }
     catch (Exception e) {
         this.HandleException(new AdKatsException("Error occured while processing punkbuster info.", e));
     }
 }
コード例 #7
0
        public void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) {

            if (cpbiPlayer != null) {
                if (this.m_dicPbInfo.ContainsKey(cpbiPlayer.SoldierName) == false) {
                    this.m_dicPbInfo.Add(cpbiPlayer.SoldierName, cpbiPlayer);
                }
                else {
                    this.m_dicPbInfo[cpbiPlayer.SoldierName] = cpbiPlayer;
                }
            }
        }
コード例 #8
0
ファイル: ProconRulz.cs プロジェクト: Geolim4/ProconRulz
        public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
        {
            // EVENT EXCEPTION BLOCK:
            try
            {
                WriteDebugInfo("ProconRulz: ********************OnPunkbusterPlayerInfo******************************" +
                    cpbiPlayer.SoldierName);

                players.update(cpbiPlayer); // add pb_guid and ip
            }
            catch (Exception ex)
            {
                WriteConsole("ProconRulz: recoverable exception in OnPunkbusterPlayerInfo");
                PrintException(ex);
            }
        }
コード例 #9
0
ファイル: TeamspeakSync.cs プロジェクト: RoyDodd/PURE-Misc
 /// <summary>Creates the GameClient with everything.</summary>
 /// <param name="genInfo">The player's general information.</param>
 /// <param name="pbInfo">The player's punkbuster information.</param>
 public GameClient(CPlayerInfo genInfo, CPunkbusterInfo pbInfo)
 {
     generalInfo = genInfo; punkbusterInfo = pbInfo;
 }
コード例 #10
0
 public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
 {
 }
コード例 #11
0
ファイル: TeamspeakSync.cs プロジェクト: RoyDodd/PURE-Misc
        /// <summary>Updates the punkbuster information with new information.</summary>
        /// <param name="punkInfo">The punkbuster information to add.</param>
        public void updatePbInfo(CPunkbusterInfo punkInfo)
        {
            // Remove the port off the IP of the punkbuster info.
            punkInfo = new CPunkbusterInfo(
                punkInfo.SlotID,
                punkInfo.SoldierName,
                punkInfo.GUID,
                punkInfo.Ip.Remove((punkInfo.Ip.Contains(":") ? punkInfo.Ip.IndexOf(':') : 0)),
                punkInfo.PlayerCountry, punkInfo.PlayerCountryCode);

            // If it's in the list already and it has ip information, just replace it.  Otherwise, add it to the list.
            if (mClientPbInfo.ContainsKey(punkInfo.SoldierName))
            {
                if (punkInfo.Ip != "")
                    mClientPbInfo[punkInfo.SoldierName] = punkInfo;
            }
            else
                mClientPbInfo.Add(punkInfo.SoldierName, punkInfo);

            // Debug player information print.
            debugWrite(dbgClients, "[Clients] Result of Punkbuster Client Update:");
            debugWrite(dbgClients, "- PB Client [Ip: {0}, Name: {1}]", punkInfo.Ip, punkInfo.SoldierName);
        }
コード例 #12
0
ファイル: TeamspeakSync.cs プロジェクト: RoyDodd/PURE-Misc
 /// <summary>Is called when a single player's punkbuster info is received.</summary>
 public void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
 {
     if (mEnabled && !mTsReconnecting)
         addToActionQueue(Commands.UpdatePbClientInfo, cpbiPlayer);
 }
コード例 #13
0
ファイル: AdKats.cs プロジェクト: LmaA-aD/AdKats
 public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) {
     try {
         DebugWrite("OPPI: OnPunkbusterPlayerInfo fired!", 7);
         AdKatsPlayer aPlayer;
         if (_PlayerDictionary.TryGetValue(cpbiPlayer.SoldierName, out aPlayer)) {
             DebugWrite("OPPI: PB player already in the player list.", 7);
             Boolean updatePlayer = false;
             //Update the player with pb info
             aPlayer.PBPlayerInfo = cpbiPlayer;
             aPlayer.player_pbguid = cpbiPlayer.GUID;
             aPlayer.player_slot = cpbiPlayer.SlotID;
             String player_ip = cpbiPlayer.Ip.Split(':')[0];
             if (player_ip != aPlayer.player_ip && !String.IsNullOrEmpty(player_ip)) {
                 updatePlayer = true;
                 if (!String.IsNullOrEmpty(aPlayer.player_ip)) {
                     DebugWrite(aPlayer.player_name + " changed their IP from " + aPlayer.player_ip + " to " + player_ip + ". Updating the database.", 2);
                     var record = new AdKatsRecord {
                         record_source = AdKatsRecord.Sources.InternalAutomated,
                         server_id = _serverID,
                         command_type = _CommandKeyDictionary["player_changeip"],
                         command_numeric = 0,
                         target_name = aPlayer.player_name,
                         target_player = aPlayer,
                         source_name = "AdKats",
                         record_message = aPlayer.player_ip
                     };
                     QueueRecordForProcessing(record);
                 }
             }
             aPlayer.player_ip = player_ip;
             if (updatePlayer) {
                 DebugWrite("OPPI: Queueing existing player " + aPlayer.player_name + " for update.", 4);
                 UpdatePlayer(aPlayer);
                 //If using ban enforcer, queue player for update
                 if (_UseBanEnforcer) {
                     QueuePlayerForBanCheck(aPlayer);
                 }
             }
         }
         DebugWrite("OPPI: Player slot: " + cpbiPlayer.SlotID, 7);
         DebugWrite("OPPI: OnPunkbusterPlayerInfo finished!", 7);
     }
     catch (Exception e) {
         HandleException(new AdKatsException("Error occured while processing punkbuster info.", e));
     }
 }
コード例 #14
0
ファイル: InsaneBalancer.cs プロジェクト: ratdart/Procon-1
            public PlayerProfile(PlayerProfile player) {
                /* shallow copy */
                updateInfo(player.info);
                pbinfo = player.pbinfo;
                name = player.name;
                plugin = player.plugin;
                stats = player.stats;
                state = player.state;
                qmsg = player.qmsg;
                tag = player.tag;
                time = player.time;
                random_value = player.random_value;

                last_kill = player.last_kill;
                last_death = player.last_death;
                last_spawn = player.last_spawn;
                last_chat = player.last_chat;
                last_score = player.last_score;

                savedTeamId = player.savedTeamId;
                savedSquadId = player.savedSquadId;

                targetTeamId = player.targetTeamId;
                targetSquadId = player.targetSquadId;

                delayedTeamId = player.delayedTeamId;
                delayedSquadId = player.delayedSquadId;
            }
コード例 #15
0
        public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) {
			base.OnPunkbusterPlayerInfo(cpbiPlayer);
            
			this.RegisterAllCommands();
        }
コード例 #16
0
ファイル: InsaneBalancer.cs プロジェクト: ratdart/Procon-1
            public PlayerProfile(InsaneBalancer plg, CPunkbusterInfo inf) {

                try {
                    plugin = plg;
                    info = new CPlayerInfo();
                    pbinfo = inf;
                    name = pbinfo.SoldierName;

                    time = DateTime.Now;
                    round_stats = new PlayerStats();
                    stats = new PlayerStats();
                    resetStats();

                    fetchStats();
                } catch (Exception e) {
                    plugin.dump_exception(e);
                }
            }
コード例 #17
0
ファイル: CMixedGamemodes.cs プロジェクト: ratdart/Procon-1
        public void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) {

        }
コード例 #18
0
ファイル: ProconRulz.cs プロジェクト: Geolim4/ProconRulz
 // update based on Punkbuster info
 public void update(CPunkbusterInfo inf)
 {
     string player_name = inf.SoldierName;
     if (!info.ContainsKey(player_name) || info[player_name] == null)
         info[player_name] = new PlayerData();
     info[player_name].name = player_name;
     info[player_name].pb_guid = inf.GUID;
     info[player_name].ip = inf.Ip;
     info[player_name].country_key = inf.PlayerCountryCode;
     info[player_name].country_name = inf.PlayerCountry;
 }
コード例 #19
0
 public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer)
 {
     if (cpbiPlayer != null)
     {
         if (this.dicCountrys.ContainsKey(cpbiPlayer.SoldierName) == false)
         {
             this.dicCountrys.Add(cpbiPlayer.SoldierName, cpbiPlayer.PlayerCountry);
         }
         else
         {
             this.dicCountrys[cpbiPlayer.SoldierName] = cpbiPlayer.PlayerCountry;
         }
     }
 }