def setUp(self): self.testContext.startMock() self.testContext.confDB.setConf('poker:map.clientid', clientIdMap) self.testContext.configure.setJson('game:9999:map.clientid', clientIdMap, 0) self.testContext.configure.setJson('poker:map.clientid', clientIdMap, 0) self.testContext.configure.setJson('game:9999:item', item_conf, 0) self.testContext.configure.setJson('game:9999:products', products_conf, 0) self.testContext.configure.setJson('game:9999:store', store_template_conf, 0) self.testContext.configure.setJson('game:9999:store', store_default_conf, clientIdMap[self.clientId]) self.testContext.configure.setJson('game:9999:vip', vip_conf, 0) self.testContext.configure.setJson('game:9999:benefits', benefits_conf, 0) self.testContext.configure.setJson('game:9999:share', share_conf, 0) self.testContext.configure.setJson('game:9999:promote', promote_conf, 0) self.testContext.configure.setJson('game:9999:promote', {"template": "template.3_7.ios"}, 13232) self.timestamp = pktimestamp.getCurrentTimestamp() self.pktimestampPatcher = patch( 'poker.util.timestamp.getCurrentTimestamp', self.getCurrentTimestamp) self.pktimestampPatcher.start() hallitem._initialize() hallvip._initialize() hallbenefits._initialize() hallshare._initialize() hallpromote._initialize()
def setUp(self): self.testContext.startMock() self.redisClient = StrictRedis('127.0.0.1', 6379, 0) daobase.executeMixCmd = self.runRedisCmd daobase._executePayDataCmd = self.runRedisCmd daobase.executeUserCmd = self.runUserRedisCmd self.testContext.configure.setJson('game:9999:map.clientid', clientIdMap, 0) self.testContext.configure.setJson('game:9999:item', item_conf, 0) self.testContext.configure.setJson('game:9999:products', products_conf, 0) self.testContext.configure.setJson('game:9999:store', store_template_conf, 0) self.testContext.configure.setJson('game:9999:store', store_default_conf, clientIdMap[self.clientId]) self.testContext.configure.setJson('game:9999:vip', vip_conf, 0) self.testContext.configure.setJson('game:9999:benefits', benefits_conf, 0) self.testContext.configure.setJson('game:9999:share', share_conf, 0) self.timestamp = pktimestamp.getCurrentTimestamp() self.pktimestampPatcher = patch('poker.util.timestamp.getCurrentTimestamp', self.getCurrentTimestamp) self.pktimestampPatcher.start() hallitem._initialize() hallvip._initialize() hallbenefits._initialize() hallshare._initialize() daobase.executeUserCmd(10001, 'del', 'share.status:9999:10001')
def setUp(self): self.testContext.startMock() self.testContext.confDB.setConf('poker:map.clientid', clientIdMap) self.testContext.configure.setJson('game:9999:map.clientid', clientIdMap, 0) self.testContext.configure.setJson('poker:map.clientid', clientIdMap, 0) self.testContext.configure.setJson('game:9999:item', item_conf, 0) self.testContext.configure.setJson('game:9999:products', products_conf, 0) self.testContext.configure.setJson('game:9999:store', store_template_conf, 0) self.testContext.configure.setJson('game:9999:store', store_default_conf, clientIdMap[self.clientId]) self.testContext.configure.setJson('game:9999:vip', vip_conf, 0) self.testContext.configure.setJson('game:9999:benefits', benefits_conf, 0) self.testContext.configure.setJson('game:9999:share', share_conf, 0) self.testContext.configure.setJson('game:9999:promote', promote_conf, 0) self.testContext.configure.setJson('game:9999:promote', {"template": "template.3_7.ios"}, 13232) self.timestamp = pktimestamp.getCurrentTimestamp() self.pktimestampPatcher = patch('poker.util.timestamp.getCurrentTimestamp', self.getCurrentTimestamp) self.pktimestampPatcher.start() hallitem._initialize() hallvip._initialize() hallbenefits._initialize() hallshare._initialize() hallpromote._initialize()
def initGame(self): from hall.entity import hallaccount self._account = hallaccount # 大厅的账户处理类 serverType = gdata.serverType() if serverType == gdata.SRV_TYPE_CENTER: centers = gdata.serverTypeMap().get(gdata.SRV_TYPE_CENTER, [])[:] centers.sort() sid = gdata.serverId() inits = gdata.centerServerLogics().get(sid, []) # 轮盘开奖信息的监听 from hall.servers.center.rpc.roulette_remote import sendReward globalEventBus.subscribe(EventHeartBeat, sendReward) if inits: for pkg in inits: ftlog.info('init center logic of ->', pkg) exec 'from %s import _initialize; _initialize(1)' % (pkg) if serverType == gdata.SRV_TYPE_UTIL: from hall.servers.util.account_handler import updateOnLineInfos globalEventBus.subscribe(EventHeartBeat, updateOnLineInfos) # 在线信息初始化, ONLIE处理必须在UTIL服务 from hall.entity import hallonline hallonline._initialize() if serverType == gdata.SRV_TYPE_TABLE or serverType == gdata.SRV_TYPE_ROOM: from hall.servers.room.room import reportRoomOnlineInfos globalEventBus.subscribe(EventHeartBeat, reportRoomOnlineInfos) from hall.entity import hallchatlog hallchatlog._initialize() # 注意: 各个模块间有先后初始化的顺序 from hall.entity import hallitem, hallstore, hallvip, hallbenefits, \ hallranking, hallshare, hallpromote, hallfree, hallgamelist, hallgamelist2, \ halldailycheckin, hallmenulist, hallcoupon, hallmoduletip, \ hallrename, hallads, hallflipcardluck, hallpopwnd, hallstartchip, \ fivestarrate, match360kp, neituiguang, hallstocklimit, \ hall_first_recharge, hallroulette, hallled, hall_exit_remind from hall.entity.hallactivity import activity from hall.entity.halltmpact import tmp_activity from hall.entity.hall_red_envelope import hall_red_envelope # 道具初始化 hallitem._initialize() # 限购初始化 hallstocklimit._initialize() # 商城初始化 hallstore._initialize() # VIP系统初始化 hallvip._initialize() # 救济金系统初始化 hallbenefits._initialize() # 用户初始基金初始化 hallstartchip._initialize() halldailycheckin._initialize() # 排行榜 hallranking._initialize(0) # 活动系统初始化 activity._initialize() hallcoupon._initialize() hallshare._initialize() hallgamelist._initialize() hallgamelist2._initialize() hallmenulist._initialize() hallrename._initialize() hallmoduletip._initialize() hallads._initialize() hallflipcardluck._initialize() hallpopwnd._initialize() hallpromote._initialize() hallfree._initialize() fivestarrate._initialize() match360kp._initialize() neituiguang._initialize() from hall.entity import halltask halltask.initialize() # 默认配置初始化 hallmoduledefault._initialize() halllocalnotification._initialize() # 首冲礼包配置 hall_first_recharge._initialize() tmp_activity._initialize() # 红包模块配置初始化 hall_red_envelope._initialize() # 钻石抽奖初始化 hallroulette._initialize() # led配置初始化 hallled._initializeConfig() # 退出提醒 hall_exit_remind._initialize() # 三方控制模块开关 hall_third_sdk_switch._initialize() # 域名配置初始化 halldomains._initialize() # 插件升级模块初始化 hall_game_update._initialize() # 登录奖励模块初始化 hall_login_reward._initialize() # 道具转换模块初始化 hall_item_exchange._initialize() # 自建桌房间号初始化 hall_friend_table._initialize() # 小推广系统初始化 from hall.entity import hall_simple_invite hall_simple_invite.initialize() # 房卡购买提示信息模块初始化 from hall.entity import hall_fangka_buy_info hall_fangka_buy_info._initialize()