Example #1
0
 def consumeItem(self, userId, gameId, itemId, count, roomId, bigRoomId):
     """消费房卡,加锁操作"""
     user_fangka_count = MajiangItem.getUserItemCountByKindId(userId, itemId)
     if user_fangka_count >= count:
         consumeResult = MajiangItem.consumeItemByKindId(userId, gameId, itemId, count, 'MAJIANG_FANGKA_CONSUME', bigRoomId)
         return consumeResult
     return False
Example #2
0
def resumeItemFromTable(userId, gameId, itemId, count, roomId, tableId, bigRoomId):
    """退还房卡,加锁操作"""
    ftlog.debug('user_remote resumeItemFromTable userId:', userId
            , ' gameId:', gameId
            , ' itemId:', itemId
            , ' count:', count
            , ' roomId:', roomId
            , ' tableId:', tableId
            , ' bigRoomId:', bigRoomId
    )
    
    lseatId = onlinedata.getOnlineLocSeatId(userId, roomId, tableId)
    ftlog.debug('user_remote resumeItemFromTable lseatId:', lseatId)
    
    if lseatId < 0:
        ftlog.info('user_remote resumeItemFromTable loc not match, do not resume item. userId:', userId
                , ' gameId:', gameId
                , ' itemId:', itemId
                , ' count:', count
                , ' roomId:', roomId
                , ' tableId:', tableId
                , ' seatId:', lseatId)
        return
        
    MajiangItem.addUserItemByKindId(userId
            , gameId
            , itemId
            , count
            , 'MAJIANG_FANGKA_RETURN_BACK'
            , bigRoomId)
Example #3
0
def resumeItemFromRoom(userId, gameId, itemId, count, roomId, bigRoomId):
    """退还房卡,加锁操作"""
    MajiangItem.addUserItemByKindId(userId
            , gameId
            , itemId
            , count
            , 'MAJIANG_FANGKA_RETURN_BACK'
            , bigRoomId)
Example #4
0
def consumeItem(userId, gameId, itemId, count, roomId, bigRoomId):
    """消费房卡,加锁操作"""
    user_fangka_count = MajiangItem.getUserItemCountByKindId(userId, itemId)
    if user_fangka_count >= count:
        consumeResult = MajiangItem.consumeItemByKindId(userId
            , gameId
            , itemId
            , count
            , 'MAJIANG_FANGKA_CONSUME'
            , bigRoomId)
        return consumeResult
    return False
Example #5
0
    def resumeItemFromTable(self, userId, gameId, itemId, count, roomId, tableId, bigRoomId):
        """退还房卡,加锁操作"""
        ftlog.debug('user_remote resumeItemFromTable userId:', userId, ' gameId:', gameId, ' itemId:', itemId, ' count:', count, ' roomId:', roomId, ' tableId:', tableId, ' bigRoomId:', bigRoomId
                    )

        lseatId = pluginCross.onlinedata.getOnLineLocSeatId(userId, roomId, tableId)
        ftlog.debug('user_remote resumeItemFromTable lseatId:', lseatId)

        if lseatId < 0:
            ftlog.info('user_remote resumeItemFromTable loc not match, do not resume item. userId:', userId, ' gameId:', gameId,
                       ' itemId:', itemId, ' count:', count, ' roomId:', roomId, ' tableId:', tableId, ' seatId:', lseatId)
            return

        MajiangItem.addUserItemByKindId(userId, gameId, itemId, count, 'MAJIANG_FANGKA_RETURN_BACK', bigRoomId)
Example #6
0
def resumeItemFromRoom(userId, gameId, itemId, count, roomId, bigRoomId):
    """退还房卡,加锁操作"""
    MajiangItem.addUserItemByKindId(userId, gameId, itemId, count,
                                    'MAJIANG_FANGKA_RETURN_BACK', bigRoomId)
Example #7
0
def getItemCount(userId, itemId):
    """获取房卡数"""
    user_fangka_count = MajiangItem.getUserItemCountByKindId(userId, itemId)
    return user_fangka_count
Example #8
0
 def doGetMajiangItem(self, gameId, userId, clientId):
     """ 客户端获取麻将道具数量
     """
     tabs = MajiangItem.queryUserItemTabsV3_7(gameId, userId)
     MajiangItem.sendItemListResponse(gameId, userId, tabs)
Example #9
0
 def doGetMajiangItem(self, gameId, userId, clientId):
     """ 客户端获取麻将道具数量
     """
     tabs = MajiangItem.queryUserItemTabsV3_7(gameId, userId)
     MajiangItem.sendItemListResponse(gameId, userId, tabs)
Example #10
0
def getItemCount(userId, itemId):
    """获取房卡数"""
    user_fangka_count = MajiangItem.getUserItemCountByKindId(userId, itemId)
    return user_fangka_count