You are here: Big Brother Bot ForumAdd-OnsConfigurations (Moderator: MordyT)Map command
Pages: [1]   Go Down
  Print  
Author Topic: Map command  (Read 1364 times) Bookmark and Share
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 104
Offline Offline
WWW
« on: January 11, 2011, 09:43:43 AM »

Hi,

I found a bug in CoD4, however it is easy to solve this issue via B3  Grin
The bug is as following: if you type: !map killhouse in the chat, the server will change the map to killhouse (WITHOUT mp_ in the front).
This will cause an infinity loop on the Call of Duty 4 server, so it kinda crash. Strange enough it's only with the map Killhouse. I know of source the normal way to use it is: !map mp_killhouse, but sometimes people forgot it to use mp_.

Here is the fix...
I added maplist.txt in the conf folder. So it checks every input and compares it with the maplist. If the map is found it returns TRUE and the map will be changed.

plugin_admin.xml
find:
Code:
<settings name="settings">
add below:
Code: xml
		@b3/conf/maplist.txt

admin.py
find:
Code: python
_long_tempban_max_duration = 1440 # 60m/h x 24h = 1440m = 1d

Add below:
Code: perl
    _mapList = []

Same file, find:
self.verbose('SuperAdmin(s) found, no need for !iamgod')

Add below:
Code: python
            f = open(self.config.getpath('settings',  'mapfile'))
           for line in f:
               self._mapList.append(line.strip())

Same file, find:
Code: python
def cmd_map(self, data, client, cmd=None):

Add before:
Code: python
        def check_map(self, data, client):
       m = self.parseUserCmd(data)
       if not m:
           client.message('^7Invalid parameters')
           return False
       if not m[0]:
           client.message('^7You must supply a map to change to.')
           return False

       s = m[0]
       matched = False

       for map in self._mapList:
           if s == map:
               if matched:
                   client.message('^7More than one map matches the name, be more specific')
                   return False
               matched = True

       if not matched:
           client.message('^7No map matched that name')
       return matched

Same file, find:
Code: python
 - switch current map
       """

Add below:
Code: python
        if not self.check_map(data,  client):
return False


I hope you will apply this patch.
Beside this I found another bug, this time in B3 itself. It's about the vote plugin, which is still in alfa/beta stage but oké. Find:
Code: python
if s is map:
replace to
Code: python
if s == map:
.

Thanks!

Kind regards,
Melroy van den Berg

Attachment:
-maplist.txt

[attachment deleted by maintenance]
« Last Edit: January 11, 2011, 09:54:05 AM by danger89 » Logged

JoinMyServer.com
Call of Duty 4 Game Servers

Tags: map  !map  killhouse  crash  bug 
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal