def onEvent(self, event):
     """
     Handle intercepted events
     """
     if event.type == self.console.getEventID('EVT_CLIENT_RADIO'):
         self.onRadio(event)
     else:
         Poweradminurt41Plugin.onEvent(self, event)
示例#2
0
 def __new__(cls, *args, **kwargs):
     console, plugin_config = args
     if console.gameName == 'iourt41':
         from poweradminurt.iourt41 import Poweradminurt41Plugin
         return Poweradminurt41Plugin(*args, **kwargs)
     elif console.gameName == 'iourt42':
         from poweradminurt.iourt42 import Poweradminurt42Plugin
         return Poweradminurt42Plugin(*args, **kwargs)
     else:
         raise AssertionError(
             "Poweradminurt plugin can only work with Urban Terror 4.1 or 4.2"
         )
 def onStartup(self):
     """
     Initialize plugin settings
     """
     Poweradminurt41Plugin.onStartup(self)
     self._gears['reset'] = self.console.getCvar('g_gear').getString()
 def onLoadConfig(self):
     """
     Load plugin configuration
     """
     Poweradminurt41Plugin.onLoadConfig(self)
     self.loadRadioSpamProtection()
 def registerEvents(self):
     """
     Register events needed
     """
     Poweradminurt41Plugin.registerEvents(self)
     self.registerEvent(self.console.getEventID('EVT_CLIENT_RADIO'))
 def onLoadConfig(self):
     Poweradminurt41Plugin.onLoadConfig(self)
     self.LoadRadioSpamProtection()
 def registerEvents(self):
     Poweradminurt41Plugin.registerEvents(self)
     self.registerEvent(self.console.EVT_CLIENT_RADIO)