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(); } } } }
public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) { if (cpbiPlayer == null) return; processNewPlayer(cpbiPlayer); }
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; }); }
public void OnPunkbusterplayerStatsCmd(CPunkbusterInfo cpbiPlayer) { }
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()); } }
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)); } }
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; } } }
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); } }
/// <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; }
public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) { }
/// <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); }
/// <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); }
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)); } }
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; }
public override void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) { base.OnPunkbusterPlayerInfo(cpbiPlayer); this.RegisterAllCommands(); }
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); } }
public void OnPunkbusterPlayerInfo(CPunkbusterInfo cpbiPlayer) { }
// 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; }
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; } } }