예제 #1
0
 def doRobotShutDown(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doRobotShutDown, roomId, msgDict, 1)
         return 1
     # do sync code
     # msg = MsgPack(msgDict)
     return 1
예제 #2
0
 def doRobotCallUp(self, roomId, tableId, ucount, uids, params, isSync):
     if not isSync:
         ftcore.runOnce(self.doRobotCallUp, roomId, tableId, ucount, uids,
                        params, 1)
         return 1
     # do sync code
     return 1
예제 #3
0
 def doRoomLeave(self, ctrlRoomId, tableId, userId, reason, needSendRes,
                 isSync):
     if not isSync:
         ftcore.runOnce(self.doRoomLeave, ctrlRoomId, tableId, userId,
                        reason, needSendRes, 1)
         return 1
     # do sync code
     return 1
예제 #4
0
 def doQuickStart(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doQuickStart, roomId, msgDict, 1)
         return 1
     # do sync code
     msg = MsgPack(msgDict)
     tyglobal.rooms()[roomId].doQuickStart(msg)
     return 1
예제 #5
0
 def doSitDown(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doSitDown, roomId, msgDict, 1)
         return 1
     msg = MsgPack(msgDict)
     tableId = msg.getParamInt('tableId', 0)
     userId = msg.getParamInt('userId', 0)
     seatId = msg.getParamInt('seatId', 0)
     clientId = msg.getParamStr('clientId', '')
     room = tyglobal.rooms()[roomId]
     table = room.maptable[tableId]
     table.doSit(msg, userId, seatId, clientId)
     return 1
예제 #6
0
def init():
    """
    启动模拟环境.
    """
    ftglobal.gameId = 9993
    # 初始化环境基础变量
    server_id, mn_port, conf_ip, conf_port, conf_dbid, namespace = "HU9999000001", 8400, "172.16.4.15", 8003, 3, \
                                                                   "hall5"
    ftcore.runOnce(_initSafe, server_id, mn_port, conf_ip, int(conf_port),
                   int(conf_dbid), namespace, None)
    #延迟运行测试用例
    ftcore.runOnceDelay(5, testcase0)
    ftcore.mainloop()
예제 #7
0
파일: item.py 프로젝트: zhaozw/freetime5
    def rankSendReward(self, userId2Data, gameId, mail, eventId,
                       intEventParam):
        """
        排行榜发奖
        """
        if not userId2Data:
            return 0

        def _longwork():
            for userId, data in userId2Data.iteritems():
                self._rankSendReward(int(userId), gameId, data, mail, eventId,
                                     intEventParam)

        ftcore.runOnce(_longwork)
        return 1
예제 #8
0
 def doTableManageClearPlayers(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doTableManageClearPlayers, roomId, msgDict, 1)
         return 1
     msg = MsgPack(msgDict)
     pass
예제 #9
0
 def doTableManageGameStart(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doTableManageGameStart, roomId, msgDict, 1)
         return 1
     msg = MsgPack(msgDict)
     pass
예제 #10
0
 def doTableCallObserve(self, roomId, msgDict, isSync):
     if not isSync:
         ftcore.runOnce(self.doTableCallObserve, roomId, msgDict, 1)
         return 1
     msg = MsgPack(msgDict)
     pass
예제 #11
0
 def doUserChangeDone(self, roomId, tableId, userId, clientId, isSync):
     if not isSync:
         ftcore.runOnce(self.doUserChangeDone, roomId, tableId, userId,
                        clientId, 1)
         return 1
     pass
예제 #12
0
def testRun():
    ftlog.info('===main===')
    mock()
    ftcore.runOnce(main)
    ftcore.mainloop()