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
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)
def resumeItemFromRoom(userId, gameId, itemId, count, roomId, bigRoomId): """退还房卡,加锁操作""" MajiangItem.addUserItemByKindId(userId , gameId , itemId , count , 'MAJIANG_FANGKA_RETURN_BACK' , bigRoomId)
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
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)
def resumeItemFromRoom(userId, gameId, itemId, count, roomId, bigRoomId): """退还房卡,加锁操作""" MajiangItem.addUserItemByKindId(userId, gameId, itemId, count, 'MAJIANG_FANGKA_RETURN_BACK', bigRoomId)
def getItemCount(userId, itemId): """获取房卡数""" user_fangka_count = MajiangItem.getUserItemCountByKindId(userId, itemId) return user_fangka_count
def doGetMajiangItem(self, gameId, userId, clientId): """ 客户端获取麻将道具数量 """ tabs = MajiangItem.queryUserItemTabsV3_7(gameId, userId) MajiangItem.sendItemListResponse(gameId, userId, tabs)