public Kill(CPlayerInfo cpKiller, CPlayerInfo cpVictim, string strDamageType, bool blHeadshot, Point3D pntKiller, Point3D pntVictim) { if ((this.Killer = cpKiller) == null) { this.Killer = new CPlayerInfo(); } if ((this.Victim = cpVictim) == null) { this.Victim = new CPlayerInfo(); } this.IsSuicide = (String.Compare(this.Killer.SoldierName, this.Victim.SoldierName) == 0); this.DamageType = strDamageType; this.Headshot = blHeadshot; this.KillerLocation = pntKiller; this.VictimLocation = pntVictim; this.TimeOfDeath = DateTime.Now; double dx = pntKiller.X - pntVictim.X; double dy = pntKiller.Y - pntVictim.Y; double dz = pntKiller.Z - pntVictim.Z; this.Distance = Math.Sqrt(dx * dx + dy * dy + dz * dz); }
private void m_prcClient_ListPlayers(FrostbiteClient sender, List <CPlayerInfo> lstPlayers, CPlayerSubset cpsSubset) { this.InvokeIfRequired(() => { if (cpsSubset.Subset == CPlayerSubset.PlayerSubsetType.All) { lstPlayers.Sort((x, y) => String.Compare(x.SoldierName, y.SoldierName)); CPlayerInfo objSelected = (CPlayerInfo)this.cboPlayerList.SelectedItem; this.cboPlayerList.BeginUpdate(); //MoHW R-6 can't address individual players if (sender.GameType != "MOHW") { // org. for (int i = 0; i < this.cboPlayerList.Items.Count; i++) { CPlayerInfo cpiInfo = (CPlayerInfo)this.cboPlayerList.Items[i]; if (cpiInfo.SquadID != -10 && cpiInfo.TeamID != -10) { this.cboPlayerList.Items.RemoveAt(i); i--; } } foreach (CPlayerInfo cpiPlayer in lstPlayers) { if (this.isInComboList(cpiPlayer) == false) { this.cboPlayerList.Items.Add(cpiPlayer); } } this.cboPlayerList.SelectedIndex = 0; for (int i = 0; i < this.cboPlayerList.Items.Count; i++) { CPlayerInfo cpiInfo = (CPlayerInfo)this.cboPlayerList.Items[i]; if (String.Compare(cpiInfo.SoldierName, objSelected.SoldierName) == 0) { this.cboPlayerList.SelectedIndex = i; break; } } } // end hack this.cboPlayerList.EndUpdate(); } }); }
public virtual void OnListPlayers(List <CPlayerInfo> players, CPlayerSubset subset) { if (subset.Subset == CPlayerSubset.PlayerSubsetType.All) { List <CPlayerInfo> .Enumerator enumerator = players.GetEnumerator(); try { while (enumerator.MoveNext()) { CPlayerInfo current = enumerator.Current; if (FrostbitePlayerInfoList.ContainsKey(current.SoldierName)) { FrostbitePlayerInfoList[current.SoldierName] = current; } else { FrostbitePlayerInfoList.Add(current.SoldierName, current); } } } finally { ((IDisposable)enumerator).Dispose(); } foreach (string key in FrostbitePlayerInfoList.Keys) { bool flag = false; enumerator = players.GetEnumerator(); try { while (enumerator.MoveNext()) { if (string.Compare(enumerator.Current.SoldierName, FrostbitePlayerInfoList[key].SoldierName) == 0) { flag = true; break; } } } finally { ((IDisposable)enumerator).Dispose(); } if (!flag) { FrostbitePlayerInfoList.Remove(key); PunkbusterPlayerInfoList.Remove(key); } } } }
private bool isInComboList(CPlayerInfo cpiPlayer) { bool blFound = false; foreach (CPlayerInfo cpiInfo in this.cboPlayerList.Items) { if (String.Compare(cpiInfo.SoldierName, cpiPlayer.SoldierName) == 0) { blFound = true; break; } } return(blFound); }
private void m_prcClient_ListPlayers(FrostbiteClient sender, List <CPlayerInfo> lstPlayers, CPlayerSubset cpsSubset) { if (cpsSubset.Subset == CPlayerSubset.PlayerSubsetType.All) { lstPlayers.Sort((x, y) => String.Compare(x.SoldierName, y.SoldierName)); CPlayerInfo objSelected = (CPlayerInfo)this.cboPlayerList.SelectedItem; this.cboPlayerList.BeginUpdate(); // So much easier with linq.. foreach (CPlayerInfo cpiPlayer in lstPlayers) { if (this.isInComboList(cpiPlayer) == false) { this.cboPlayerList.Items.Add(cpiPlayer); } } for (int i = 0; i < this.cboPlayerList.Items.Count; i++) { bool blFound = false; CPlayerInfo cpiInfo = (CPlayerInfo)this.cboPlayerList.Items[i]; foreach (CPlayerInfo cpiPlayer in lstPlayers) { if (String.Compare(cpiInfo.SoldierName, cpiPlayer.SoldierName) == 0) { blFound = true; break; } } if (blFound == false && cpiInfo.SquadID != -10 && cpiInfo.TeamID != -10) { this.cboPlayerList.Items.RemoveAt(i); i--; } } this.cboPlayerList.EndUpdate(); } }
public override void OnPlayerLeft(CPlayerInfo playerInfo) { if (bf4db_AllPlayers.Contains(playerInfo.SoldierName)) { bf4db_AllPlayers.Remove(playerInfo.SoldierName); } if (bf4db_CheckedPlayers.Contains(playerInfo.SoldierName)) { bf4db_CheckedPlayers.Remove(playerInfo.SoldierName); } if (bf4db_PBPlayers.Contains(playerInfo.SoldierName)) { bf4db_PBPlayers.Remove(playerInfo.SoldierName); } if (bf4db_manualChecks.Contains(playerInfo.SoldierName)) { bf4db_manualChecks.Remove(playerInfo.SoldierName); } }
public override void OnPlayerTeamChange(String soldierName, int teamId, int squadId) { ConsoleWrite("OnPlayerTeamChange : " + soldierName + " / teamId = " + teamId + " / squadId=" + squadId + " / RoundTime=" + this.roundInfo.Time.ElapsedMilliseconds + "msec"); string movePlayerKey = soldierName + teamId; if (this.roundInfo.AdminMovePlayers.Contains(movePlayerKey)) { ConsoleWrite("RemoveForceMovePlayer: key=" + movePlayerKey + " / count=" + this.roundInfo.AdminMovePlayers.Count); // アドミンによるチーム移動 (元のチームに戻さない) this.roundInfo.RemoveForceMovePlayer(movePlayerKey); ConsoleWrite("Don't move again [" + soldierName + "]. (AdminForceMove)"); } else { // プレイヤーによるチーム移動 if (!IsAllowTeamChange()) // チーム移動可能か? { // サーバJOIN時は、自動的にニュートラルからチーム移動されるので、その時は除外する CPlayerInfo player = this.serverInfo.PlayerInfoList.Find((p) => p.SoldierName == soldierName); if (player == null || player.TeamID == TEAM_ID_NEUTRAL) { ConsoleWrite("Neutral to Team move by Server. (PlayerJoin)"); // 少数チームへJOINさせる BalancingJoinPlayer(soldierName); } else { // 元のチームへ戻す AdminForceMovePlayer(soldierName, getOpposingTeamId(teamId), 0, true); ConsoleWrite("<===== [" + soldierName + "] has been moved by Admin automatically. (PlayerTeamSwitch)"); SendGlobalMessage(soldierName + " has been moved by Admin automatically. (TeamSwitch)"); } } } }
public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { base.OnZoneTrespass(playerInfo, action, sender, tresspassLocation, tresspassPercentage, trespassState); Output.Information("{0}: SoldierName:{1} Action:{2} Level:{3} Uid:{4} ZoneInclusive:{5} Location:({6},{7},{8}) Percentage:{9} State:{10}", "OnZoneTrespass", playerInfo.SoldierName, action, sender.LevelFileName, sender.UID, sender.ZoneInclusive, tresspassLocation.X, tresspassLocation.Y, tresspassLocation.Z, tresspassPercentage, trespassState); foreach (var item in sender.Tags) { Output.Information("{0}: MapZone Tag:{1}", "OnZoneTrespass", item); } foreach (var item in sender.ZonePolygon) { Output.Information("{0}: MapZone Polygon:({1},{2},{3})", "OnZoneTrespass", item.X, item.Y, item.Z); } }
public override void OnPlayerLeft(CPlayerInfo cpiPlayer) { if (this.lsCheckedPlayers.Contains(cpiPlayer.SoldierName)) { this.lsCheckedPlayers.Remove(cpiPlayer.SoldierName); } if (this.dicPingCalled.ContainsKey(cpiPlayer.SoldierName) == true) { this.dicPingCalled.Remove(cpiPlayer.SoldierName); } if (this.lsPlayerInfo.Contains(cpiPlayer.SoldierName) == true) { this.lsPlayerInfo.Remove(cpiPlayer.SoldierName); } if (this.dicCountrys.ContainsKey(cpiPlayer.SoldierName) == true) { this.dicCountrys.Remove(cpiPlayer.SoldierName); } if (this.dicPlayerPings.ContainsKey(cpiPlayer.SoldierName) == true) { this.dicPlayerPings.Remove(cpiPlayer.SoldierName); } }
/* * public void OnServerInfo(CServerInfo csiInfo) { * * } */ private void cboPlayerList_DrawItem(object sender, DrawItemEventArgs e) { if (e.Index != -1) { //e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; CPlayerInfo cpiDraw = ((CPlayerInfo)cboPlayerList.Items[e.Index]); e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds); if (cpiDraw.SquadID == -10 && cpiDraw.TeamID == -10) { e.Graphics.DrawString(this.m_strAllPlayers, new Font("Calibri", 10, FontStyle.Bold), SystemBrushes.WindowText, e.Bounds.Left + 5, e.Bounds.Top, StringFormat.GenericDefault); } else if (cpiDraw.SquadID == -10 && cpiDraw.TeamID > 0) { e.Graphics.DrawString(cpiDraw.SoldierName, new Font("Calibri", 10, FontStyle.Bold), SystemBrushes.WindowText, e.Bounds.Left + 5, e.Bounds.Top, StringFormat.GenericDefault); } else { e.Graphics.DrawString(String.Format("{0} {1}", cpiDraw.ClanTag, cpiDraw.SoldierName), this.Font, SystemBrushes.WindowText, e.Bounds.Left + 5, e.Bounds.Top, StringFormat.GenericDefault); } } }
public override void OnPlayerLeft(CPlayerInfo cpiPlayer) { if (this.m_dicPbInfo.ContainsKey(cpiPlayer.SoldierName) == true) { this.m_dicPbInfo.Remove(cpiPlayer.SoldierName); } if (this.m_dicPlayerInfo.ContainsKey(cpiPlayer.SoldierName) == true) { this.m_dicPlayerInfo.Remove(cpiPlayer.SoldierName); } foreach (KeyValuePair <string, string> kvp in this.m_dicPlayerMutes) { if ((kvp.Key.CompareTo(cpiPlayer.SoldierName) == 0) && (kvp.Value.CompareTo("Leave server") == 0)) { RemoveMute(cpiPlayer.SoldierName); this.m_dicPlayerMutes.Remove(cpiPlayer.SoldierName); } } this.RegisterAllCommands(); }
public void OnPlayerLeft(CPlayerInfo cpiPlayer) { }
public virtual void OnPlayerLeft(CPlayerInfo playerInfo) { if (this.PunkbusterPlayerInfoList.ContainsKey(playerInfo.SoldierName) == true) { this.PunkbusterPlayerInfoList.Remove(playerInfo.SoldierName); } if (this.FrostbitePlayerInfoList.ContainsKey(playerInfo.SoldierName) == true) { this.FrostbitePlayerInfoList.Remove(playerInfo.SoldierName); } }
private ListViewItem CreatePlayer(CPlayerInfo cpiPlayer) { ListViewItem lviNewPlayer = new ListViewItem(""); lviNewPlayer.Name = cpiPlayer.SoldierName; lviNewPlayer.Tag = null; lviNewPlayer.UseItemStyleForSubItems = true; AdditionalPlayerInfo sapiAdditional = new AdditionalPlayerInfo(); sapiAdditional.m_cpiPlayer = cpiPlayer; sapiAdditional.m_strResolvedHostName = String.Empty; lviNewPlayer.Tag = sapiAdditional; ListViewItem.ListViewSubItem lviTags = new ListViewItem.ListViewSubItem(); lviTags.Name = "tags"; lviTags.Text = cpiPlayer.ClanTag; lviNewPlayer.SubItems.Add(lviTags); ListViewItem.ListViewSubItem lviTagsName = new ListViewItem.ListViewSubItem(); lviTagsName.Name = "soldiername"; lviTagsName.Text = cpiPlayer.SoldierName; lviNewPlayer.SubItems.Add(lviTagsName); if (this.m_prcClient != null && this.m_prcClient.Game != null && this.m_prcClient.Game.HasSquads == true) { ListViewItem.ListViewSubItem lviSquad = new ListViewItem.ListViewSubItem(); lviSquad.Name = "squad"; if (cpiPlayer.SquadID != uscPlayerListPanel.INT_NEUTRAL_SQUAD) { lviSquad.Text = this.m_clocLanguage.GetLocalized("global.Squad" + cpiPlayer.SquadID.ToString(), null); } lviNewPlayer.SubItems.Add(lviSquad); } ListViewItem.ListViewSubItem lviKit = new ListViewItem.ListViewSubItem(); lviKit.Name = "kit"; lviKit.Text = String.Empty; lviNewPlayer.SubItems.Add(lviKit); ListViewItem.ListViewSubItem lviScore = new ListViewItem.ListViewSubItem(); lviScore.Name = "score"; lviScore.Text = cpiPlayer.Score.ToString(); lviNewPlayer.SubItems.Add(lviScore); ListViewItem.ListViewSubItem lviKills = new ListViewItem.ListViewSubItem(); lviKills.Name = "kills"; lviKills.Tag = (Double)cpiPlayer.Kills; lviKills.Text = cpiPlayer.Kills.ToString(); lviNewPlayer.SubItems.Add(lviKills); ListViewItem.ListViewSubItem lviDeaths = new ListViewItem.ListViewSubItem(); lviDeaths.Name = "deaths"; lviDeaths.Tag = (Double)cpiPlayer.Deaths; lviDeaths.Text = cpiPlayer.Deaths.ToString(); lviNewPlayer.SubItems.Add(lviDeaths); ListViewItem.ListViewSubItem lviKDr = new ListViewItem.ListViewSubItem(); lviKDr.Name = "kdr"; lviKDr.Text = cpiPlayer.Deaths > 0 ? String.Format("{0:0.00}", (Double)cpiPlayer.Kills / (Double)cpiPlayer.Deaths) : String.Format("{0:0.00}", (Double)cpiPlayer.Kills); lviNewPlayer.SubItems.Add(lviKDr); ListViewItem.ListViewSubItem lviPing = new ListViewItem.ListViewSubItem(); lviPing.Name = "ping"; lviPing.Text = cpiPlayer.Ping.ToString(); lviNewPlayer.SubItems.Add(lviPing); ListViewItem.ListViewSubItem lviRank = new ListViewItem.ListViewSubItem(); lviRank.Name = "rank"; lviRank.Text = cpiPlayer.Rank.ToString(); lviNewPlayer.SubItems.Add(lviRank); return lviNewPlayer; }
public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { Output.TraceInformation("OnZoneTrespass {0} {1}", playerInfo.SoldierName, action, sender.LevelFileName); }
private void PRoConClient_PlayerKilled(FrostbiteClient sender, string strKiller, string strVictim, string strDamageType, bool blHeadshot, Point3D pntKiller, Point3D pntVictim) { if (this.PlayerKilled != null) { CPlayerInfo cpKiller = null, cpVictim = null; if (this.PlayerList.Contains(strKiller) == true) { cpKiller = this.PlayerList[strKiller]; } else { cpKiller = new CPlayerInfo(strKiller, String.Empty, 0, 0); } if (this.PlayerList.Contains(strVictim) == true) { cpVictim = this.PlayerList[strVictim]; } else { cpVictim = new CPlayerInfo(strVictim, String.Empty, 0, 0); } FrostbiteConnection.RaiseEvent(this.PlayerKilled.GetInvocationList(), this, new Kill(cpKiller, cpVictim, strDamageType, blHeadshot, pntKiller, pntVictim)); } }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { this.ProcessEvent(EventType.Playerlist, CapturableEvents.PlayerLeave, playerName); }
public Player(CPlayerInfo player) { this.player = player; start = DateTime.UtcNow; }
public void OnZoneTrespass(CPlayerInfo cpiSoldier, ZoneAction action, MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage, object trespassState) { if (flTresspassPercentage >= this.m_flMinimumTrespassError) { if (trespassState is Kill) { Kill trespassKill = (Kill)trespassState; // If the trespasser died within the zone (the killer does not need to be inside the zone) if (action == ZoneAction.Death) { if (trespassKill.IsSuicide == false) { // If the player was within the limit for base camping. // AND the player is not on the same team. if (trespassKill.Distance <= this.m_iMaximumDistanceForBaseCamping && trespassKill.Killer.TeamID != trespassKill.Victim.TeamID) { if (sender.Tags.Contains("EFAE_PROTECT_U.SARMY") == true) { // If the player was on U.S side // References: PRoCon.Core.CMap, PRoCon.Core.CTeamName if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.us", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectUsArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_RUSSIANARMY") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.ru", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectRussianArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_NVA") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.nva", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectNVArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_ATTACKERS") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.rush.attackers", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectAttackersKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } } } } // If the trespasser killed another player while inside the zone (the victim does not need to be inside the zone) else if (action == ZoneAction.Kill) { if (sender.Tags.Contains("EFAE_ANTICAMPER_SNIPER") == true) { // If they used a sniper rifle to kill. // References: PRoCon.Core.Players.Items.Weapon, PRoCon.Core.Players.Items.DamageTypes, PRoCon.Core.Players.Items.WeaponDictionary if (this.GetWeaponDamageType(trespassKill.DamageType) == DamageTypes.SniperRifle) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeAntiCamperSniperKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } } } } }
public override void OnPlayerLeft(CPlayerInfo playerInfo) { base.OnPlayerLeft(playerInfo); Output.TraceInformation("OnPlayerLeft {0}", playerInfo.SoldierName); }
public override void OnPlayerLeft(CPlayerInfo cpiPlayer) { RemoveFromLists(cpiPlayer.SoldierName, cpiPlayer.GUID); }
//Do all our checks here public override void OnPlayerKilled(Kill kKillerVictimDetails) { if (readySetGo) { if (kKillerVictimDetails != null) { CPlayerInfo killer = kKillerVictimDetails.Killer; if ((String.IsNullOrEmpty(killer.SoldierName) == true) || (killer.Type == 3) || (this.joinDelay.Contains(killer.SoldierName))) { // WriteLog("Killers name is blank. They just killed " + kKillerVictimDetails.Victim.SoldierName); } else { if (this.normalPlayer.ContainsKey(killer.SoldierName) == true) { if (String.IsNullOrEmpty(killer.GUID) == true) { WriteLog(killer.SoldierName + " has missing EA_GUID", killer.SoldierName, ""); PBHackAction(killer.SoldierName, ""); } } else { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has no record", killer.SoldierName, killer.GUID); } if (this.punkbusterPlayer.ContainsKey(killer.SoldierName) == true) { CPunkbusterInfo PBPlayer = this.punkbusterPlayer[killer.SoldierName]; if (String.IsNullOrEmpty(PBPlayer.GUID) == true) { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has no PBGUID", killer.SoldierName, killer.GUID); PBHackAction(killer.SoldierName, killer.GUID); } if (PBPlayer.GUID.Length != 32) { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has incorrect PBGUID Length", killer.SoldierName, killer.GUID); PBHackAction(killer.SoldierName, killer.GUID); } if (!(System.Text.RegularExpressions.Regex.IsMatch(PBPlayer.GUID, @"^[a-zA-Z0-9]+$"))) { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has invalid PBGUID", killer.SoldierName, killer.GUID); PBHackAction(killer.SoldierName, killer.GUID); } if (String.IsNullOrEmpty(PBPlayer.Ip) == true) { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has no IP Address", killer.SoldierName, killer.GUID); PBHackAction(killer.SoldierName, killer.GUID); } } else { WriteLog(killer.SoldierName + "(" + killer.GUID + ") has no PB record", killer.SoldierName, killer.GUID); PBHackAction(killer.SoldierName, killer.GUID); } } } else { WriteLog("Blank killer detected", "Log", "Log"); } } }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { this.InvokeIfRequired(() => { if (this.cboPlayers.Items.Contains(playerName) == true) { if (String.Compare((string)this.cboPlayers.SelectedItem, playerName) == 0) { this.uscBattlemap.CalibrationMarkers.Clear(); } this.cboPlayers.Items.Remove(playerName); } }); }
protected void OnPlayerLeft(FrostbiteClient sender, string strSoldierName, CPlayerInfo cpiPlayer) { if (this.PlayerList.Contains(strSoldierName) == true) { this.PlayerList.Remove(strSoldierName); } }
public void OnZoneTrespass(CPlayerInfo cpiSoldier, ZoneAction action, MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage) { }
private void MapGeometry_MapZoneTrespassed(CPlayerInfo cpiSoldier, PRoCon.Core.Battlemap.ZoneAction action, PRoCon.Core.Battlemap.MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage, object trespassState) { this.InvokeOnAllEnabled("OnZoneTrespass", new object[] { cpiSoldier, action, sender, pntTresspassLocation, flTresspassPercentage, trespassState }); }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { if (this.LogJoinLeaving == true) { if (cpiPlayer != null) { this.Write(DateTime.UtcNow.ToUniversalTime().AddHours(m_prcClient.Game.UTCoffset).ToLocalTime(), String.Format("^1{0}", this.m_prcClient.Language.GetLocalized("uscChatPanel.chkDisplayOnJoinLeaveEvents.Left", string.Format("{0} {1}", cpiPlayer.ClanTag, cpiPlayer.SoldierName)))); } else { this.Write(DateTime.UtcNow.ToUniversalTime().AddHours(m_prcClient.Game.UTCoffset).ToLocalTime(), String.Format("^1{0}", this.m_prcClient.Language.GetLocalized("uscChatPanel.chkDisplayOnJoinLeaveEvents.Left", playerName))); } } }
private bool isInComboList(CPlayerInfo cpiPlayer) { bool blFound = false; foreach (CPlayerInfo cpiInfo in this.cboPlayerList.Items) { if (String.Compare(cpiInfo.SoldierName, cpiPlayer.SoldierName) == 0) { blFound = true; break; } } return blFound; }
public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { base.OnZoneTrespass(playerInfo, action, sender, tresspassLocation, tresspassPercentage, trespassState); }
public GameClient(CPlayerInfo playerInfo) { playerData = playerInfo; }
public override void OnPlayerLeft(CPlayerInfo playerInfo) { base.OnPlayerLeft(playerInfo); this.RegisterAllCommands(); }
private void btnChatSend_Click(object sender, EventArgs e) { this.m_llChatHistory.AddFirst(this.txtChat.Text); if (this.m_llChatHistory.Count > 20) { this.m_llChatHistory.RemoveLast(); } this.m_llChatHistoryCurrentNode = null; CPlayerInfo objSelected = (CPlayerInfo)this.cboPlayerList.SelectedItem; if (objSelected != null) { if (this.cboDisplayList.SelectedIndex == 0) { string sayOutput = String.Empty; // PK if (this.txtChat.Text.Length > 0 && this.txtChat.Text[0] == '/') { sayOutput = this.txtChat.Text; } else { if (Program.ProconApplication.OptionsSettings.ChatDisplayAdminName) { sayOutput = String.Format("{0}: {1}", this.m_prcClient.Username.Length > 0 ? this.m_prcClient.Username : "******", this.txtChat.Text); } else { sayOutput = this.txtChat.Text; } } if (objSelected.SquadID == -10 && objSelected.TeamID == -10) { this.SendCommand(new List <string> { "admin.say", sayOutput, "all" }); } else if (objSelected.SquadID == -10 && objSelected.TeamID > 0) { this.SendCommand(new List <string> { "admin.say", sayOutput, "team", objSelected.TeamID.ToString() }); } else { this.SendCommand(new List <string> { "admin.say", sayOutput, "player", objSelected.SoldierName }); } } else if (this.cboDisplayList.SelectedIndex == 1) { this.m_iYellDuration = (int)cboDisplayChatTime.SelectedItem; if (this.m_prcClient.Game is BF4Client || this.m_prcClient.Game is BF3Client || this.m_prcClient.Game is MOHWClient) { this.m_iYellDuration = (int)cboDisplayChatTime.SelectedItem / 1000; } if (objSelected.SquadID == -10 && objSelected.TeamID == -10) { this.SendCommand(new List <string> { "admin.yell", this.txtChat.Text, ((int)this.m_iYellDuration).ToString(), "all" }); } else if (objSelected.SquadID == -10 && objSelected.TeamID > 0) { this.SendCommand(new List <string> { "admin.yell", this.txtChat.Text, ((int)this.m_iYellDuration).ToString(), "team", objSelected.TeamID.ToString() }); } else { this.SendCommand(new List <string> { "admin.yell", this.txtChat.Text, ((int)this.m_iYellDuration).ToString(), "player", objSelected.SoldierName }); } } } this.txtChat.Clear(); this.txtChat.Focus(); // update max length this.chatUpdTxtLength(); }
/// <summary> /// Fires when a player takes [ZoneAction] and [flTresspassPercentage] > 0.0F /// </summary> /// <param name="cpiSoldier">The PlayerInfo object procon has on the player.</param> /// <param name="action">The action the player has taken on the zone</param> /// <param name="sender">The mapzone object that has fired the event</param> /// <param name="pntTresspassLocation">The location, reported by the game, that the action has taken place</param> /// <param name="flTresspassPercentage">The percentage (0.0F to 1.0F) that the circle created by the error radius (default 14m) that /// this player has tresspased on the zone at point [pntTresspassLocation].</param> /// <param name="trespassState">Additional information about the event. If the ZoneAction is Kill/Death then this object is type "Kill".</param> public virtual void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { }
//private bool m_blSplitList = false; //private int m_iSplitPlayerLists = 1; private ListViewItem CreateTotalsPlayer(CPlayerInfo cpiDummyPlayer, int iTeamID) { ListViewItem lviReturn = this.CreatePlayer(new CPlayerInfo(cpiDummyPlayer.SoldierName, String.Empty, iTeamID, 0)); lviReturn.Name = cpiDummyPlayer.ClanTag; lviReturn.Font = new Font(this.Font, FontStyle.Bold); return lviReturn; }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { if (this.cboPlayers.Items.Contains(playerName) == true) { if (String.Compare((string)this.cboPlayers.SelectedItem, playerName) == 0) { this.uscBattlemap.CalibrationMarkers.Clear(); } this.cboPlayers.Items.Remove(playerName); } }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { if (this.m_dicPlayers.ContainsKey(playerName) == true) { this.m_dicPlayers[playerName].Remove(); this.m_dicPlayers.Remove(playerName); } if (this.m_dicPings.ContainsKey(playerName) == true) { this.m_dicPings.Remove(playerName); } this.UpdateTeamNames(); this.RefreshSelectedPlayer(); }
public override void OnPlayerLeft(CPlayerInfo playerInfo) { }
private void m_prcClient_PlayerLeft(FrostbiteClient sender, string playerName, CPlayerInfo cpiPlayer) { if (LogJoinLeaving == true && LogPlayerDisconnected == false) { if (cpiPlayer != null && cpiPlayer.ClanTag != null) { Write(DateTime.UtcNow.ToUniversalTime().AddHours(Client.Game.UtcOffset).ToLocalTime(), String.Format("^1{0}", Client.Language.GetLocalized("uscChatPanel.chkDisplayOnJoinLeaveEvents.Left", string.Format("{0} {1}", cpiPlayer.ClanTag, cpiPlayer.SoldierName)))); } else { Write(DateTime.UtcNow.ToUniversalTime().AddHours(Client.Game.UtcOffset).ToLocalTime(), String.Format("^1{0}", Client.Language.GetLocalized("uscChatPanel.chkDisplayOnJoinLeaveEvents.Left", playerName))); } } }
/// <summary> /// プレイヤーJOIN時にバランシングする /// </summary> /// <param name="soldierName"></param> private void BalancingJoinPlayer(String soldierName) { new Thread(new ThreadStart(() => { // サーバから最新のプレイヤーリストを取得 List <CPlayerInfo> playerList = getServerPlayersListSync(); if (playerList != null) { // バランシング対象プレイヤー CPlayerInfo playerInfo = playerList.Find((p) => p.SoldierName == soldierName); if (playerInfo == null) { ConsoleWrite("BalancingJoinPlayer: Can't find PlayerInfo"); return; } // ニュートラルの人数 int neutralcount = playerList.FindAll((p) => p.TeamID == TEAM_ID_NEUTRAL).Count; // チーム1の人数 int team1count = playerList.FindAll((p) => p.TeamID == TEAM_ID_1).Count; // チーム2の人数 int team2count = playerList.FindAll((p) => p.TeamID == TEAM_ID_2).Count; ConsoleWrite("BalancingJoinPlayer: Name=" + playerInfo.SoldierName + " / TeamId=" + playerInfo.TeamID + " / All=" + playerList.Count + " / Neutral=" + neutralcount + " / Team1=" + team1count + " / Team2=" + team2count); /* * 人数が少ないチームへJOINさせる */ // チーム人数の差 int absTeamDifference = Math.Abs(team1count - team2count); if (absTeamDifference == 1) { bool isJoinLargeTeam = (playerInfo.TeamID == TEAM_ID_1 && team1count > team2count) || (playerInfo.TeamID == TEAM_ID_2 && team1count < team2count); if (!isJoinLargeTeam) { // 少ないチームにJOINした場合は、そのまま移動させない ConsoleWrite("=====> " + soldierName + " JOINING TEAM" + playerInfo.TeamID + " (SMALL TEAM)"); } else { // チームが同数だった場合、ランダムにどちらかへJOINさせる int randomTeamId = this.randomGenerator.Next(TEAM_ID_1, TEAM_ID_2 + 1); // 移動元と移動先が同じ場合チーム移動させない if (playerInfo.TeamID != randomTeamId) { // 移動先が満員の場合、移動させない(司令官込みの人数なので厳密には満員ではない場合もある) int teamMaxCount = this.serverInfo.ServerInfo.MaxPlayerCount / 2; if ((randomTeamId == TEAM_ID_1 && team1count < teamMaxCount) || (randomTeamId == TEAM_ID_2 && team2count < teamMaxCount)) { AdminForceMovePlayer(soldierName, randomTeamId, 0, true); } } ConsoleWrite("=====> " + soldierName + " JOINING TEAM" + randomTeamId + " (RANDOM)"); } } else if (absTeamDifference >= 2) { // 人数差が2人以上の場合、チーム移動させる if (team1count < team2count) { // チーム1へ強制JOIN if (playerInfo.TeamID != TEAM_ID_1) { AdminForceMovePlayer(soldierName, TEAM_ID_1, 0, true); } ConsoleWrite("=====> " + soldierName + " JOINING TEAM1 (FORCE)"); } else { // チーム2へ強制JOIN if (playerInfo.TeamID != TEAM_ID_2) { AdminForceMovePlayer(soldierName, TEAM_ID_2, 0, true); } ConsoleWrite("=====> " + soldierName + " JOINING TEAM2 (FORCE)"); } } } })).Start(); }
/// <summary> /// Fires when a player takes [ZoneAction] and [flTresspassPercentage] > 0.0F /// </summary> /// <param name="playerInfo">The PlayerInfo object procon has on the player.</param> /// <param name="action">The action the player has taken on the zone</param> /// <param name="sender">The mapzone object that has fired the event</param> /// <param name="tresspassLocation">The location, reported by the game, that the action has taken place</param> /// <param name="tresspassPercentage">The percentage (0.0F to 1.0F) that the circle created by the error radius (default 14m) that /// this player has tresspased on the zone at point [pntTresspassLocation].</param> /// <param name="trespassState">Additional information about the event. If the ZoneAction is Kill/Death then this object is type "Kill".</param> public virtual void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { }
public override void OnPlayerLeft(CPlayerInfo playerInfo) { base.OnPlayerLeft(playerInfo); //Output.Information("OnPlayerLeft {0}", playerInfo.SoldierName); //Balance(); }