Example #1
0
 def _getNameParts(self, gender):
     if TTPickANamePattern.NameParts is None:
         TTPickANamePattern.NameParts = {}
         ng = NameGenerator()
         TTPickANamePattern.NameParts['m'] = ng.getMaleNameParts()
         TTPickANamePattern.NameParts['f'] = ng.getFemaleNameParts()
     return TTPickANamePattern.NameParts[gender]
Example #2
0
 def _getNameParts(self, gender):
     if TTPickANamePattern.NameParts is None:
         TTPickANamePattern.NameParts = {}
         ng = NameGenerator()
         TTPickANamePattern.NameParts['m'] = ng.getMaleNameParts()
         TTPickANamePattern.NameParts['f'] = ng.getFemaleNameParts()
     return TTPickANamePattern.NameParts[gender]
Example #3
0
    def _getLastNameCapPrefixes(self):
        if TTPickANamePattern.LastNamePrefixesCapped is None:
            ng = NameGenerator()
            TTPickANamePattern.LastNamePrefixesCapped = ng.getLastNamePrefixesCapped(
            )[:]

        return TTPickANamePattern.LastNamePrefixesCapped
Example #4
0
    def _getNameParts(self, gender):
        if TTPickANamePattern.NameParts is None:
            TTPickANamePattern.NameParts = {}
            ng = NameGenerator()
            TTPickANamePattern.NameParts['m'] = ng.getMaleNameParts()
            TTPickANamePattern.NameParts['f'] = ng.getFemaleNameParts()

        # make sure the dicts haven't been inverted
        assert type(TTPickANamePattern.NameParts[gender][0].keys()[0]) is types.StringType

        return TTPickANamePattern.NameParts[gender]
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Instantiate our account DB interface using config:
        dbtype = config.GetString('accountdb-type', 'local')
        if dbtype == 'local':
            self.accountDB = LocalAccountDB(self)
        elif dbtype == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid account DB type configured: %s' %
                              dbtype)

        # Listen out for any accounts that disconnect.
        #self.air.netMessenger.accept('accountDisconnected', self, self.__accountDisconnected)

        # This attribute determines if we want to disable logins.
        self.loginsEnabled = True
        # Listen out for any messages that tell us to disable logins.
        self.air.netMessenger.accept('enableLogins', self,
                                     self.setLoginEnabled)
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Temporary HMAC key:
        self.key = 'bWlub3Iub3BlbmFsLmZpeC5zdGFydC5vZi5oZWFsam9rZXM='

        # Instantiate our account DB interface:
        if accountdbType == 'developer':
            self.accountDB = DeveloperAccountDB(self)
        elif accountdbType == 'local':
            self.accountDB = LocalAccountDB(self)
        elif accountdbType == 'production':
            self.accountDB = ProductionDB(self)
        else:
            self.notify.error('Invalid accountdb-type: ' + accountdbType)
Example #7
0
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}
        self.sessionKey = '4ZHk9Gu3zBURVTdZUjpCDx1IS8GdhuOjg67IQQSpZsE='

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Setup ban manager
        self.banManager = BanManagerUD(self.air)
        self.banManager.setup()

        # Instantiate our account DB interface using config:
        dbtype = config.GetString('accountdb-type', 'local')
        if dbtype == 'local':
            self.accountDB = LocalAccountDB(self)
        elif dbtype == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid account DB type configured: %s' %
                              dbtype)

        # This attribute determines if we want to disable logins.
        self.loginsEnabled = True
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Temporary HMAC key:
        self.key = 'bG9sLndlLmNoYW5nZS50aGlzLnRvby5tdWNo'

        # Instantiate our account DB interface:
        if accountDBType == 'developer':
            self.accountDB = DeveloperAccountDB(self)
        elif accountDBType == 'local':
            self.accountDB = LocalAccountDB(self)
        elif accountDBType == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid accountdb-type: ' + accountDBType)
    def __init__(self, air):
        DistributedObjectGlobalUD.__init__(self, air)

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Temporary HMAC key:
        self.key = 'VhgdThjgoNI0SAbfeSjcyxo9iSyghKSh43ZMidFI'
Example #10
0
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # This is for processing name patterns.
        self.nameGenerator = NameGenerator()

        # Instantiate the account database backend.
        # TODO: In the future, add more database interfaces & make this configurable.
        self.accountDb = DeveloperAccountDB(self)
Example #11
0
    def __init__(self, air):
        DistributedObjectGlobalUD.__init__(self, air)

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Temporary HMAC key:
        self.key = 'oa1qt8fwc0r750gkse3fgt6k3scyhzptudk422u5'

        self.blacklistedHWIDs = []
 def announceGenerate(self):
     DistributedObjectGlobalUD.announceGenerate(self)
     self.connection2fsm = {}
     self.account2fsm = {}
     self.nameGenerator = NameGenerator()
     self.wantMiniServer = config.GetBool('want-mini-server', False)
     dbtype = config.GetString('accountdb-type', 'developer')
     if dbtype == 'developer':
         self.accountDB = DeveloperAccountDB(self)
     else:
         if dbtype == 'local':
             self.accountDB = LocalAccountDB(self)
         else:
             self.notify.error('Invalid account DB type configured: %s' %
                               dbtype)
     self.loginsEnabled = True
Example #13
0
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}
        try:
            self.sessionKey = open('supersecretkey.xd').read()
        except:
            self.sessionKey = 'mHHgl9VsiO6rVwv8/z3g0tkPJTev9lUjQkoBMnlt8tkgNRxdSzS/b4IFOaSTi3k9UKw8mIR7x2vFxvYB4nCRng=='

        # start the queue on a seperate thread
        threading.Thread(target=self.queue.start).start()

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Setup ban manager
        self.banManager = BanManagerUD(self.air)
        self.banManager.setup()

        # Setup Account Firewall
        self.AccountFirewallUD = AccountFirewallUD(self.air)
        self.AccountFirewallUD.setup()

        # Instantiate our account DB interface using config:
        dbtype = config.GetString('accountdb-type', 'local')
        if dbtype == 'local':
            self.accountDB = LocalAccountDB(self)
        elif dbtype == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid account DB type configured: %s' %
                              dbtype)

        # This attribute determines if we want to disable logins.
        self.loginsEnabled = True
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Instantiate our account DB interface using config:
        dbtype = simbase.config.GetString('accountdb-type', 'local')
        if dbtype == 'local':
            self.accountDB = LocalAccountDB(self)
        elif dbtype == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid account DB type configured: %s' %
                              dbtype)
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        self.connection2fsm = {}
        self.account2fsm = {}

        self.nameGenerator = NameGenerator()
        self.namePattern = NamePattern()

        accType = config.GetString('account-db-type', 'local')
        if accType == 'local':
            self.accountDB = LocalAccountDB(self)
            
        elif accType == 'server':
            self.accountDB = ServerAccountDB(self)
            
        elif accType == 'trapdoor':
            self.accountDB = TrapDoorAccountDB(self)
            self.notify.warning('Trapdoor activated!')
            
        else:
            self.notify.warning('Invalid accType %s, UD will reject all logins!' % accType)
            self.accountDB = None
Example #16
0
    def announceGenerate(self):
        DistributedObjectGlobalUD.announceGenerate(self)

        # These keep track of the connection/account IDs currently undergoing an
        # operation on the CSM. This is to prevent (hacked) clients from firing up more
        # than one operation at a time, which could potentially lead to exploitation
        # of race conditions.
        self.connection2fsm = {}
        self.account2fsm = {}

        # For processing name patterns.
        self.nameGenerator = NameGenerator()

        # Temporary HMAC key:
        self.key = 'c603c5833021ce79f734943f6e662250fd4ecf7432bf85905f71707dc4a9370c6ae15a8716302ead43810e5fba3cf0876bbbfce658e2767b88d916f5d89fd31'

        # Instantiate our account DB interface:
        if accountDBType == 'developer':
            self.accountDB = DeveloperAccountDB(self)
        elif accountDBType == 'remote':
            self.accountDB = RemoteAccountDB(self)
        else:
            self.notify.error('Invalid accountdb-type: ' + accountDBType)
Example #17
0
 def _getLastNameCapPrefixes(self):
     if TTPickANamePattern.LastNamePrefixesCapped is None:
         ng = NameGenerator()
         TTPickANamePattern.LastNamePrefixesCapped = ng.getLastNamePrefixesCapped()[:]
     return TTPickANamePattern.LastNamePrefixesCapped
 def announceGenerate(self):
     GameServicesManagerUD.announceGenerate(self)
     self.nameGenerator = NameGenerator()
    def announceGenerate(self):
        GameServicesManagerUD.announceGenerate(self)

        # This is for processing name patterns.
        self.nameGenerator = NameGenerator()
Example #20
0
 def __init__(self, air):
     DistributedObjectGlobalUD.__init__(self, air)
     self.nameGenerator = NameGenerator()
     self.key = 'bG9sLndlLmNoYW5nZS50aGlzLnRvby5tdWNo'