From d7415e1acc3cfaae895597d889bf4f5d56d85ad0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 31 七月 2023 16:34:55 +0800
Subject: [PATCH] 9788 【BT9】【后端】成就系统(新增成就类型164~175)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py
index f6b51be..dea19da 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py
@@ -183,8 +183,14 @@
for i in xrange(ipyMgr.GetQuestionBankCount()):
ipyData = ipyMgr.GetQuestionBankByIndex(i)
questionID = ipyData.GetID()
+ try:
+ eval(ipyData.GetAnswer())
+ except:
+ GameWorld.ErrLog("答题题库答案异常,不处理! questionID=%s,answer=%s" % (questionID, ipyData.GetAnswer()))
+ continue
allQuestionIDList.append(questionID)
IpyGameDataPY.SetConfigEx('AllQuestionID', allQuestionIDList)
+ GameWorld.Log("加载仙盟宴会答题题库ID! %s" % str(allQuestionIDList))
if not allQuestionIDList:
GameWorld.ErrLog('仙盟宴会题库没有题目!')
return
@@ -200,8 +206,12 @@
ipyData = IpyGameDataPY.GetIpyGameData('QuestionBank', lastQuestionID)
if ipyData:
answer = ipyData.GetAnswer()
- answer = answer.replace('[', '')
- answer = answer.replace(']', '')
+ #不能用replace, 可能导致替换错误, 如 ['望廬山瀑布'] 为 "['\xcd\xfb\x8f]\xc9\xbd\xc6\xd9\xb2\xbc']" 中间有个 ] 替换会导致乱码
+ #answer = answer.replace('[', '')
+ #answer = answer.replace(']', '')
+ answer = answer.strip()
+ if answer.startswith("[") and answer.endswith("]"):
+ answer = answer[1:-1]
PlayerControl.FamilyNotify(familyID, 'Party_Correct', [maxSecond, GameWorld.GbkToCode(answer)])
for index in xrange(family.GetCount()):
--
Gitblit v1.8.0