Beispiel #1
0
 def _moveHall51DataBack(self, userId, gameId, clientId):
     try:
         flag = DaoGameDataHall.HGET(userId, 'userChipMoveGame')
         ftlog.info('_moveHall51DataBack', userId, gameId, flag)
         if flag > 0:
             # 当前用户登录过HALL51
             chip, exp, charm, coupon = DaoGameDataHall.HMGET(
                 userId, ['chip', 'exp', 'charm', 'coupon'])
             chip, exp, charm, coupon = ftstr.parseInts(
                 chip, exp, charm, coupon)
             ftlog.info('_moveHall51DataBack data->', userId, gameId, chip,
                        exp, charm, coupon)
             if charm > 0:
                 self.incrCharm(userId, charm)
             if exp > 0:
                 self.incrExp(userId, exp)
             if coupon > 0:
                 trueDelta, finalCount = self.incrCoupon(
                     userId, gameId, coupon, ChipNotEnoughOpMode.NOOP,
                     'SYSTEM_REPAIR', 0)
                 ftlog.info('_moveHall51DataBack data coupon->', userId,
                            gameId, coupon, trueDelta, finalCount)
             if chip > 0:
                 trueDelta, finalCount = self.incrChip(
                     userId, gameId, chip, ChipNotEnoughOpMode.NOOP,
                     'SYSTEM_REPAIR', 0)
                 ftlog.info('_moveHall51DataBack data chip->', userId,
                            gameId, chip, trueDelta, finalCount)
             DaoGameDataHall.HDEL(
                 userId,
                 ['chip', 'exp', 'charm', 'coupon', 'userChipMoveGame'])
             pluginCross.halldatanotify.sendDataChangeNotify(
                 userId, gameId, 'chip')
     except:
         ftlog.error()
Beispiel #2
0
 def getHallDataList(self, userId, keys):
     """
     取得用户的大厅数据内容(即游戏gamedata:9999:<userId>存储的数据内容)
     @param userId: 用户ID
     @param keys: 数据字段列表,如果为空,则获取所有信息, 请使用HallKeys中定义的KEY值
     """
     if isinstance(keys, (str, unicode)):
         ret = DaoGameDataHall.HGET(userId, keys)
     else:
         ret = DaoGameDataHall.HMGET(userId, keys)
     return ret