Beispiel #1
0
 def doGetRankList(self, userId, msg):
     results = {}
     self.matchPlugin.checkMatchStartTime(self.bigRoomId)
     self.matchPlugin.getRankList(self.gameId, userId, self.bigRoomId,
                                  results)
     TYPluginUtils.sendMessage(self.gameId, [userId], 'linerMatchRank',
                               results)
Beispiel #2
0
    def sendToUser(self, userId):
        # 针对day2比赛:
        # day1结束后,没有通知day2 build榜的机制,所以这里在玩家获取榜的时候build一次
        if self.room.isDay2Match():
            self.__buildRankData()
        # if not self.canSend():
        #             return

        # 加个检查,防止极特殊情况下,前端在开赛前请求榜导致异常
        if not self.rankResultsForSend:
            return

        userRank = self.userRanking.get(userId, -1)
        #         if userRank < 0:
        #             return

        #         clientVer = sessiondata.getClientIdVer(userId)
        # if TyContext.ClientUtils.isWinPcClient(user.clientId) or user.clientVer < 3.6:
        #         if clientVer < 3.6:
        #             self.rankResultsForSend['pos'] = userRank + 1
        #             TYPluginUtils.sendMessage(self.gameId, userId, 'matchRank', self.rankResultsForSend, logInfo=False)
        #         else:

        if userRank >= 0:
            self.rankResultsForSend_3_6['pos'] = userRank + 1
            self.rankResultsForSend_3_6['ranks'][0].update(self.ranks[userRank])
            TYPluginUtils.sendMessage(self.gameId, userId, 'matchRank', self.rankResultsForSend_3_6, logInfo=False)
        else:
            self.rankResultsForSend['pos'] = userRank + 1
            TYPluginUtils.sendMessage(self.gameId, userId, 'matchRank', self.rankResultsForSend, logInfo=False)
Beispiel #3
0
    def doGetDescription(self, userId):
        if ftlog.is_debug():
            ftlog.debug("<<", "|userId, roomId:", userId, self.roomId, caller=self)
        match_desc = {}
        self.matchPlugin.getMatchDes(userId, self.bigRoomId, match_desc)
        TYPluginUtils.sendMessage(self.gameId, [userId], 'm_des',
                                  result={'roomId': self.bigRoomId, 'm_type': self.roomConf['typeName'],
                                          'desc': match_desc})

        rooms = [{"desc": self.matchConf["signinDesc"], "roomId": self.bigRoomId}]
        TYPluginUtils.sendMessage(self.gameId, [userId], 'm_rooms', result={'rooms': rooms, 'selected': self.bigRoomId})
Beispiel #4
0
 def doGetDescription(self, userId):
     ftlog.debug("<<", "|userId, roomId:", userId, self.roomId, caller=self)
     match_desc = {}
     self.matchPlugin.checkMatchStartTime(self.bigRoomId)
     self.matchPlugin.getMatchDes(userId, self.bigRoomId, match_desc)
     # 每次取m_des的时候 取一次服务器当前的时间
     match_desc.update({'nowServerTime': int(time.time())})
     TYPluginUtils.sendMessage(self.gameId, [userId],
                               'm_des',
                               result={
                                   'roomId': self.bigRoomId,
                                   'm_type': self.roomConf['typeName'],
                                   'desc': match_desc
                               })
Beispiel #5
0
    def doGetDescription(self, userId):
        if ftlog.is_debug():
            ftlog.debug("<<", "|userId, roomId:", userId, self.roomId, caller=self)

        if self.state == self.MTT_STATE_START:
            return

        match_desc = {}
        self.matchPlugin.getMatchDes(userId, self.bigRoomId, match_desc)

        # day1比赛显示day2比赛的奖励
        mconf = self.matchPlugin.match_room_confs[self.bigRoomId]
        day1EndConf = mconf.get('day1EndConf')
        if day1EndConf:
            day2BigRoomId = day1EndConf["day2BigRoomId"]
            match_desc['rank'] = self.matchPlugin.mdes[day2BigRoomId]['rank']

        TYPluginUtils.sendMessage(self.gameId, [userId], 'm_des',
                                  result={'roomId': self.bigRoomId, 'm_type': self.roomConf['typeName'],
                                          'desc': match_desc})
Beispiel #6
0
    def sendToUser(self, userId):
        # 针对day2比赛:
        # day1结束后,没有通知day2 build榜的机制,所以这里在玩家获取榜的时候build一次
        if self.room.isDay2Match():
            self.__buildRankData()
        # if not self.canSend():
        #             return

        # 加个检查,防止极特殊情况下,前端在开赛前请求榜导致异常
        if not self.rankResultsForSend:
            return

        userRank = self.userRanking.get(userId, -1)
        #         if userRank < 0:
        #             return

        #         clientVer = sessiondata.getClientIdVer(userId)
        # if TyContext.ClientUtils.isWinPcClient(user.clientId) or user.clientVer < 3.6:
        #         if clientVer < 3.6:
        #             self.rankResultsForSend['pos'] = userRank + 1
        #             TYPluginUtils.sendMessage(self.gameId, userId, 'matchRank', self.rankResultsForSend, logInfo=False)
        #         else:

        if userRank >= 0:
            self.rankResultsForSend_3_6['pos'] = userRank + 1
            self.rankResultsForSend_3_6['ranks'][0].update(
                self.ranks[userRank])
            TYPluginUtils.sendMessage(self.gameId,
                                      userId,
                                      'matchRank',
                                      self.rankResultsForSend_3_6,
                                      logInfo=False)
        else:
            self.rankResultsForSend['pos'] = userRank + 1
            TYPluginUtils.sendMessage(self.gameId,
                                      userId,
                                      'matchRank',
                                      self.rankResultsForSend,
                                      logInfo=False)
Beispiel #7
0
 def doGetRankList(self, userId, msg):
     tableId = msg.getParam("tableId")
     table = self.maptable[tableId]
     results = self.matchPlugin.getRankList(userId, self.roomId, table)
     TYPluginUtils.sendMessage(self.gameId, [userId], 'matchRank', results)