In our support boards we aim to provide support for the B3 core in its current state. Older releases of B3 are NOT supported. Check our front page for the latest version. You may post feature requests in our General Discussion board. Modifications and Hacks of the core B3 code are NOT supported.
Before you ask for support: [ Read the Support Instructions ] - More info: [ Full Support Disclaimer ]

Pages: [1]   Go Down
  Print  
Author Topic: CoD4 parser - missing IP's without punkbuster  (Read 2705 times) Bookmark and Share
Jr. Member
**
Posts: 24
Offline Offline
« on: October 20, 2009, 07:03:44 AM »

b3 ver: 1.2.0
cod4 parser ver: 1.1.4



first of all we do not run PB (mainly because of server population)

I don't know if anyone else is getting this problem

http://205.234.153.131/echelon/banlist.php

<< it shows ban's with missing IP's, and since we like to use the banlist plugin so we can just ban once to ban from both cod4 and cod5

<< you can also see that cod5 saves all the IP's
so what is the cod5 parser doing that the cod4 parser isnt doing? also can this be fixed?

any feedback would be appreciated
« Last Edit: October 20, 2009, 07:52:55 AM by fusi0n556 » Logged

[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #1 on: October 20, 2009, 07:56:12 AM »

I have made an alternative cod4 parser based on the cod5 parser a while ago. It's been sitting on my comp waiting for a situation where someone could test this alternative parser Smiley

Are you willing to be our guinea pig?
Logged

Jr. Member
**
Posts: 24
Offline Offline
« Reply #2 on: October 20, 2009, 08:26:26 AM »

Code:
this is the cod4.py parser you sent me on another post a while back: [code# BigBrotherBot(B3) (www.bigbrotherbot.com)
# Copyright (C) 2005 Michael "ThorN" Thornton
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# v1.1.2  : xlr8or - Alternate approach on the <32 character guid issue
# v1.1.3  : xlr8or - Improved approach for non PB servers
#         : Tighter regexp for playernames. _reColor strips ascii <33, 47 and >127
#           This includes spaces and also the / is removed.
# v1.1.4  : xlr8or - Removed bug for non PB servers


__author__  = 'ThorN, xlr8or'
__version__ = '1.1.4'

import b3.parsers.cod2
import b3.parsers.q3a
import b3.functions
import re, threading
from b3 import functions

class Cod4Parser(b3.parsers.cod2.Cod2Parser):
    gameName = 'cod4'
    #_reColor = re.compile(r'(\^.)|[\x00-\x20]|[\x7E-\xff]')
    _regPlayer = re.compile(r'^(?P<slot>[0-9]+)\s+(?P<score>[0-9-]+)\s+(?P<ping>[0-9]+)\s+(?P<guid>[a-z0-9]+)\s+(?P<name>.*?)\s+(?P<last>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9-]+)\s+(?P<qport>[0-9]+)\s+(?P<rate>[0-9]+)$', re.I)
    _counter = {}

    def getClient(self, match=None, attacker=None, victim=None):
        """Get a client object using the best availible data.
        Prefer GUID first, then Client ID (CID)
        """
        if attacker:
            keys = ['aguid', 'acid']
        else:
            keys = ['guid', 'cid']

        methods = [self.clients.getByGUID, self.clients.getByCID]

        match = attacker or victim or match

        for k, m in zip(keys, methods):
            client = m(match.group(k))
            if client:
                return client

    # join
    def OnJ(self, action, data, match=None):
        # COD4 stores the PBID in the log file
        codguid = match.group('guid')
        cid = match.group('cid')
        pbid = ''

        client = self.getClient(match)

        if client:
            # update existing client
            client.state = b3.STATE_ALIVE
            # possible name changed
            client.name = match.group('name')
        else:
            name = match.group('name')
            self._counter[cid] = 1
            t = threading.Timer(2, self.newPlayer, (cid, codguid, name))
            t.start()
            self.debug('%s connected, waiting for Authentication...' %name)
            self.debug('Our Authentication queue: %s' % self._counter)
            
        return b3.events.Event(b3.events.EVT_CLIENT_JOIN, None, client)

    # kill
    def OnK(self, action, data, match=None):
        victim = self.getClient(victim=match)
        if not victim:
            self.debug('No victim %s' % match.groupdict())
            self.OnJ(action, data, match)
            return None

        attacker = self.getClient(attacker=match)
        if not attacker:
            self.debug('No attacker %s' % match.groupdict())
            return None

        # COD4 doesn't report the team on kill, only use it if it's set
        # Hopefully the team has been set on another event
        if match.group('ateam'):
            attacker.team = self.getTeam(match.group('ateam'))

        if match.group('team'):
            victim.team = self.getTeam(match.group('team'))


        attacker.name = match.group('aname')
        victim.name = match.group('name')

        event = b3.events.EVT_CLIENT_KILL

        if attacker.cid == victim.cid:
            event = b3.events.EVT_CLIENT_SUICIDE
        elif attacker.team != b3.TEAM_UNKNOWN and \
             attacker.team and \
             victim.team and \
             attacker.team == victim.team:
            event = b3.events.EVT_CLIENT_KILL_TEAM

        victim.state = b3.STATE_DEAD
        return b3.events.Event(event, (float(match.group('damage')), match.group('aweap'), match.group('dlocation'), match.group('dtype')), attacker, victim)

    def sync(self):
        plist = self.getPlayerList()
        mlist = {}

        for cid, c in plist.iteritems():
            client = self.clients.getByCID(cid)
            if client:
                if client.guid and c.has_key('guid'):
                    if functions.fuzzyGuidMatch(client.guid, c['guid']):
                        # player matches
                        self.debug('in-sync %s == %s', client.guid, c['guid'])
                        mlist[str(cid)] = client
                    else:
                        self.debug('no-sync %s <> %s', client.guid, c['guid'])
                        client.disconnect()
                elif client.ip and c.has_key('ip'):
                    if client.ip == c['ip']:
                        # player matches
                        self.debug('in-sync %s == %s', client.ip, c['ip'])
                        mlist[str(cid)] = client
                    else:
                        self.debug('no-sync %s <> %s', client.ip, c['ip'])
                        client.disconnect()
                else:
                    self.debug('no-sync: no guid or ip found.')
        
        return mlist

    def authorizeClients(self):
        players = self.getPlayerList()
        self.verbose('authorizeClients() = %s' % players)

        for cid, p in players.iteritems():
            if self.PunkBuster:
                # Use guid since we already get the guid in the log file
                sp = self.clients.getByGUID(p['guid'])

                # Don't use invalid guid/pbid
                if len(p['guid']) < 32:
                    del p['guid']

                if len(p['pbid']) < 32:
                    del p['pbid']
            else:
                sp = self.clients.getByCID(cid)

            if sp:
                # Only set provided data, otherwise use the currently set data
                sp.ip   = p.get('ip', sp.ip)
                sp.pbid = p.get('pbid', sp.pbid)
                sp.guid = p.get('guid', sp.guid)
                sp.data = p
                sp.auth()


    def connectClient(self, ccid):
        if self.PunkBuster:
            self.debug('Getting the (PunkBuster) Playerlist')
        else:
            self.debug('Getting the (status) Playerlist')
        players = self.getPlayerList()
        self.verbose('connectClient() = %s' % players)

        for cid, p in players.iteritems():
            #self.debug('cid: %s, ccid: %s, p: %s' %(cid, ccid, p))
            if int(cid) == int(ccid):
                self.debug('Client found in status/playerList')
                return p

    def newPlayer(self, cid, codguid, name):
        if not self._counter.get(cid):
            self.verbose('newPlayer thread no longer needed, Key no longer available')
            return None
        if self._counter.get(cid) == 'Disconnected':
            self.debug('%s disconnected, removing from authentication queue' %name)
            self._counter.pop(cid)
            return None
        self.debug('newClient: %s, %s, %s' %(cid, codguid, name))
        sp = self.connectClient(cid)
        # PunkBuster is enabled, using PB guid
        if sp and self.PunkBuster:
            self.debug('sp: %s' % sp)
            guid = sp['pbid']
            pbid = guid # save pbid in both fields to be consistent with other pb enabled databases
            ip = sp['ip']
            self._counter.pop(cid)
        # PunkBuster is not enabled, using codguid
        elif sp:
            if not codguid:
                self.error('No CodGuid and no PunkBuster... cannot continue!')
                return None
            else:
                guid = sp['guid']
                ip = sp['ip']
                self._counter.pop(cid)
        elif self._counter[cid] > 10:
            self.debug('Couldn\'t Auth %s, giving up...' % name)
            self._counter.pop(cid)
            ip = ''
            return None
        # Player is not in the status response (yet), retry
        else:
            self.debug('%s not yet fully connected, retrying...#:%s' %(name, self._counter[cid]))
            self._counter[cid] +=1
            t = threading.Timer(4, self.newPlayer, (cid, codguid, name))
            t.start()
            return None
            
        client = self.clients.newClient(cid, name=name, ip=ip, state=b3.STATE_ALIVE, guid=guid, pbid=pbid, data={ 'codguid' : codguid })


sorry yeah i did test it and b3 became ghosted, when you try to type a command there would be no responce from b3 (i dont think it is finding the client)

log file

Code:
091021 00:16:24 BOT     Start reading...
091021 00:16:30 DEBUG MaxaliasesPlugin: Checking for Max aliases
091021 00:16:30 DEBUG MaxaliasesPlugin: checkbyconnect is not defined
091021 00:16:35 CONSOLE 45:33 say;d3f802ce0fefc530b5539c72e5a95a46;0;fusi0n556-NRNS;!help
091021 00:16:35 DEBUG No client - attempt join
091021 00:16:35 DEBUG fusi0n556-NRNS connected, waiting for Authentication...
091021 00:16:35 DEBUG Our Authentication queue: {'0': 1}
091021 00:16:37 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:37 DEBUG Getting the (status) Playerlist
091021 00:16:37 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:37 VERBOSE connectClient() = {}
091021 00:16:37 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:1
091021 00:16:40 CONSOLE 45:38 say;d3f802ce0fefc530b5539c72e5a95a46;0;fusi0n556-NRNS;!help
091021 00:16:40 DEBUG No client - attempt join
091021 00:16:40 DEBUG fusi0n556-NRNS connected, waiting for Authentication...
091021 00:16:40 DEBUG Our Authentication queue: {'0': 1}
091021 00:16:41 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:41 DEBUG Getting the (status) Playerlist
091021 00:16:41 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:42 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:42 DEBUG Getting the (status) Playerlist
091021 00:16:42 VERBOSE connectClient() = {}
091021 00:16:42 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:1
091021 00:16:42 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:42 VERBOSE connectClient() = {}
091021 00:16:42 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:2
091021 00:16:45 DEBUG MaxaliasesPlugin: Checking for Max aliases
091021 00:16:45 DEBUG MaxaliasesPlugin: checkbyconnect is not defined
091021 00:16:46 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:46 DEBUG Getting the (status) Playerlist
091021 00:16:46 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:46 VERBOSE connectClient() = {}
091021 00:16:46 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:3
091021 00:16:46 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:46 DEBUG Getting the (status) Playerlist
091021 00:16:46 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:47 VERBOSE connectClient() = {}
091021 00:16:47 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:4
091021 00:16:50 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:50 DEBUG Getting the (status) Playerlist
091021 00:16:50 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:51 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:51 DEBUG Getting the (status) Playerlist
091021 00:16:51 VERBOSE connectClient() = {}
091021 00:16:51 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:51 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:5
091021 00:16:51 VERBOSE connectClient() = {}
091021 00:16:51 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:6
091021 00:16:55 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:55 DEBUG Getting the (status) Playerlist
091021 00:16:55 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:55 VERBOSE connectClient() = {}
091021 00:16:55 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:7
091021 00:16:55 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:55 DEBUG Getting the (status) Playerlist
091021 00:16:55 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:16:56 VERBOSE connectClient() = {}
091021 00:16:56 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:8
091021 00:16:59 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:16:59 DEBUG Getting the (status) Playerlist
091021 00:16:59 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:17:00 DEBUG MaxaliasesPlugin: Checking for Max aliases
091021 00:17:00 DEBUG MaxaliasesPlugin: checkbyconnect is not defined
091021 00:17:00 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:17:00 DEBUG Getting the (status) Playerlist
091021 00:17:00 VERBOSE connectClient() = {}
091021 00:17:00 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:9
091021 00:17:00 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:17:01 VERBOSE StatusPlugin: Building XML status
091021 00:17:01 DEBUG StatusPlugin: Writing XML status to C:\Users\Cam/status.xml
091021 00:17:01 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:17:01 VERBOSE connectClient() = {}
091021 00:17:01 DEBUG fusi0n556-NRNS not yet fully connected, retrying...#:10
091021 00:17:04 DEBUG newClient: 0, d3f802ce0fefc530b5539c72e5a95a46, fusi0n556-NRNS
091021 00:17:04 DEBUG Getting the (status) Playerlist
091021 00:17:04 VERBOSE RCON sending (127.0.0.1:28960) status
091021 00:17:05 VERBOSE connectClient() = {}
091021 00:17:05 DEBUG Couldn't Auth fusi0n556-NRNS, giving up...
091021 00:17:05 VERBOSE newPlayer thread no longer needed, Key no longer available
091021 00:17:15 DEBUG MaxaliasesPlugin: Checking for Max aliases
091021 00:17:15 DEBUG MaxaliasesPlugin: checkbyconnect is not defined
091021 00:17:29 CONSOLE 46:28 say;d3f802ce0fefc530b5539c72e5a95a46;0;fusi0n556-NRNS;!help
091021 00:17:29 DEBUG No client - attempt join
091021 00:17:29 DEBUG fusi0n556-NRNS connected, waiting for Authentication...
091021 00:17:29 DEBUG Our Authentication queue: {'0': 1}


ignore maxaliases plugin (thats something i have been working on)
« Last Edit: October 20, 2009, 08:41:38 AM by fusi0n556 » Logged
Newbie
*
Posts: 9
Offline Offline
« Reply #3 on: November 18, 2009, 12:29:06 PM »

Same problem here, same configuration, far as i can tell, I've tried multiple cod4.py files to get it working, is it possible to make b3 get status using the rcon status command instead of parsing it? that might solve the problem.
Logged
Jr. Member
**
Posts: 24
Offline Offline
« Reply #4 on: December 26, 2009, 06:48:51 AM »

Same problem here, same configuration, far as i can tell, I've tried multiple cod4.py files to get it working, is it possible to make b3 get status using the rcon status command instead of parsing it? that might solve the problem.

if you have made or working on a fix for that it would be much appreciated if you could share it with me
Logged
[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #5 on: January 08, 2010, 09:14:22 AM »

The next version of the bot will hold a brand new cod4 parser that should work for servers with pb and without pb. Also the ip issue should alsobe solved with this one.

I need a few betatesters for this version of the parser.
Download the latest B3 version of my dev repo here: http://www.bigbrotherbot.com/forums/downloads/?sa=view;down=5 and upgrade the bot to the dev-version. You might want to backup your curernt install first, although I tested it on a cod4 server, you might want to rollback.
Logged

Newbie
*
Posts: 9
Offline Offline
« Reply #6 on: January 15, 2010, 12:43:35 AM »

Cool, I'll test it and let you know how it goes.

-EDIT-
As a sidenote, I've been having problems with b3 not responding, hopefully this'll fix that too.
-EDIT2-
Now it says that I don't have sufficient access
« Last Edit: January 15, 2010, 01:36:10 AM by zax33333 » Logged
Newbie
*
Posts: 9
Offline Offline
« Reply #7 on: January 15, 2010, 02:08:42 AM »

100115 01:45:26 CONSOLE 48:41 say;bfad413133d444e1570bf8fda17719f8;13;{SB} Z.a.X;U!b3
100115 01:45:26 VERBOSE Queueing event Say !b3
100115 01:45:26 VERBOSE Parsing Event: Say: CensorPlugin
100115 01:45:26 VERBOSE Parsing Event: Say: AdminPlugin
100115 01:45:26 DEBUG   AdminPlugin: OnSay handle 5:"!b3"
100115 01:45:26 DEBUG   AdminPlugin: Handle command !b3
100115 01:45:26 VERBOSE RCON sending (127.0.0.1:28960) tell 13 ^0(^2SB^0)^7: ^3[pm]^7 ^7You do not have sufficient access to use !b3
100115 01:45:26 VERBOSE Parsing Event: Say: ChatPlugin


There's part of the log.

Have the configuration files changed? I used the ones from the old directory.
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3477
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #8 on: January 15, 2010, 05:29:07 AM »

try to !register again.
Go to your mysql database, find the client table, find the row for your player and update the group_bits value to "128" so you are superadmin again
Logged

Newbie
*
Posts: 9
Offline Offline
« Reply #9 on: January 15, 2010, 10:44:35 AM »

Group bits are set to 128, I tried !register but I get the same message.
Logged
Newbie
*
Posts: 9
Offline Offline
« Reply #10 on: January 15, 2010, 12:12:12 PM »

Alright, I completely remade the database but now !b3 and !register do nothing, I Tried a few other commands too.

Here's an error in the log

100115 12:01:31 ERROR   STDERR Exception in thread Thread-27:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 663, in run
    self.function(*self.args, **self.kwargs)
  File "/games/b3/b3/parsers/cod4.py", line 239, in newPlayer
    self._counter.pop(cid)
KeyError: '11'



Let me know if you need the complete logfile

« Last Edit: January 15, 2010, 02:04:25 PM by zax33333 » Logged
Newbie
*
Posts: 9
Offline Offline
« Reply #11 on: January 15, 2010, 07:21:54 PM »

Hmm, well, for no reason whatsoever it has started working, guess I messed up somewhere when installing it, it seems to have fixed the problem though.
« Last Edit: January 15, 2010, 10:28:27 PM by zax33333 » Logged
Jr. Member
**
Posts: 24
Offline Offline
« Reply #12 on: January 22, 2010, 07:10:30 PM »

Okay I have Tested and it fully works... THANK YOU SOOOOOOOOO SO MUCH XLR8OR YOU HAVE REALLY MADE MY DAY AND OUR CLAN HAPPY
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal