Esempio n. 1
0
 private void m_prcClient_PlayerUnbanned(PRoConClient sender, CBanInfo cbiUnbannedPlayer)
 {
     if (String.Compare(cbiUnbannedPlayer.IdType, "pbguid") == 0)
     {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerUnbanned, cbiUnbannedPlayer.Guid);
     }
 }
Esempio n. 2
0
        protected virtual void DispatchBanListAddRequest(FrostbiteLayerConnection sender, Packet cpRecievedPacket)
        {
            if (cpRecievedPacket.Words.Count >= 4)
            {
                CBanInfo newBan = new CBanInfo(cpRecievedPacket.Words[1], cpRecievedPacket.Words[2], new TimeoutSubset(cpRecievedPacket.Words.GetRange(3, TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3]))), cpRecievedPacket.Words.Count >= (4 + TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3])) ? cpRecievedPacket.Words[(3 + TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3]))] : "");

                if (this.RequestBanListAddRecieved != null)
                {
                    FrostbiteConnection.RaiseEvent(this.RequestBanListAddRecieved.GetInvocationList(), this, cpRecievedPacket, newBan);
                }
            }
        }
Esempio n. 3
0
        protected virtual void DispatchBanListAddRequest(ILayerConnection sender, Packet request)
        {
            if (request.Words.Count >= 4)
            {
                CBanInfo newBan = new CBanInfo(request.Words[1], request.Words[2], new TimeoutSubset(request.Words.GetRange(3, TimeoutSubset.RequiredLength(request.Words[3]))), request.Words.Count >= (4 + TimeoutSubset.RequiredLength(request.Words[3])) ? request.Words[(3 + TimeoutSubset.RequiredLength(request.Words[3]))] : "");

                var handler = this.RequestBanListAddRecieved;
                if (handler != null)
                {
                    handler(this, request, newBan);
                }
            }
        }
Esempio n. 4
0
 private void m_prcClient_BanListRemove(FrostbiteClient sender, CBanInfo cbiRemovedBan)
 {
     if (String.Compare(cbiRemovedBan.IdType, "name", true) == 0)
     {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerUnbanned, cbiRemovedBan.SoldierName);
     }
     else if (String.Compare(cbiRemovedBan.IdType, "ip", true) == 0)
     {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.IPUnbanned, cbiRemovedBan.IpAddress);
     }
     else if (String.Compare(cbiRemovedBan.IdType, "guid", true) == 0)
     {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDUnbanned, cbiRemovedBan.Guid);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Fired when unbanning a guid with pb_sv_unbanguid
 /// </summary>
 /// <param name="unban"></param>
 public virtual void OnPunkbusterUnbanInfo(CBanInfo unban) { }
Esempio n. 6
0
        private void m_prcClient_BanListAdd(FrostbiteClient sender, CBanInfo cbiAddedBan) {

            string target = String.Empty;

            if (String.Compare(cbiAddedBan.IdType, "name", true) == 0) {

                target = cbiAddedBan.SoldierName;
                if (cbiAddedBan.Reason.Length > 0) {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
            else if (String.Compare(cbiAddedBan.IdType, "ip", true) == 0) {

                target = cbiAddedBan.IpAddress;
                if (cbiAddedBan.Reason.Length > 0) {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
            else if (String.Compare(cbiAddedBan.IdType, "guid", true) == 0) {

                target = cbiAddedBan.Guid;
                if (cbiAddedBan.Reason.Length > 0) {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds) {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
        }
Esempio n. 7
0
 public void OnBanRemoved(CBanInfo cbiUnban)
 {
 }
Esempio n. 8
0
 public virtual void OnBanRemoved(CBanInfo ban) { }
Esempio n. 9
0
 private void m_prcClient_BanListRemove(FrostbiteClient sender, CBanInfo cbiRemovedBan) {
     InvokeOnAllEnabled("OnBanRemoved", cbiRemovedBan);
 }
Esempio n. 10
0
 public void OnPunkbusterBanInfo(CBanInfo cbiPunkbusterBan)
 {
 }
Esempio n. 11
0
 public virtual void OnBanRemoved(CBanInfo ban)
 {
 }
Esempio n. 12
0
 private void m_prcClient_PunkbusterPlayerBanned(PRoConClient sender, CBanInfo cbiBannedPlayer) {
     InvokeOnAllEnabled("OnPunkbusterBanInfo", cbiBannedPlayer);
 }
Esempio n. 13
0
        private void PacketDispatcher_RequestBanListAddRecieved(ILayerPacketDispatcher sender, Packet packet, CBanInfo newBan) {
            if (this.IsLoggedIn == true) {

                if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent && this.Privileges.CanPermanentlyBanPlayers == true) {
                    this.Client.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round && this.Privileges.CanTemporaryBanPlayers == true) {
                    this.Client.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.Privileges.CanPermanentlyBanPlayers == true) {
                    this.Client.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.Privileges.CanTemporaryBanPlayers == true) {
                    
                    if (newBan.BanLength.Seconds <= this.Client.Variables.GetVariable("TEMP_BAN_CEILING", 3600)) {
                        this.Client.SendProconLayerPacket(this, packet);
                    }
                    else {
                        sender.SendResponse(packet, LayerClient.ResponseInsufficientPrivileges);
                    }
                }
                else {
                    sender.SendResponse(packet, LayerClient.ResponseInsufficientPrivileges);
                }
            }
            else {
                sender.SendResponse(packet, LayerClient.ResponseLoginRequired);
            }
        }
Esempio n. 14
0
 public virtual void OnBanAdded(CBanInfo ban)
 {
 }
Esempio n. 15
0
 public override void OnPunkbusterBanInfo(CBanInfo ban)
 {
     base.OnPunkbusterBanInfo(ban);
 }
Esempio n. 16
0
 public override void OnBanRemoved(CBanInfo ban)
 {
     base.OnBanRemoved(ban);
 }
Esempio n. 17
0
        private void m_prcClient_PlayerUnbanned(PRoConClient sender, CBanInfo cbiUnbannedPlayer) {

            if (String.Compare(cbiUnbannedPlayer.IdType, "pbguid") == 0) {
                this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerUnbanned, cbiUnbannedPlayer.Guid);
            }

        }
Esempio n. 18
0
        protected virtual void DispatchBanListAddRequest(FrostbiteLayerConnection sender, Packet cpRecievedPacket) {

            if (cpRecievedPacket.Words.Count >= 4) {

                CBanInfo newBan = new CBanInfo(cpRecievedPacket.Words[1], cpRecievedPacket.Words[2], new TimeoutSubset(cpRecievedPacket.Words.GetRange(3, TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3]))), cpRecievedPacket.Words.Count >= (4 + TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3])) ? cpRecievedPacket.Words[(3 + TimeoutSubset.RequiredLength(cpRecievedPacket.Words[3]))] : "");

                if (this.RequestBanListAddRecieved != null) {
                    FrostbiteConnection.RaiseEvent(this.RequestBanListAddRecieved.GetInvocationList(), this, cpRecievedPacket, newBan);
                }
            }
        }
Esempio n. 19
0
 /// <summary>
 /// A ban taken from a punkbuster message and converted to a CBanInfo object
 /// </summary>
 /// <param name="ban"></param>
 public virtual void OnPunkbusterBanInfo(CBanInfo ban)
 {
 }
Esempio n. 20
0
        private void Game_RequestBanListAddRecieved(FrostbiteLayerClient sender, Packet packet, CBanInfo newBan) {
            if (this.IsLoggedIn == true) {

                if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent && this.m_sprvPrivileges.CanPermanentlyBanPlayers == true) {
                    this.m_prcClient.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round && this.m_sprvPrivileges.CanTemporaryBanPlayers == true) {
                    this.m_prcClient.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.m_sprvPrivileges.CanPermanentlyBanPlayers == true) {
                    this.m_prcClient.SendProconLayerPacket(this, packet);
                }
                else if (newBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds && this.m_sprvPrivileges.CanTemporaryBanPlayers == true) {
                    
                    if (newBan.BanLength.Seconds <= this.m_prcClient.Variables.GetVariable<int>("TEMP_BAN_CEILING", 3600)) {
                        this.m_prcClient.SendProconLayerPacket(this, packet);
                    }
                    else {
                        sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
                    }
                }
                else {
                    sender.SendResponse(packet, PRoConLayerClient.RESPONSE_INSUFFICIENT_PRIVILEGES);
                }
            }
            else {
                sender.SendResponse(packet, PRoConLayerClient.RESPONSE_LOGIN_REQUIRED);
            }
        }
Esempio n. 21
0
 /// <summary>
 /// Fired when unbanning a guid with pb_sv_unbanguid
 /// </summary>
 /// <param name="unban"></param>
 public virtual void OnPunkbusterUnbanInfo(CBanInfo unban)
 {
 }
Esempio n. 22
0
 private void m_prcClient_BanListAdd(FrostbiteClient sender, CBanInfo cbiAddedBan) {
     InvokeOnAllEnabled("OnBanAdded", cbiAddedBan);
 }
Esempio n. 23
0
        protected void OnPunkbusterMessage(FrostbiteClient sender, string strPunkbusterMessage) {

            strPunkbusterMessage = strPunkbusterMessage.TrimEnd('\r', '\n');

            // PunkBuster Server: ([0-9]+)[ ]? ([A-Za-z0-9]+)\(.*?\) ([0-9\.:]+).*?\(.*?\) "(.*?)"
            // PunkBuster Server: 1  2c90591ce08a5f799622705d7ba1155c(-) 192.168.1.3:52460 OK   1 3.0 0 (W) "(U3)Phogue"
            //Match mMatch = Regex.Match(strPunkbusterMessage, @":[ ]+?(?<slotid>[0-9]+)[ ]+?(?<guid>[A-Za-z0-9]+)\(.*?\)[ ]+?(?<ip>[0-9\.:]+).*?\(.*?\)[ ]+?""(?<name>.*?)\""", RegexOptions.IgnoreCase);
            Match mMatch = this.Parent.RegexMatchPunkbusterPlist.Match(strPunkbusterMessage);
            // If it is a punkbuster pb_plist update
            if (mMatch.Success == true && mMatch.Groups.Count >= 5) {

                CPunkbusterInfo newPbInfo = new CPunkbusterInfo(mMatch.Groups["slotid"].Value, mMatch.Groups["name"].Value, mMatch.Groups["guid"].Value, mMatch.Groups["ip"].Value, this.Parent.GetCountryName(mMatch.Groups["ip"].Value), this.Parent.GetCountryCode(mMatch.Groups["ip"].Value));

                if (this.PunkbusterPlayerInfo != null) {
                    FrostbiteConnection.RaiseEvent(this.PunkbusterPlayerInfo.GetInvocationList(), this, newPbInfo);
                }
            }

            mMatch = this.Parent.RegexMatchPunkbusterBeginPlist.Match(strPunkbusterMessage);
            if (mMatch.Success == true && this.PunkbusterBeginPlayerInfo != null) {
                FrostbiteConnection.RaiseEvent(this.PunkbusterBeginPlayerInfo.GetInvocationList(), this);
            }

            mMatch = this.Parent.RegexMatchPunkbusterEndPlist.Match(strPunkbusterMessage);
            if (mMatch.Success == true && this.PunkbusterEndPlayerInfo != null) {
                FrostbiteConnection.RaiseEvent(this.PunkbusterEndPlayerInfo.GetInvocationList(), this);
            }

            // PunkBuster Server: Player Guid Computed ([A-Za-z0-9]+)\(.*?\) \(slot #([0-9]+)\) ([0-9\.:]+) (.*)
            // PunkBuster Server: Player Guid Computed 2c90591ce08a5f799622705d7ba1155c(-) (slot #1) 192.168.1.3:52581 (U3)Phogue
            //mMatch = Regex.Match(strPunkbusterMessage, @": Player Guid Computed[ ]+?(?<guid>[A-Za-z0-9]+)\(.*?\)[ ]+?\(slot #(?<slotid>[0-9]+)\)[ ]+?(?<ip>[0-9\.:]+)[ ]+?(?<name>.*)", RegexOptions.IgnoreCase);
            mMatch = this.Parent.RegexMatchPunkbusterGuidComputed.Match(strPunkbusterMessage);
            // If it is a new connection, technically its a resolved guid type command but stil..
            if (mMatch.Success == true && mMatch.Groups.Count >= 5) {

                CPunkbusterInfo newPbInfo = new CPunkbusterInfo(mMatch.Groups["slotid"].Value, mMatch.Groups["name"].Value, mMatch.Groups["guid"].Value, mMatch.Groups["ip"].Value, this.Parent.GetCountryName(mMatch.Groups["ip"].Value), this.Parent.GetCountryCode(mMatch.Groups["ip"].Value));

                if (this.PunkbusterPlayerInfo != null) {
                    FrostbiteConnection.RaiseEvent(this.PunkbusterPlayerInfo.GetInvocationList(), this, newPbInfo);
                }
            }

            //mMatch = Regex.Match(strPunkbusterMessage, @":[ ]+?(?<banid>[0-9]+)[ ]+?(?<guid>[A-Za-z0-9]+)[ ]+?{(?<remaining>[0-9\-]+)/(?<banlength>[0-9\-]+)}[ ]+?""(?<name>.+?)""[ ]+?""(?<ip>.+?)""[ ]+?(?<reason>.*)", RegexOptions.IgnoreCase);
            mMatch = this.Parent.RegexMatchPunkbusterBanlist.Match(strPunkbusterMessage);
            if (mMatch.Success == true && mMatch.Groups.Count >= 5) {

                //IPAddress ipOut;
                string strIP = String.Empty;
                string[] a_strIP;

                if (mMatch.Groups["ip"].Value.Length > 0 && (a_strIP = mMatch.Groups["ip"].Value.Split(':')).Length > 0) {
                    strIP = a_strIP[0];
                }

                CBanInfo newPbBanInfo = new CBanInfo(mMatch.Groups["name"].Value, mMatch.Groups["guid"].Value, mMatch.Groups["ip"].Value, new TimeoutSubset(mMatch.Groups["banlength"].Value, mMatch.Groups["remaining"].Value), mMatch.Groups["reason"].Value);

                if (this.PunkbusterPlayerBanned != null) {
                    FrostbiteConnection.RaiseEvent(this.PunkbusterPlayerBanned.GetInvocationList(), this, newPbBanInfo);
                }
            }
            
            //PunkBuster Server: Kick/Ban Command Issued (testing) for (slot#1) xxx.xxx.xxx.xxx:yyyy GUID name
            mMatch = this.Parent.RegexMatchPunkbusterKickBanCmd.Match(strPunkbusterMessage);
            if (mMatch.Success == true && mMatch.Groups.Count >= 5)
            {
                //IPAddress ipOut;
                string strIP = String.Empty;
                string[] a_strIP;

                if (mMatch.Groups["ip"].Value.Length > 0 && (a_strIP = mMatch.Groups["ip"].Value.Split(':')).Length > 0)
                {
                    strIP = a_strIP[0];
                }

                TimeoutSubset kb_timeoutSubset;
                if (String.Compare(mMatch.Groups["kb_type"].ToString(), "Kick/Ban", true) == 0) {
                    kb_timeoutSubset = new TimeoutSubset(new List<string>() { "perm", "" });
                }
                else {
                    kb_timeoutSubset = new TimeoutSubset(new List<string>() { "seconds", "120" });
                }

                //CBanInfo newPbBanInfo = new CBanInfo(mMatch.Groups["name"].Value, mMatch.Groups["guid"].Value, mMatch.Groups["ip"].Value, new TimeoutSubset("perm",""), mMatch.Groups["reason"].Value);
                CBanInfo newPbBanInfo = new CBanInfo(mMatch.Groups["name"].Value, mMatch.Groups["guid"].Value, mMatch.Groups["ip"].Value, kb_timeoutSubset, mMatch.Groups["reason"].Value);

                if (this.PunkbusterPlayerBanned != null)
                {
                    FrostbiteConnection.RaiseEvent(this.PunkbusterPlayerBanned.GetInvocationList(), this, newPbBanInfo);
                }
            }
            
            //mMatch = Regex.Match(strPunkbusterMessage, @":[ ]+?Guid[ ]+?(?<guid>[A-Za-z0-9]+)[ ]+?has been Unbanned", RegexOptions.IgnoreCase);
            mMatch = this.Parent.RegexMatchPunkbusterUnban.Match(strPunkbusterMessage);
            // If it is a new connection, technically its a resolved guid type command but stil..
            if (mMatch.Success == true && mMatch.Groups.Count >= 2) {
                CBanInfo cbiUnbannedPlayer = new CBanInfo(String.Empty, mMatch.Groups["guid"].Value, String.Empty, new TimeoutSubset(TimeoutSubset.TimeoutSubsetType.None), String.Empty);

                if (this.PunkbusterPlayerUnbanned != null) {
                    FrostbiteConnection.RaiseEvent(this.PunkbusterPlayerUnbanned.GetInvocationList(), this, cbiUnbannedPlayer);
                }
            }

            //mMatch = Regex.Match(strPunkbusterMessage, @": Ban Added to Ban List", RegexOptions.IgnoreCase);
            mMatch = this.Parent.RegexMatchPunkbusterBanAdded.Match(strPunkbusterMessage);
            if (mMatch.Success == true && mMatch.Groups.Count >= 5) {
                this.SendRequest(new List<string>() { "punkBuster.pb_sv_command", this.Variables.GetVariable<string>("PUNKBUSTER_BANLIST_REFRESH", "pb_sv_banlist BC2! ") });
            }
        }
Esempio n. 24
0
        protected virtual void DispatchBanListAddRequest(ILayerConnection sender, Packet request) {
            if (request.Words.Count >= 4) {
                CBanInfo newBan = new CBanInfo(request.Words[1], request.Words[2], new TimeoutSubset(request.Words.GetRange(3, TimeoutSubset.RequiredLength(request.Words[3]))), request.Words.Count >= (4 + TimeoutSubset.RequiredLength(request.Words[3])) ? request.Words[(3 + TimeoutSubset.RequiredLength(request.Words[3]))] : "");

                var handler = this.RequestBanListAddRecieved;
                if (handler != null) {
                    handler(this, request, newBan);
                }
            }
        }
Esempio n. 25
0
 void m_prcClient_PunkbusterPlayerUnbanned(PRoConClient sender, CBanInfo cbiUnbannedPlayer) {
     this.InvokeOnAllEnabled("OnPunkbusterUnbanInfo", cbiUnbannedPlayer);
 }
Esempio n. 26
0
 public void OnBanAdded(CBanInfo cbiBan)
 {
 }
Esempio n. 27
0
        public void OnUnban(FrostbiteClient sender, CBanInfo cbiBan) {

            string strKey = String.Empty;

            if (String.Compare(cbiBan.IdType, "name") == 0 || String.Compare(cbiBan.IdType, "persona") == 0) {
                strKey = String.Format("{0}\r\n\r\n", cbiBan.SoldierName);
            }
            else if (String.Compare(cbiBan.IdType, "ip") == 0) {
                strKey = String.Format("\r\n{0}\r\n", cbiBan.IpAddress);
            }
            else if (String.Compare(cbiBan.IdType, "guid") == 0 || String.Compare(cbiBan.IdType, "pbguid") == 0) {
                strKey = String.Format("\r\n\r\n{0}", cbiBan.Guid);
            }

            if (this.lsvBanlist.Items.ContainsKey(strKey) == true) {
                this.lsvBanlist.Items[strKey].Remove();
                this.OnSettingResponse("local.banlist.unban", true);
            }
        }
Esempio n. 28
0
 public virtual void OnBanAdded(CBanInfo ban) { }
Esempio n. 29
0
        public void OnPbGuidBan(PRoConClient sender, CBanInfo cbiGuidBan) {
            this.lsvBanlist.BeginUpdate();

            if (this.lsvBanlist.Items.ContainsKey(String.Format("\r\n\r\n{0}", cbiGuidBan.Guid)) == false) {
                this.lsvBanlist.Items.Add(this.CreateBanEntry(cbiGuidBan));
            }
            else {
                ListViewItem lviBanEntry = this.lsvBanlist.Items[String.Format("\r\n\r\n{0}", cbiGuidBan.Guid)];
                lviBanEntry.Text = cbiGuidBan.SoldierName;
                lviBanEntry.SubItems["guid"].Text = cbiGuidBan.Guid;
                lviBanEntry.SubItems["ip"].Text = cbiGuidBan.IpAddress;

                lviBanEntry.SubItems["type"].Tag = cbiGuidBan.IdType;
                lviBanEntry.SubItems["type"].Text = this.GetFriendlyTypeName(cbiGuidBan.IdType);

                lviBanEntry.SubItems["timeremaining"].Tag = cbiGuidBan.BanLength;

                lviBanEntry.SubItems["reason"].Tag = cbiGuidBan.Reason.TrimEnd('"');
            }

            for (int i = 0; i < this.lsvBanlist.Columns.Count; i++) {
                this.lsvBanlist.Columns[i].Width = -2;
            }

            this.lsvBanlist.EndUpdate();
        }
Esempio n. 30
0
 /// <summary>
 /// A ban taken from a punkbuster message and converted to a CBanInfo object
 /// </summary>
 /// <param name="ban"></param>
 public virtual void OnPunkbusterBanInfo(CBanInfo ban) { }
Esempio n. 31
0
 public override void OnBanRemoved(CBanInfo ban)
 {
     Output.TraceInformation("OnBanRemoved {0} {1} {2} {3}", ban.SoldierName, ban.Guid, ban.IdType, ban.Reason);
 }
Esempio n. 32
0
 private void m_prcClient_PunkbusterPlayerUnbanned(PRoConClient sender, CBanInfo cbiUnbannedPlayer) {
     this.OnUnban(sender.Game, cbiUnbannedPlayer);    
 }
Esempio n. 33
0
 private void m_prcClient_BanListRemove(FrostbiteClient sender, CBanInfo cbiRemovedBan) {
     if (String.Compare(cbiRemovedBan.IdType, "name", true) == 0) {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerUnbanned, cbiRemovedBan.SoldierName);
     }
     else if (String.Compare(cbiRemovedBan.IdType, "ip", true) == 0) {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.IPUnbanned, cbiRemovedBan.IpAddress);
     }
     else if (String.Compare(cbiRemovedBan.IdType, "guid", true) == 0) {
         this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDUnbanned, cbiRemovedBan.Guid);
     }
 }
Esempio n. 34
0
 public void OnPbGuidUnban(CBanInfo cbiGuidBan) {
     if (this.lsvBanlist.Items.ContainsKey(String.Format("\r\n\r\n{0}", cbiGuidBan.Guid)) == true) {
         this.lsvBanlist.Items[String.Format("\r\n\r\n{0}", cbiGuidBan.Guid)].Remove();
         this.OnSettingResponse("local.banlist.unban", true);
     }
 }
Esempio n. 35
0
        private void m_prcClient_BanListAdd(FrostbiteClient sender, CBanInfo cbiAddedBan)
        {
            string target = String.Empty;

            if (String.Compare(cbiAddedBan.IdType, "name", true) == 0)
            {
                target = cbiAddedBan.SoldierName;
                if (cbiAddedBan.Reason.Length > 0)
                {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.PlayerTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
            else if (String.Compare(cbiAddedBan.IdType, "ip", true) == 0)
            {
                target = cbiAddedBan.IpAddress;
                if (cbiAddedBan.Reason.Length > 0)
                {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.IPTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
            else if (String.Compare(cbiAddedBan.IdType, "guid", true) == 0)
            {
                target = cbiAddedBan.Guid;
                if (cbiAddedBan.Reason.Length > 0)
                {
                    target += " [" + cbiAddedBan.Reason + "]";
                }

                if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Permanent)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDPermanentBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Round)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDRoundBanned, target);
                }
                else if (cbiAddedBan.BanLength.Subset == TimeoutSubset.TimeoutSubsetType.Seconds)
                {
                    this.ProcessEvent(EventType.Banlist, CapturableEvents.GUIDTimedBanned, target, (cbiAddedBan.BanLength.Seconds / 60).ToString());
                }
            }
        }
Esempio n. 36
0
        private ListViewItem CreateBanEntry(CBanInfo cbiPlayerBan) {

            ListViewItem lviNewBanEntry = null;

            if (String.Compare("name", cbiPlayerBan.IdType, true) == 0 || String.Compare("persona", cbiPlayerBan.IdType, true) == 0) {
                lviNewBanEntry = this.CreateBlankBanEntry(String.Format("{0}\r\n\r\n", cbiPlayerBan.SoldierName));
                lviNewBanEntry.Text = cbiPlayerBan.SoldierName;

                lviNewBanEntry.SubItems["type"].Tag = cbiPlayerBan.IdType;
                lviNewBanEntry.SubItems["type"].Text = this.GetFriendlyTypeName(cbiPlayerBan.IdType);

                //lviNewBanEntry.SubItems["banlength"].Tag = cbiPlayerBan.BanLength;
                lviNewBanEntry.SubItems["timeremaining"].Tag = cbiPlayerBan.BanLength;

                lviNewBanEntry.SubItems["reason"].Text = cbiPlayerBan.Reason;
            }
            else if (String.Compare("ip", cbiPlayerBan.IdType, true) == 0) {

                lviNewBanEntry = this.CreateBlankBanEntry(String.Format("\r\n{0}\r\n", cbiPlayerBan.IpAddress));
                lviNewBanEntry.Text = String.Empty;

                lviNewBanEntry.SubItems["ip"].Text = cbiPlayerBan.IpAddress;

                lviNewBanEntry.SubItems["type"].Tag = cbiPlayerBan.IdType;
                lviNewBanEntry.SubItems["type"].Text = this.GetFriendlyTypeName(cbiPlayerBan.IdType);

                //lviNewBanEntry.SubItems["banlength"].Tag = cbiPlayerBan.BanLength;
                lviNewBanEntry.SubItems["timeremaining"].Tag = cbiPlayerBan.BanLength;

                lviNewBanEntry.SubItems["reason"].Text = cbiPlayerBan.Reason;

            }
            else if (String.Compare("guid", cbiPlayerBan.IdType, true) == 0) {

                lviNewBanEntry = this.CreateBlankBanEntry(String.Format("\r\n\r\n{0}", cbiPlayerBan.Guid));
                lviNewBanEntry.Text = cbiPlayerBan.SoldierName;
                lviNewBanEntry.SubItems["guid"].Text = cbiPlayerBan.Guid;
                lviNewBanEntry.SubItems["ip"].Text = cbiPlayerBan.IpAddress;

                lviNewBanEntry.SubItems["type"].Tag = cbiPlayerBan.IdType;
                lviNewBanEntry.SubItems["type"].Text = this.GetFriendlyTypeName(cbiPlayerBan.IdType);

                //lviNewBanEntry.SubItems["banlength"].Tag = cbiPlayerBan.BanLength;
                lviNewBanEntry.SubItems["timeremaining"].Tag = cbiPlayerBan.BanLength;

                lviNewBanEntry.SubItems["reason"].Text = cbiPlayerBan.Reason;
            }

            else if (String.Compare("pbguid", cbiPlayerBan.IdType, true) == 0) {

                lviNewBanEntry = this.CreateBlankBanEntry(String.Format("\r\n\r\n{0}", cbiPlayerBan.Guid));
                lviNewBanEntry.Text = cbiPlayerBan.SoldierName;
                lviNewBanEntry.SubItems["guid"].Text = cbiPlayerBan.Guid;
                lviNewBanEntry.SubItems["ip"].Text = cbiPlayerBan.IpAddress;

                lviNewBanEntry.SubItems["type"].Tag = cbiPlayerBan.IdType;
                lviNewBanEntry.SubItems["type"].Text = this.GetFriendlyTypeName(cbiPlayerBan.IdType);

                //lviNewBanEntry.SubItems["banlength"].Tag = cbiPlayerBan.BanLength;
                lviNewBanEntry.SubItems["timeremaining"].Tag = cbiPlayerBan.BanLength;

                lviNewBanEntry.SubItems["reason"].Text = cbiPlayerBan.Reason.TrimEnd('"'); ;
            }

            return lviNewBanEntry;
        }
Esempio n. 37
0
 public override void OnPunkbusterUnbanInfo(CBanInfo unban)
 {
     Output.TraceInformation("OnPunkbusterUnbanInfo {0}", unban.SoldierName);
 }