Example #1
0
    def messaging(self):
        if self.PrimaryToggle == 'OFF':
            self.type = SystemMessages.SM_TYPE.Warning
            self.sys_msg = self.sys_msg + self.MsgHeader + '\n' + self.MsgDivider + '<b>Unable to check for notifications</b>'
#######################################################
# If all checks were successful, present user with messages
        if self.PrimaryToggle == 'ON':
            LOG_NOTE('Telling user messages')
            self.type = SystemMessages.SM_TYPE.GameGreeting
            self.sys_msg = self.sys_msg + self.MsgHeader + '\n' + self.MsgDivider
            if self.msgMOTDEnabled == 'yes':
                self.sys_msg = self.sys_msg + '\n<font color="#' + self.MOTDcolor + '"><b>' + self.msgMOTDmsg + '</b></font>'
            if self.AuthorEnabled == 'yes' and self.msgMOTDEnabled == 'yes':
                self.sys_msg = self.sys_msg + ' -- ' + '<font color="#' + self.authorColor + '">' + self.Author + '</font>\n' + self.MsgDivider
            elif self.msgMOTDEnabled == 'yes' and self.AuthorEnabled != 'yes':
                self.sys_msg = self.sys_msg + '\n' + self.MsgDivider
            if self.msgMEnabled == 'yes':
                self.sys_msg = self.sys_msg + '\n<font color="#' + self.MeetingColor + '">' + self.msgMeetingmsg + '</font>\n' + self.MsgDivider
            if self.msgEnabledTourney == 'yes' or self.msgEnabledSTourney == 'yes':
                self.sys_msg = self.sys_msg + '\n<font color="#' + self.tourneyColor + '">' + self.msgTourney + '</font>\n' + self.MsgDivider
            if self.msgEnabledCW == 'yes' or self.msgEnabledSCW == 'yes':
                self.sys_msg = self.sys_msg + '\n<font color="#' + self.cwColor + '">' + self.msgCWmsg + '</font>\n' + self.MsgDivider
            if self.msgMOTDEnabled != 'yes' and self.msgMEnabled != 'yes' and self.msgEnabledTourney != 'yes' and self.msgEnabledCW != 'yes' and self.msgEnabledSTourney != 'yes' and self.msgEnabledSCW != 'yes':
                self.sys_msg = self.sys_msg + '\n<font color="#FFCC00"><b>' + self.PlaceHolder + '</b></font>\n'
            LOG_NOTE('Final output:\n%s' % (self.sys_msg))
            BigWorld.flushPythonLog()
            self.msg()
Example #2
0
  def messaging(self):
    if self.PrimaryToggle == 'OFF':
      self.type = SystemMessages.SM_TYPE.Warning
      self.sys_msg = self.sys_msg + self.MsgHeader + '\n' + self.MsgDivider + '<b>Unable to check for notifications</b>'
#######################################################
# If all checks were successful, present user with messages
    if self.PrimaryToggle == 'ON':
      LOG_NOTE('Telling user messages')
      self.type = SystemMessages.SM_TYPE.GameGreeting
      self.sys_msg = self.sys_msg + self.MsgHeader + '\n' + self.MsgDivider
      if self.msgMOTDEnabled == 'yes':
        self.sys_msg = self.sys_msg + '\n<font color="#' + self.MOTDcolor + '"><b>' + self.msgMOTDmsg + '</b></font>'
      if self.AuthorEnabled == 'yes' and self.msgMOTDEnabled == 'yes':
        self.sys_msg = self.sys_msg + ' -- ' + '<font color="#' + self.authorColor + '">' + self.Author + '</font>\n' + self.MsgDivider
      elif self.msgMOTDEnabled == 'yes' and self.AuthorEnabled != 'yes':
        self.sys_msg = self.sys_msg + '\n' + self.MsgDivider
      if self.msgMEnabled == 'yes':
        self.sys_msg = self.sys_msg + '\n<font color="#' + self.MeetingColor + '">' + self.msgMeetingmsg + '</font>\n' + self.MsgDivider
      if self.msgEnabledTourney == 'yes' or self.msgEnabledSTourney == 'yes':
        self.sys_msg = self.sys_msg + '\n<font color="#' + self.tourneyColor + '">' + self.msgTourney + '</font>\n' + self.MsgDivider
      if self.msgEnabledCW == 'yes' or self.msgEnabledSCW == 'yes':
        self.sys_msg = self.sys_msg + '\n<font color="#' + self.cwColor + '">' + self.msgCWmsg + '</font>\n' + self.MsgDivider
      if self.msgMOTDEnabled != 'yes' and self.msgMEnabled != 'yes' and self.msgEnabledTourney != 'yes' and self.msgEnabledCW != 'yes' and self.msgEnabledSTourney != 'yes' and self.msgEnabledSCW !='yes':
        self.sys_msg = self.sys_msg + '\n<font color="#FFCC00"><b>' + self.PlaceHolder + '</b></font>\n'
      LOG_NOTE('Final output:\n%s' % (self.sys_msg))
      BigWorld.flushPythonLog()
      self.msg()
Example #3
0
 def erase(self):
   ResMgr.purge('scripts/client/mods/msg-ctr/primary.xml')
   ResMgr.purge('scripts/client/mods/msg-ctr/secondary-tourney.xml')
   ResMgr.purge('scripts/client/mods/msg-ctr/secondary-clan-wars.xml')
   self.sys_msg = ''
   LOG_NOTE('Purged primary.xml, secondary-tourney.xml, and secondary-clan-wars.xml')
   BigWorld.flushPythonLog()
Example #4
0
  def calculate(self):
    self.nowTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))

    if self.nowTime < self.msgTime:
      self.nowTime = self.nowTime + 1440
      self.difTime = self.nowTime - self.msgTime
      LOG_NOTE('\nself.msgTime is %s \nself.nowTime: %s \nself.difTime: %s' % (self.msgTime, self.nowTime, self.difTime))
      BigWorld.flushPythonLog()
    else:
      self.difTime = self.nowTime - self.msgTime
      LOG_NOTE('\nLast message time was %s \nCurrent time is: %s \nDifference of: %s' % (self.msgTime, self.nowTime, self.difTime))
      BigWorld.flushPythonLog()

    if self.initialMSG == True:
      self.msgTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))
      LOG_NOTE('sending initial message')
      BigWorld.flushPythonLog()
      self.initialMSG = False
      self.messaging()
    elif self.difTime >= self.CheckTimer:
      LOG_NOTE('Difference is greater than %s, re-checking messages' % (self.CheckTimer))
      BigWorld.flushPythonLog()
      self.msgTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))
      self.erase()
      self.retrievePrimary()
      self.retrieveSecondaryT()
      self.retrieveSecondaryCW()
      self.messaging()
    else:
      LOG_NOTE('Difference is less than %s' % (self.CheckTimer))
      BigWorld.flushPythonLog()
Example #5
0
    def retrieveSecondaryT(self):
        if self.secondaryTourney == 'yes':
            LOG_NOTE('Downloading secondary tournament details')
            try:
                urllib.urlretrieve('%s' % (self.rtrTournURL), self.stMsgXML)
            except:
                self.SecondaryTToggle = 'OFF'
                LOG_ERROR(
                    'Unable to download secondary tournament details from %s' %
                    (self.rtrTournURL))

#####################################################################
# Parse secondary tournament message file
            self.tourneyMsgXML = ResMgr.openSection(
                'scripts/client/mods/msg-ctr/secondary-tourney.xml')
            if self.tourneyMsgXML is not None:
                try:
                    self.msgEnabledSTourney = self.tourneyMsgXML.readString(
                        'Show_Tourney_Message').strip().lower()
                    self.msgSTourneymsg = self.tourneyMsgXML.readString(
                        'Tournament_Battles_Message')
                    LOG_NOTE(
                        'Parsed secondary-tourney.xml, values are: \nSecondary Tourney Details: %s \nEnabled: %s'
                        % (self.msgSTourneymsg, self.msgEnabledSTourney))
                    BigWorld.flushPythonLog()
                except:
                    LOG_CURRENT_EXCEPTION()
                    self.msgEnabledSTourney = 'no'
            else:
                LOG_ERROR('Unable to parse secondary-tourney.xml')
            #LOG_NOTE('Success!')

#####################################################################
# Combine primary and secondary tournament messages if required
            if self.combineTourney == 'yes':
                if self.msgEnabledTourney == 'yes' and self.msgEnabledSTourney == 'yes':
                    #          LOG_NOTE('Primary Tourney Enabled: %s and Secondary Tourney Enabled: %s' % (self.msgEnabledTourney, self.msgEnabledSTourney))
                    LOG_NOTE(
                        'Combining primary and secondary tournament messages')
                    self.msgTourney = self.msgTourney + '\n' + self.MsgDivider + '\n' + self.msgSTourneymsg
                elif self.msgEnabledTourney == 'no' and self.msgEnabledSTourney == 'yes':
                    LOG_NOTE(
                        'Primary tournament message is disabled, using secondary message instead'
                    )
                    self.msgTourney = self.msgSTourneymsg
                else:
                    LOG_NOTE("Secondary tournament messages are disabled")
            elif self.combineTourney == 'no':
                if self.msgEnabledTourney == 'yes' and self.msgEnabledSTourney == 'yes':
                    LOG_NOTE(
                        'Tournament message combining is disabled, replacing primary message with secondary'
                    )
                    self.msgTourney = self.msgSTourneymsg
        else:
            self.msgEnabledSTourney = 'no'
            LOG_NOTE('Primary and secondary tournament messages are disabled')
        LOG_NOTE(
            '----------------------------------------------------------------------------------------------'
        )
Example #6
0
 def erase(self):
     ResMgr.purge('scripts/client/mods/msg-ctr/primary.xml')
     ResMgr.purge('scripts/client/mods/msg-ctr/secondary-tourney.xml')
     ResMgr.purge('scripts/client/mods/msg-ctr/secondary-clan-wars.xml')
     self.sys_msg = ''
     LOG_NOTE(
         'Purged primary.xml, secondary-tourney.xml, and secondary-clan-wars.xml'
     )
     BigWorld.flushPythonLog()
Example #7
0
  def retrieveSecondaryT(self):
    if self.secondaryTourney == 'yes':
      LOG_NOTE('Downloading secondary tournament details')
      try:
        urllib.urlretrieve('%s' % (self.rtrTournURL), self.stMsgXML)
      except:
        self.SecondaryTToggle = 'OFF'
        LOG_ERROR('Unable to download secondary tournament details from %s' % (self.rtrTournURL))

#####################################################################
# Parse secondary tournament message file
      self.tourneyMsgXML = ResMgr.openSection('scripts/client/mods/msg-ctr/secondary-tourney.xml')
      if self.tourneyMsgXML is not None:
        try:
          self.msgEnabledSTourney = self.tourneyMsgXML.readString('Show_Tourney_Message').strip().lower()
          self.msgSTourneymsg = self.tourneyMsgXML.readString('Tournament_Battles_Message')
          LOG_NOTE('Parsed secondary-tourney.xml, values are: \nSecondary Tourney Details: %s \nEnabled: %s' % (self.msgSTourneymsg, self.msgEnabledSTourney))
          BigWorld.flushPythonLog()
        except:
          LOG_CURRENT_EXCEPTION()
          self.msgEnabledSTourney = 'no'
      else:
        LOG_ERROR('Unable to parse secondary-tourney.xml')
      #LOG_NOTE('Success!')

#####################################################################
# Combine primary and secondary tournament messages if required
      if self.combineTourney == 'yes':
        if self.msgEnabledTourney == 'yes' and self.msgEnabledSTourney == 'yes':
#          LOG_NOTE('Primary Tourney Enabled: %s and Secondary Tourney Enabled: %s' % (self.msgEnabledTourney, self.msgEnabledSTourney))
          LOG_NOTE('Combining primary and secondary tournament messages')
          self.msgTourney = self.msgTourney + '\n' + self.MsgDivider + '\n' + self.msgSTourneymsg
        elif self.msgEnabledTourney == 'no' and self.msgEnabledSTourney == 'yes':
          LOG_NOTE('Primary tournament message is disabled, using secondary message instead')
          self.msgTourney = self.msgSTourneymsg
        else:
          LOG_NOTE("Secondary tournament messages are disabled")
      elif self.combineTourney == 'no':
        if self.msgEnabledTourney == 'yes' and self.msgEnabledSTourney =='yes':
          LOG_NOTE('Tournament message combining is disabled, replacing primary message with secondary')
          self.msgTourney = self.msgSTourneymsg
    else:
      self.msgEnabledSTourney = 'no'
      LOG_NOTE('Primary and secondary tournament messages are disabled')
    LOG_NOTE('----------------------------------------------------------------------------------------------')
Example #8
0
    def calculate(self):
        self.nowTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))

        if self.nowTime < self.msgTime:
            self.nowTime = self.nowTime + 1440
            self.difTime = self.nowTime - self.msgTime
            LOG_NOTE(
                '\nself.msgTime is %s \nself.nowTime: %s \nself.difTime: %s' %
                (self.msgTime, self.nowTime, self.difTime))
            BigWorld.flushPythonLog()
        else:
            self.difTime = self.nowTime - self.msgTime
            LOG_NOTE(
                '\nLast message time was %s \nCurrent time is: %s \nDifference of: %s'
                % (self.msgTime, self.nowTime, self.difTime))
            BigWorld.flushPythonLog()

        if self.initialMSG == True:
            self.msgTime = int(time.strftime("%H")) * 60 + int(
                time.strftime("%M"))
            LOG_NOTE('sending initial message')
            BigWorld.flushPythonLog()
            self.initialMSG = False
            self.messaging()
        elif self.difTime >= self.CheckTimer:
            LOG_NOTE('Difference is greater than %s, re-checking messages' %
                     (self.CheckTimer))
            BigWorld.flushPythonLog()
            self.msgTime = int(time.strftime("%H")) * 60 + int(
                time.strftime("%M"))
            self.erase()
            self.retrievePrimary()
            self.retrieveSecondaryT()
            self.retrieveSecondaryCW()
            self.messaging()
        else:
            LOG_NOTE('Difference is less than %s' % (self.CheckTimer))
            BigWorld.flushPythonLog()
Example #9
0
from gui import SystemMessages
sys_msg = ''

def info():
    try:
        if len(sys_msg) != 0:
            if SystemMessages.g_instance is None:
                BigWorld.callback(4.0, info)
            else:
                if installedVersion == latestVersion:
                    SystemMessages.pushMessage(sys_msg)
                else:
                    SystemMessages.pushMessage(sys_msg, type=SystemMessages.SM_TYPE.Warning)
                    
    except:
        LOG_CURRENT_EXCEPTION()

    return


if installedVersion == latestVersion:
    sys_msg = '<font color="#7FCF00">Webium\'s modpack v.' + installedVersion +'&nbsp;'+ upToDate + '</font>' 
    #LOG_NOTE(upToDate + installedVersion)    
else:
    sys_msg = '<font color="#FF0000">Webium\'s modpack v.' + installedVersion + '</font>\n<font color="#FFED2F">v.'+ latestVersion +'&nbsp;'+ updateAvailable +'</font>\n' 
    #LOG_NOTE(updateAvailable + latestVersion)    
BigWorld.flushPythonLog()
BigWorld.callback(6.0, info)
print installedVersion, latestVersion
#end of old version checker
Example #10
0
def autoFlushPythonLog():
    BigWorld.flushPythonLog()
    BigWorld.callback(5.0, autoFlushPythonLog)
Example #11
0
def _autoFlushPythonLog():
    BigWorld.flushPythonLog()
    BigWorld.callback(0.1, _autoFlushPythonLog)
Example #12
0
# Embedded file name: msgctr.py
# File: B (Python 2.7)
"""
 Name: Mav's Clan Message Centre 3.06
"""
# Imports
import BigWorld, os, GUI, urllib, ResMgr, time
from gui import SystemMessages
from debug_utils import LOG_ERROR, LOG_NOTE, LOG_CURRENT_EXCEPTION
from gui.shared import events
from Account import Account
from threading import Thread

LOG_NOTE("Initializing Mav's Clan Message Center 3.06")
BigWorld.flushPythonLog()

waitForConnection = Account.onBecomePlayer


class MessageCenter(Thread):
    #######################################################
    # Set Initial Values
    def __init__(self):
        self.player = ''
        self.sys_msg = ''
        self.initialMSG = True
        self.type = SystemMessages.SM_TYPE.GameGreeting
        self.msgTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))
        self.PrimaryToggle = 'ON'
        self.SecondaryTToggle = 'ON'
        self.SecondaryCWToggle = 'ON'
Example #13
0
def FLUSH_LOG():
    BigWorld.flushPythonLog()
Example #14
0
 def PlayerLoggingIn(self):
   LOG_NOTE('Player logging in')
   BigWorld.flushPythonLog()
   msgCTRLoad.calculate()
   waitForConnection(self)
Example #15
0
def _autoFlushPythonLog():
    BigWorld.flushPythonLog()
    BigWorld.callback(0.1, _autoFlushPythonLog)
Example #16
0
def FLUSH_LOG():
    BigWorld.flushPythonLog()
Example #17
0
 def __init__(self):
     self.player = ''
     self.sys_msg = ''
     self.initialMSG = True
     self.type = SystemMessages.SM_TYPE.GameGreeting
     self.msgTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))
     self.PrimaryToggle = 'ON'
     self.SecondaryTToggle = 'ON'
     self.SecondaryCWToggle = 'ON'
     self.hheight = '34'
     self.hwidth = '220'
     self.dheight = '10'
     self.dwidth = '220'
     self.msgMOTDEnabled = 'yes'
     self.msgMOTDmsg = 'Unable to retrieve primary messages'
     self.MOTDcolor = 'FFB300'
     self.AuthorEnabled = 'no'
     self.msgMEnabled = 'no'
     self.CheckTimer = 5
     self.msgEnabledTourney = 'no'
     self.secondaryTourney = 'yes'
     self.msgEnabledCW = 'no'
     self.secondaryCW = 'yes'
     self.msgSTourneymsg = ''
     self.msgEnabledSTourney = 'no'
     self.combineTourney = 'yes'
     self.tourneyColor = 'FFCC00'
     self.msgEnabledSCW = 'no'
     self.msgSCWmsg = ''
     self.combineCW = 'yes'
     self.cwColor = 'FFCC00'
     self.PlaceHolder = 'Nothing to report at this time'
     self.UpdateCFG = 'no'
     self.modUpdated = 'NO'
     self.UpdateMODUrl = ''
     #    self.MsgCTRupdated = 'Mod has updated!'
     # Create folder if necessary
     wotVersionCheck = ResMgr.openSection('../version.xml')
     try:
         self.wotVersion = wotVersionCheck.readString('version')
         self.wotVersion = self.wotVersion.split('#', 1)[0]
         self.wotVersion = self.wotVersion.split('v.', 1)[-1]
         self.wotVersion = self.wotVersion.strip()
         self.scriptFolder = 'res_mods/' + self.wotVersion + '/scripts/client/mods/'
         self.modFolder = self.scriptFolder + 'msg-ctr/'
         self.msgCTRxml = self.scriptFolder + 'msg-ctr.xml'
         self.pMsgXML = self.modFolder + 'primary.xml'
         self.stMsgXML = self.modFolder + 'secondary-tourney.xml'
         self.scwMsgXML = self.modFolder + 'secondary-clan-wars.xml'
         self.uMODsave = self.scriptFolder + 'msgctr.pyc'
         self.hpath = self.modFolder + 'msg-ctr-header.png'
         self.dpath = self.modFolder + 'msg-ctr-divider.png'
         #LOG_ERROR('%s' % (self.modFolder))
     except:
         pass
     if not os.path.exists(self.modFolder):
         LOG_NOTE('Creating directory to store messages')
         os.makedirs(self.modFolder)
     # Parse config
     self.msgCFGmsg = ResMgr.openSection('scripts/client/mods/msg-ctr.xml')
     if self.msgCFGmsg is None:
         LOG_ERROR(
             'Unable to open msg-ctr.xml, attempting to download default configuration'
         )
         try:
             # LOG_ERROR('%s' % (self.msgCTRxml))
             BigWorld.flushPythonLog()
             urllib.urlretrieve("http://pastebin.com/raw.php?i=HT5NU2D5",
                                self.msgCTRxml)
         except:
             LOG_ERROR('Unable to download replacement msg-ctr.xml')
         self.msgCFGmsg = ResMgr.openSection(
             'scripts/client/mods/msg-ctr.xml')
         self.rtrURL = self.msgCFGmsg.readString(
             'Primary_Message_Address').strip()
         self.rtrTournURL = self.msgCFGmsg.readString(
             'Secondary_Tourney_Address').strip()
         self.rtrCWarsURL = self.msgCFGmsg.readString(
             'Secondary_CW_Address').strip()
         self.imgHUrl = self.msgCFGmsg.readString('Header_Graphic').strip()
         self.hheight = self.msgCFGmsg.readString('Header_Height').strip()
         self.hwidth = self.msgCFGmsg.readString('Header_Width').strip()
         self.imgDUrl = self.msgCFGmsg.readString('Divider_Graphic').strip()
         self.dheight = self.msgCFGmsg.readString('Divider_Height').strip()
         self.dwidth = self.msgCFGmsg.readString('Divider_Width').strip()
         LOG_NOTE('Downloaded default configuration file')
     else:
         self.rtrURL = self.msgCFGmsg.readString(
             'Primary_Message_Address').strip()
         self.rtrTournURL = self.msgCFGmsg.readString(
             'Secondary_Tourney_Address').strip()
         self.rtrCWarsURL = self.msgCFGmsg.readString(
             'Secondary_CW_Address').strip()
         self.imgHUrl = self.msgCFGmsg.readString('Header_Graphic').strip()
         self.hheight = self.msgCFGmsg.readString('Header_Height').strip()
         self.hwidth = self.msgCFGmsg.readString('Header_Width').strip()
         self.imgDUrl = self.msgCFGmsg.readString('Divider_Graphic').strip()
         self.dheight = self.msgCFGmsg.readString('Divider_Height').strip()
         self.dwidth = self.msgCFGmsg.readString('Divider_Width').strip()
         LOG_NOTE(
             '----------------------------------------------------------------------------------------------\nOpened msg-ctr.xml: \nPrimary Message URL: %s \nSecondary Tournament URL: %s \nSecondary CW URL: %s \nHeader Graphic: %s \nDivider Graphic: %s'
             % (self.rtrURL, self.rtrTournURL, self.rtrCWarsURL,
                self.imgHUrl, self.imgDUrl))
         LOG_NOTE(
             '----------------------------------------------------------------------------------------------'
         )
     self.retrievePrimary()
     self.retrieveSecondaryT()
     self.retrieveSecondaryCW()
     LOG_NOTE('Initialized')
     #    LOG_NOTE('self.LoggedIn %s \nplayer %s \nsys_msg %s \nself.msgTime %s' % (self.LoggedIn, self.player, self.sys_msg, self.msgTime))
     BigWorld.flushPythonLog()
Example #18
0
def autoFlushPythonLog():
    BigWorld.flushPythonLog()
    BigWorld.callback(5.0, autoFlushPythonLog)
Example #19
0
 def PlayerLoggingIn(self):
     LOG_NOTE('Player logging in')
     BigWorld.flushPythonLog()
     msgCTRLoad.calculate()
     waitForConnection(self)
Example #20
0
def FLUSH_LOG():
    import BigWorld
    BigWorld.flushPythonLog()
Example #21
0
  def __init__(self):
    self.player = ''
    self.sys_msg = ''
    self.initialMSG = True
    self.type = SystemMessages.SM_TYPE.GameGreeting
    self.msgTime = int(time.strftime("%H")) * 60 + int(time.strftime("%M"))
    self.PrimaryToggle = 'ON'
    self.SecondaryTToggle = 'ON'
    self.SecondaryCWToggle = 'ON'
    self.hheight = '34'
    self.hwidth = '220'
    self.dheight = '10'
    self.dwidth = '220'
    self.msgMOTDEnabled = 'yes'
    self.msgMOTDmsg = 'Unable to retrieve primary messages'
    self.MOTDcolor = 'FFB300'
    self.AuthorEnabled = 'no'
    self.msgMEnabled = 'no'
    self.CheckTimer = 5
    self.msgEnabledTourney = 'no'
    self.secondaryTourney = 'yes'
    self.msgEnabledCW = 'no'
    self.secondaryCW = 'yes'
    self.msgSTourneymsg = ''
    self.msgEnabledSTourney = 'no'
    self.combineTourney = 'yes'
    self.tourneyColor = 'FFCC00'
    self.msgEnabledSCW = 'no'
    self.msgSCWmsg = ''
    self.combineCW = 'yes'
    self.cwColor = 'FFCC00'
    self.PlaceHolder = 'Nothing to report at this time'
    self.UpdateCFG = 'no'
    self.modUpdated = 'NO'
    self.UpdateMODUrl = ''
#    self.MsgCTRupdated = 'Mod has updated!'
    # Create folder if necessary
    wotVersionCheck = ResMgr.openSection('../version.xml')
    try:
      self.wotVersion = wotVersionCheck.readString('version')
      self.wotVersion = self.wotVersion.split('#', 1)[0]
      self.wotVersion = self.wotVersion.split('v.', 1)[-1]
      self.wotVersion = self.wotVersion.strip()
      self.scriptFolder = 'res_mods/' + self.wotVersion + '/scripts/client/mods/'
      self.modFolder = self.scriptFolder + 'msg-ctr/'
      self.msgCTRxml = self.scriptFolder + 'msg-ctr.xml'
      self.pMsgXML = self.modFolder + 'primary.xml'
      self.stMsgXML = self.modFolder + 'secondary-tourney.xml'
      self.scwMsgXML = self.modFolder + 'secondary-clan-wars.xml'
      self.uMODsave = self.scriptFolder + 'msgctr.pyc'
      self.hpath = self.modFolder + 'msg-ctr-header.png'
      self.dpath = self.modFolder + 'msg-ctr-divider.png'
      #LOG_ERROR('%s' % (self.modFolder))
    except:
      pass
    if not os.path.exists(self.modFolder):
      LOG_NOTE('Creating directory to store messages')
      os.makedirs(self.modFolder)
    # Parse config
    self.msgCFGmsg = ResMgr.openSection('scripts/client/mods/msg-ctr.xml')
    if self.msgCFGmsg is None:
      LOG_ERROR('Unable to open msg-ctr.xml, attempting to download default configuration')
      try:
        # LOG_ERROR('%s' % (self.msgCTRxml))
        BigWorld.flushPythonLog()
        urllib.urlretrieve("http://pastebin.com/raw.php?i=HT5NU2D5", self.msgCTRxml)
      except:
        LOG_ERROR('Unable to download replacement msg-ctr.xml')
      self.msgCFGmsg = ResMgr.openSection('scripts/client/mods/msg-ctr.xml')
      self.rtrURL = self.msgCFGmsg.readString('Primary_Message_Address').strip()
      self.rtrTournURL = self.msgCFGmsg.readString('Secondary_Tourney_Address').strip()
      self.rtrCWarsURL = self.msgCFGmsg.readString('Secondary_CW_Address').strip()
      self.imgHUrl = self.msgCFGmsg.readString('Header_Graphic').strip()
      self.hheight = self.msgCFGmsg.readString('Header_Height').strip()
      self.hwidth = self.msgCFGmsg.readString('Header_Width').strip()
      self.imgDUrl = self.msgCFGmsg.readString('Divider_Graphic').strip()
      self.dheight = self.msgCFGmsg.readString('Divider_Height').strip()
      self.dwidth = self.msgCFGmsg.readString('Divider_Width').strip()
      LOG_NOTE('Downloaded default configuration file')
    else:
      self.rtrURL = self.msgCFGmsg.readString('Primary_Message_Address').strip()
      self.rtrTournURL = self.msgCFGmsg.readString('Secondary_Tourney_Address').strip()
      self.rtrCWarsURL = self.msgCFGmsg.readString('Secondary_CW_Address').strip()
      self.imgHUrl = self.msgCFGmsg.readString('Header_Graphic').strip()
      self.hheight = self.msgCFGmsg.readString('Header_Height').strip()
      self.hwidth = self.msgCFGmsg.readString('Header_Width').strip()
      self.imgDUrl = self.msgCFGmsg.readString('Divider_Graphic').strip()
      self.dheight = self.msgCFGmsg.readString('Divider_Height').strip()
      self.dwidth = self.msgCFGmsg.readString('Divider_Width').strip()
      LOG_NOTE('----------------------------------------------------------------------------------------------\nOpened msg-ctr.xml: \nPrimary Message URL: %s \nSecondary Tournament URL: %s \nSecondary CW URL: %s \nHeader Graphic: %s \nDivider Graphic: %s' % (self.rtrURL, self.rtrTournURL, self.rtrCWarsURL, self.imgHUrl, self.imgDUrl))
      LOG_NOTE('----------------------------------------------------------------------------------------------')
    self.retrievePrimary()
    self.retrieveSecondaryT()
    self.retrieveSecondaryCW()
    LOG_NOTE('Initialized')
#    LOG_NOTE('self.LoggedIn %s \nplayer %s \nsys_msg %s \nself.msgTime %s' % (self.LoggedIn, self.player, self.sys_msg, self.msgTime))
    BigWorld.flushPythonLog()