def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} self.id2Party = {} self.party2PubInfo = {} self.tempSlots = {} self.inviteKey2Invite = {} self.inviteKeyAllocator = UniqueIdAllocator(0, 1000000) self.partyId2InviteKeys = {} self.hostsToRefund = {} self.inviteeId2Invites = {} self.hostId2PartyReplies = {} self.load() # Preallocate any used invite keys. if self.inviteKey2Invite: for inviteKey in self.inviteKey2Invite.keys(): self.inviteKeyAllocator.initialReserveId(inviteKey) self.wantInstantParties = simbase.config.GetBool( 'want-instant-parties', 0) # Setup tasks self.runAtNextInterval()
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) self.onlineToons = [] self.tpRequests = {} self.friendsLists = {} self.friendIndexes = {} self.listResponses = {}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} self.id2Party = {} self.party2PubInfo = {} self.tempSlots = {} self.inviteKey2Invite = {} self.inviteKeyAllocator = UniqueIdAllocator(0, 1000000) self.partyId2InviteKeys = {} self.hostsToRefund = {} self.inviteeId2Invites = {} self.hostId2PartyReplies = {} self.load() # Preallocate any used invite keys. if self.inviteKey2Invite: for inviteKey in self.inviteKey2Invite.keys(): self.inviteKeyAllocator.initialReserveId(inviteKey) self.wantInstantParties = simbase.config.GetBool('want-instant-parties', 0) # Setup tasks self.runAtNextInterval()
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 announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.info('HolidayManager going online') self.__checkHolidays() self.holidayCheckTask = taskMgr.doMethodLater(15, self.__checkHolidays, 'checkHolidays') self.holdayTimerTask = taskMgr.doMethodLater(15, self.__runHolidayTimer, 'holidayTimerTask') if self.wantRandomizedSchedules: self.randomScheduleTask = taskMgr.doMethodLater( 60, self.__runRandomizedSchedules, 'randomShceduleTask') self.d_requestRegister() # Load holidays from PRC if self.wantHolidays: debugHolidays = ConfigVariableList('debug-holiday') for holiday in debugHolidays: holidaySplit = holiday.split(';') holidayId = int(holidaySplit[0]) endTime = int(holidaySplit[1]) config = 0 if len(holidaySplit) > 2: config = int(holidaySplit[2]) self.startHoliday(holidayId, configId=config, time=endTime)
def announceGenerate(self): assert self.notify.debugCall() DistributedObjectGlobalUD.announceGenerate(self) self.sendUpdateToChannel(AIMsgTypes.CHANNEL_CLIENT_BROADCAST, "online", []) self.sendUpdateToChannel(AIMsgTypes.OTP_CHANNEL_AI_AND_UD_BROADCAST, "online", [])
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)
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() # 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) namesFile = open("astron/DistrictNames.txt") lines = namesFile.readlines() for index in range(len(lines) - 1): lines[index] = lines[index][:-1] self.availableNames = lines namesFile.close()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self._randoms = [] self._requests = [] self._fakeIt = 0 if __dev__: NonRepeatableRandomSourceUD.RandomNumberCacheSize = config.GetInt('random-source-cache-size', 5000) self._fakeIt = config.GetBool('fake-non-repeatable-random-source', self._fakeIt)
def announceGenerate(self): assert self.notify.debugCall() DistributedObjectGlobalUD.announceGenerate(self) SettingsMgrBase.announceGenerate(self) self._newSessionId() # clear any changed state from a previous session across all AIs and clients self._broadcastCurrentSettings() self.startCheckingIncomingHTTP()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.onlineToons = [] self.tpRequests = {} self.whisperRequests = {} self.operations = [] self.delayTime = 1.0
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.onlineToons = [] self.tpRequests = {} self.whisperRequests = {} self.operations = [] self.secret2avId = {} self.delayTime = 1.0
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.accept("accountOnline", self.accountOnline) self.accept("accountOffline", self.accountOffline) self.accept("avatarOnlinePlusAccountInfo", self.avatarOnline) self.accept("avatarOffline", self.avatarOffline) self.sendUpdateToChannel(AIMsgTypes.CHANNEL_CLIENT_BROADCAST, "online", []) self.sendUpdateToChannel(AIMsgTypes.OTP_CHANNEL_AI_AND_UD_BROADCAST, "online", [])
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) namesFile = open('astron/DistrictNames.txt') lines = namesFile.readlines() for index in range(len(lines) - 1): lines[index] = lines[index][:-1] self.availableNames = lines namesFile.close()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GLMUD generated") self.senders2Mgrs = {} self.host2LobbyId = {} self.id2Lobby = {} self.lobby2PubInfo = {} self.tempSlots = {} self.lobbyAllocator = UniqueIdAllocator(0, 100000000)
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.whiteList = TTWhiteList() self.toonAccess = 100 self.offenses = {} self.chatMode2prefix = {1: '[MOD] ', 2: '[ADMIN] ', 3: '[SYSADMIN] '} self.accept('setAvatarOffenses', self.updateAvatarOffenses) self.accept('requestToonAccessResponse', self.requestToonAccessResponse)
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.loadData() for i in xrange(len(self.requestedNames)): nameRequest = self.requestedNames[i] print 'Name %s, was requested on %s, by %s. Status: %s' % ( nameRequest['name'], nameRequest['date'], nameRequest['avId'], nameRequest['status'])
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)
def announceGenerate(self): assert self.notify.debugCall() DistributedObjectGlobalUD.announceGenerate(self) self.sendUpdateToChannel(AIMsgTypes.CHANNEL_CLIENT_BROADCAST, "online", []) self.sendUpdateToChannel(AIMsgTypes.OTP_CHANNEL_AI_AND_UD_BROADCAST, "online", []) self.startCheckingIncomingHTTP() self.startMonitoringJobQueueSize() self.startLoggingStatus()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.whiteList = TTWhiteList() self.muted = {} self.chatMode2channel = { 1: OtpDoGlobals.OTP_MOD_CHANNEL, 2: OtpDoGlobals.OTP_ADMIN_CHANNEL, 3: OtpDoGlobals.OTP_SYSADMIN_CHANNEL, } self.chatMode2prefix = {1: "[MOD] ", 2: "[ADMIN] ", 3: "[SYSADMIN] "}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self._randoms = [] self._requests = [] self._fakeIt = 0 if __dev__: # don't bloat RAM in dev NonRepeatableRandomSourceUD.RandomNumberCacheSize = ConfigVariableInt( 'random-source-cache-size', 5000).getValue() self._fakeIt = ConfigVariableBool( 'fake-non-repeatable-random-source', self._fakeIt).getValue()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.connection2fsm = {} self.account2fsm = {} 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 announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.onlineToons = [] self.toonAccess = {} self.toonNames = {} self.toonAccIds = {} self.tpRequests = {} self.whisperRequests = {} self.friendsLists = {} self.friendIndexes = {} self.listResponses = {} self.delayTime = 1.0 self.delayTime = 1.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.pendingLogins = {} # Instantiate our account DB interface: self.accountDB = LocalAccountDB(self)
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} # just a reference mapping self.id2Party = {} # This should be replaced with a longterm datastore self.party2PubInfo = {} # This should not be longterm self.tempSlots = {} self.partyAllocator = UniqueIdAllocator(0, 100000000) config = getConfigShowbase() self.wantInstantParties = config.GetBool('want-instant-parties', 0) # Setup tasks self.runAtNextInterval()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.wantBlacklistSequence = config.GetBool("want-blacklist-sequence", True) self.wantWhitelist = config.GetBool("want-whitelist", True) if self.wantWhitelist: self.whiteList = TTWhiteList() if self.wantBlacklistSequence: self.sequenceList = TTSequenceList() self.chatMode2channel = { 1: OtpDoGlobals.OTP_MOD_CHANNEL, 2: OtpDoGlobals.OTP_ADMIN_CHANNEL, 3: OtpDoGlobals.OTP_SYSADMIN_CHANNEL, } self.chatMode2prefix = {1: "[MOD] ", 2: "[ADMIN] ", 3: "[SYSADMIN] "}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug('GPMUD generated') self.senders2Mgrs = {} self.host2PartyId = {} self.id2Party = {} self.party2PubInfo = {} self.tempSlots = {} PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' startTime = datetime.strptime('2014-01-20 11:50:00', PARTY_TIME_FORMAT) endTime = datetime.strptime('2014-01-20 12:20:00', PARTY_TIME_FORMAT) self.partyAllocator = UniqueIdAllocator(0, 100000000) config = getConfigShowbase() self.wantInstantParties = config.GetBool('want-instant-parties', 0) self.runAtNextInterval()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) # The purpose of connection2fsm & account2fsm are to # keep track of the connection & account IDs that are # currently running an operation on the GameServicesManager. # Ideally, this will help us prevent clients from running # more than one operation at a time which could potentially # lead to race conditions & the exploitation of them. self.connection2fsm = {} self.account2fsm = {} # Instantiate the account database interface. # TODO: In the future, add more database interfaces & make this configurable. self.accountDb = DeveloperAccountDB(self)
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
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.wantBlacklist = config.GetBool('want-blacklist', True) self.wantBlacklistSequence = config.GetBool('want-blacklist-sequence', True) self.wantWhitelist = config.GetBool('want-whitelist', True) if self.wantWhitelist: self.whiteList = TTWhiteList() if self.wantBlacklist: self.blackList = TTBlackList() if self.wantBlacklistSequence: self.sequenceList = TTSequenceList() self.chatMode2channel = { 1: OtpDoGlobals.OTP_MOD_CHANNEL, 2: OtpDoGlobals.OTP_ADMIN_CHANNEL } self.chatMode2prefix = {1: '[MOD] ', 2: '[ADMIN] '}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.whiteList = TTWhiteList() self.muted = {} self.chatMode2channel = { 1: OtpDoGlobals.OTP_MOD_CHANNEL, 2: OtpDoGlobals.OTP_ADMIN_CHANNEL, 3: OtpDoGlobals.OTP_DEV_CHANNEL, 4: OtpDoGlobals.OTP_SYSADMIN_CHANNEL, } self.chatMode2prefix = { 1: "[MOD] ", 2: "[ADMIN] ", 3: "[DEV] ", 4: "[SYSADMIN] " }
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} # just a reference mapping self.id2Party = {} # This should be replaced with a longterm datastore self.party2PubInfo = {} # This should not be longterm self.tempSlots = {} PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' startTime = datetime.strptime('2014-01-20 11:50:00', PARTY_TIME_FORMAT) endTime = datetime.strptime('2014-01-20 12:20:00', PARTY_TIME_FORMAT) self.nextId = 0 #self.host2Party[100000001] = {'hostId': 100000001, 'start': startTime, 'end': endTime, 'partyId': 1717986918400000, 'decorations': [[3,5,7,6]], 'activities': [[10,13,6,18],[7,8,7,0]],'inviteTheme':1,'isPrivate':0,'inviteeIds':[]} config = getConfigShowbase() self.wantInstantParties = config.GetBool('want-instant-parties', 0) # Setup tasks self.runAtNextInterval()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} # Just a reference mapping... self.id2Party = { } # This should be replaced with a long term data store. self.party2PubInfo = {} # This should not be long term. self.tempSlots = {} PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' startTime = datetime.strptime('2014-01-20 11:50:00', PARTY_TIME_FORMAT) endTime = datetime.strptime('2014-01-20 12:20:00', PARTY_TIME_FORMAT) self.partyAllocator = UniqueIdAllocator(0, 100000000) config = getConfigShowbase() self.wantInstantParties = config.GetBool('want-instant-parties', 0) # Setup tasks. self.runAtNextInterval()
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 = {} # 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.notify.debug("GPMUD generated") self.senders2Mgrs = {} self.host2PartyId = {} # just a reference mapping self.id2Party = {} # This should be replaced with a longterm datastore self.party2PubInfo = {} # This should not be longterm self.tempSlots = {} PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' startTime = datetime.strptime('2014-01-20 11:50:00', PARTY_TIME_FORMAT) endTime = datetime.strptime('2014-01-20 12:20:00', PARTY_TIME_FORMAT) self.partyAllocator = UniqueIdAllocator(0, 100000000) #self.host2Party[100000001] = {'hostId': 100000001, 'start': startTime, 'end': endTime, 'partyId': 1717986918400000, 'decorations': [[3,5,7,6]], 'activities': [[10,13,6,18],[7,8,7,0]],'inviteTheme':1,'isPrivate':0,'inviteeIds':[]} config = getConfigShowbase() self.wantInstantParties = config.GetBool('want-instant-parties', 0) # Setup tasks self.runAtNextInterval()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.connection2fsm = {} self.account2fsm = {} 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 self.account2username = {}
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)
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self)
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.senders2Mgrs = {}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.whiteList = TTWhiteList()
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.offenses = {}
def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) taskMgr.doMethodLater(10, self.parseInvasions, self.uniqueName('parseInvasions')) self.calledInvasion = None