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] 2   Go Down
  Print  
Author Topic: TK plugin  (Read 3107 times) Bookmark and Share
Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« on: October 28, 2009, 07:24:36 PM »

First how do i set it so it will annouce warnings, forgives and grudge's in main chat and not pm. also when someone switch's to spectator it warns them for tk against themselves.
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3483
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: October 28, 2009, 11:13:15 PM »

to show warn messages to everyone, set
Code:
<set name="pm_global">0</set>
in plugin_admin.xml
and
Code:
<set name="private_messages">False</set>
in plugin_tk.xml

For the issue with someone being given a tk warning when going to spec, this depend on what game parser you are using.
Logged

Jr. Member
**
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 40
Offline Offline
« Reply #2 on: October 29, 2009, 03:39:11 AM »

We had to disable the TK plugin for both CoD4 and CoD WaW. Certain mods and definitely the FFA gametype got people kicked/banned for TKing when they did not. I read somewhere about how it is a fail on the games part with logging.

Logged
B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #3 on: October 29, 2009, 03:58:44 AM »

CoD5 shouldn't need it disabled. FFA might, though, and mods that were originally written for 1.1 or 1.2 would.
Logged

Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« Reply #4 on: October 29, 2009, 03:50:12 PM »

I'm using the cod 5 parser, and i'm using the latest version of b3.I'm running openwarfare mod 1.63
Thank you, for the help with setting the warnings public but i still have a problem with the spectator warnings.
Logged
Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« Reply #5 on: October 29, 2009, 09:40:31 PM »

Also i just noticed it warns you if you kill yourself. I run a tactical realism server and i have friendly fire on including killing yourself with your own bettie, and it warns you for tk'ing yourself. Anyone got away around this or have any ideas as to why?
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 #6 on: October 30, 2009, 12:17:49 AM »

Is this issue also happening on non-modded servers? Because the parser explicitly looks if the client slot of the attacker is the same as the victims, if so, it is returned as a suicide event, not a teamkill.
Logged

B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #7 on: October 30, 2009, 01:54:53 AM »

ah, you never included my patch Wink

On cod4, and probably cod5, for suicides it just reports the kill as having an acid of -1. I spent a couple of evenings working that one out.

Here's the whole cod4 parser (not cod5), with my modifications. It's a bit old, though I don't think it's been updated for a while.

Note the new regexp and the change to the suicide code.
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

# v1.1.5  : Bakes - Improved suicide code, now works with weapon suicides, not falling.





__author__  = 'ThorN, xlr8or'

__version__ = '1.1.5'



import b3.parsers.cod2

import b3.parsers.q3a

import b3.functions

import re

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)





    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:

            # make a new client

            if self.PunkBuster:

                guid = codguid

                pbid = codguid

            else:

                guid = codguid



            sp = self.connectClient(cid)

            if sp and self.PunkBuster:

                if not sp['pbid']:

                    self.debug('PunkBuster is enabled in b3.xml, yet I cannot retrieve the PunkBuster Guid. Are you sure PB is enabled?')

                #self.debug('sp: %s' % sp)

                if len(guid) < 32:

                    guid = sp['guid']

                if len(pbid) < 32:

                    pbid = sp['pbid']

                ip = sp['ip']

            elif sp:

                if not codguid:

                    self.error('No CodGuid and no PunkBuster... cannot continue!')

                    return None

                else:

                    if len(guid) < 32:

                        guid = sp['guid']

                    ip = sp['ip']

            else:

                ip = ''



            if len(guid) < 32:

                # break it of, we can't get a valid 32 character guid, attempt to join on a future event.

                self.debug('Ignoring Client! guid: %s (%s), ip: %s' %(guid, len(guid), ip) )

                return None

            else:

                self.debug('guid: %s (%s), ip: %s' %(guid, len(guid), ip) )

           

            client = self.clients.newClient(match.group('cid'), name=match.group('name'), ip=ip, state=b3.STATE_ALIVE, guid=guid, pbid=pbid)



        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 match.group('acid') == '-1':

            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
Logged

Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« Reply #8 on: October 30, 2009, 02:29:52 AM »

I haven't tried the tk plugin on any of my unmodded servers. i can set it on my ctf server and turn on ff to see if it warns while switching to spec.
Logged
Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« Reply #9 on: October 30, 2009, 02:41:32 AM »

Yes it does do it on a unmodded server aswell. when switching to spectator and if blowing yourself up with a nade.
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 #10 on: October 31, 2009, 12:58:42 AM »

@bakes: are you sure the code is not in the latest cod4 parser? Can you check? Seems version number is off, but is the code also?
Logged

B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #11 on: October 31, 2009, 03:34:09 AM »

dw, it did get pulled Smiley

CoD5 however is still wrong.
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 #12 on: October 31, 2009, 04:38:48 AM »

I fixed cod5 aswell. I will push it to my repo in a minute.
Logged

Full Member
***
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BF3
Posts: 79
Offline Offline
WWW
« Reply #13 on: October 31, 2009, 10:08:42 PM »

And this means what? are there changes i need to make to my cod5 parser or my tk_plugin?
Logged
B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #14 on: October 31, 2009, 11:41:38 PM »

update your b3 from this: http://github.com/xlr8or/big-brother-bot

Suicides should work fine then.
Logged

Tags:
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal