def _buildMailAndMessageAndChanged(gameId, userAssets, action, assetList, replaceParams): changed = assetutils.getChangeDataNames(assetList) if assetList else set() mail = ftstr.replaceParams(action.mail, replaceParams) message = ftstr.replaceParams(action.message, replaceParams) # if mail: # pluginCross.hallmessage.sendMessageSystem(userAssets.userId, gameId, mail, None, None) # changed.add('message') changed.discard('item') return mail, message, changed
def getInputParams(self, gameId, userBag, item, timestamp): ret = ftstr.cloneData(self.inputParams) desc = ret.get('desc', '') status = pluginCross.hallsubmember.loadSubMemberStatus(userBag.userId) unsubDesc = status.unsubDesc or '' ret['desc'] = ftstr.replaceParams(desc, {'unsubDesc': unsubDesc}) return ret
def _rankSendReward(self, userId, gameId, data, mail, eventId, intEventParam): assetList = self.addAssets(userId, gameId, data.get('content'), eventId, intEventParam) if mail: params = { 'rank': data.get('rank'), 'rewardContent': self.buildContentsString(assetList) } mail = ftstr.replaceParams(mail, params) pluginCross.hallmessage.sendMessageSystem(userId, gameId, mail)
def getTreasureTableTip(gameId, bigRoomId): ''' 获取循环任务奖励描述 ''' tbconfigers = majiang_conf.getTreasureBoxRoomInfo(gameId, bigRoomId, ROOM_PATH) if tbconfigers : desc = majiang_conf.getTreasureBoxDescInfo(gameId, ROOM_PATH) rRound = tbconfigers.get(ROUND_COUNT, 0) prize = tbconfigers.get('prize', '') if rRound > 0: newDesc = ftstr.replaceParams(desc, {"round": rRound, "prize": prize}) return newDesc return ''
def getWinStreakTableTip(tableConfig, winCount): ''' 获取连胜任务奖励描述 ''' if tableConfig: desc = tableConfig.get(WIN_DESC, None) winCountInfo = _getWinStreakInfo(tableConfig, winCount) ftlog.debug('WinStreakTask.getWinStreakTableTip tableConfig:', tableConfig, 'desc:', desc, 'winCountInfo:', winCountInfo) if winCountInfo: winCount = winCountInfo.get(WIN_COUNT, 0) prize = winCountInfo.get('prize', '') if winCount > 0: newDesc = ftstr.replaceParams(desc, { "round": winCount, "prize": prize }) return newDesc return ''