def testQuickStart(self): '''测试快速开始''' gameId = 6 userId = 1234 roomId = 0 tableId = 0 chip = 800 clientId = "Android_3.501_tuyoo.YDJD.0-hall6.apphui.happy" onlinedata.setOnlineState(userId, onlinedata.ONLINE) onlinedata.cleanOnlineLoc(userId) userdata.setAttr(userId, "sessionClientId", clientId) # datas = sessiondata._getUserSessionValues(userId) # ftlog.debug("|userId, session:", userId, datas) oldChip = userchip.getChip(userId) userchip.incrChip(userId, gameId, chip - oldChip, 0, "GM_ADJUST_COIN", 0, 0) msg = MsgPack() msg.setCmd("quick_start") msg.setParam("gameId", gameId) msg.setParam("userId", userId) msg.setParam("roomId", roomId) msg.setParam("tableId", tableId) msg.setParam("clientId", clientId) print '=' * 30 print msg DizhuQuickStartDispatcher.dispatchQuickStart(msg) print '=' * 30
def testQuickStart(self): '''测试快速开始''' gameId = 6 userId = random.randint(10000, 20000) roomId = 0 tableId = 0 chip = 800 clientId = "Android_3.501_tuyoo.YDJD.0-hall6.apphui.happy" playMode = "happy" onlinedata.setOnlineState(userId, onlinedata.ONLINE) onlinedata.cleanOnlineLoc(userId) userdata.setAttr(userId, "sessionClientId", clientId) # datas = sessiondata._getUserSessionValues(userId) # ftlog.debug("|userId, session:", userId, datas) oldChip = userchip.getChip(userId) userchip.incrChip(userId, gameId, chip - oldChip, 0, "GM_ADJUST_COIN", 0, clientId) msg = MsgPack() msg.setCmd("quick_start") msg.setParam("gameId", gameId) msg.setParam("userId", userId) # msg.setParam("roomId", roomId) # msg.setParam("tableId", tableId) msg.setParam("clientId", clientId) print '='*30 print msg BaseQuickStartDispatcher.dispatchQuickStart(msg, userId, gameId, roomId, tableId, playMode, clientId) print '='*30
def asyncTest3PlayerMatchWithRobot(self): ftlog.debug("-" * 30) ctrlRoomId = 60121000 # clientId = "Android_3.501_tuyoo.YDJD.0-hall6.apphui.happy" clientId = "Android_3.372_momo.momo.0-hall6.momo.momo" userId1 = random.randint(10000, 20000) onlinedata.setOnlineState(userId1, onlinedata.ONLINE) onlinedata.cleanOnlineLoc(userId1) userdata.setAttr(userId1, "sessionClientId", clientId) bigMatchRoom = gdata.rooms()[ctrlRoomId] bigMatchRoom.doEnter(userId1) bigMatchRoom.doSignin(userId1)
def testQuickEnterTable(self): '''测试快速进入桌子''' gameId = 6 userId = 1234 roomId = 60110001 tableId = 1 clientId = "tuyoo_4.0_hall6" onlinedata.setOnlineState(userId, onlinedata.ONLINE) onlinedata.cleanOnlineLoc(userId) msg = MsgPack() msg.setCmd("quick_start") msg.setParam("userId", userId) msg.setParam("roomId", roomId) msg.setParam("tableId", tableId) msg.setParam("clientId", clientId) print '=' * 30 print msg DizhuQuickStartDispatcher.dispatchQuickStart(msg) print '=' * 30
def testQuickEnterTable(self): '''测试快速进入桌子''' gameId = 6 userId = random.randint(10000, 20000) roomId = 60011001 tableId = 1 clientId = "Android_3.501_tuyoo.YDJD.0-hall6.apphui.happy" playMode = "happy" onlinedata.setOnlineState(userId, onlinedata.ONLINE) onlinedata.cleanOnlineLoc(userId) msg = MsgPack() msg.setCmd("quick_start") msg.setParam("userId", userId) msg.setParam("roomId", roomId) msg.setParam("tableId", tableId) msg.setParam("clientId", clientId) print '='*30 print msg BaseQuickStartDispatcher.dispatchQuickStart(msg, userId, gameId, roomId, tableId, playMode, clientId) print '='*30
def testReconnect(self): '''测试断线重连 ''' gameId = 6 userId = 1234 roomId = 60110001 tableId = 1 seatId = 3 clientId = "tuyoo_4.0_hall6" onlinedata.setOnlineState(userId, onlinedata.ONLINE) onlinedata.addOnlineLoc(userId, roomId, tableId, seatId) msg = MsgPack() msg.setCmd("quick_start") msg.setParam("userId", userId) msg.setParam("roomId", roomId) msg.setParam("tableId", tableId) msg.setParam("clientId", clientId) print '=' * 30 print msg DizhuQuickStartDispatcher.dispatchQuickStart(msg) print '=' * 30
def processOnLineTcpChangedEvent(evt): userId = evt.userId isOnline = evt.isOnline # 设置在线状态和在线用户集合列表, 离线时,所有通过setGameOnline设置的该用户数据均已经被删除 onlinedata.setOnlineState(userId, isOnline) if not isOnline: ctfull = timestamp.formatTimeMs() gamedata.setGameAttr(userId, HALL_GAMEID, 'offlineTime', ctfull) return # 计算其他的数据在线分组 # 分金币数量级别列表 — 德州等LED引导 richchip = hallconf.getHallPublic().get('online_rich_limit', 100000) if richchip > 0: chip = userchip.getUserChipAll(userId) if chip > richchip: onlinedata.setGameOnline(userId, HALL_GAMEID, 'rich_online_users') # 分版本 # 分等级(可能是大师分,或经验值) # 新老用户(是否第一天注册) # 有没有玩过某些游戏 # 是否有道具 # 是否充值 # 是否满足比赛报名条件 pass