From 656287d14af42629399f33b9e0864c9d8e479111 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期二, 30 十月 2018 15:02:49 +0800 Subject: [PATCH] 4418 【后端】【1.2.0】仙盟宴会答题优化 --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py index 2c4c5dd..3d37919 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py @@ -31,6 +31,7 @@ import random FamilyPartyFB_QuestionID = 'FamilyPartyFB_QuestionID%s' #当前题ID +FamilyPartyFB_QuestionTick = 'FamilyPartyFB_QuestionTick%s' #当前题出题时间 FamilyPartyFB_AnswerTick = 'FamilyPartyFB_AnswerTick%s' #答对时间 @@ -166,12 +167,20 @@ for i in range(0, familyManager.GetCount()): family = familyManager.GetAt(i) familyID = family.GetID() - - if gameWorld.GetDictByKey(FamilyPartyFB_QuestionID % familyID): + lastQuestionID = gameWorld.GetDictByKey(FamilyPartyFB_QuestionID % familyID) + if lastQuestionID: #还有题未答 - continue + if tick - gameWorld.GetDictByKey(FamilyPartyFB_QuestionTick % familyID) > IpyGameDataPY.GetFuncCfg('FairyCorrectAnswer')*1000: + ipyData = IpyGameDataPY.GetIpyGameData('QuestionBank', lastQuestionID) + if ipyData: + answer = ipyData.GetAnswer() + answer = answer.replace('[', '') + answer = answer.replace(']', '') + PlayerControl.FamilyNotify(familyID, 'Party_Correct', [GameWorld.GbkToCode(answer)]) + else: + continue answerTick = gameWorld.GetDictByKey(FamilyPartyFB_AnswerTick % familyID) - if tick - answerTick < 5000: + if not lastQuestionID and tick - answerTick < 5000: continue #随机题目 @@ -186,6 +195,8 @@ break gameWorld.SetDict(FamilyPartyFB_QuestionID % familyID, questionID) + gameWorld.SetDict(FamilyPartyFB_QuestionTick % familyID, tick) + PlayerControl.FamilyNotify(familyID, 'Party_Topic', [questionID]) return @@ -207,6 +218,7 @@ if not ipyData: GameWorld.ErrLog('仙盟宴会答题 该题不存在,异常 questionID=%s, 重新出题'%questionID) gameWorld.SetDict(FamilyPartyFB_QuestionID % curFamilyid, 0) + gameWorld.SetDict(FamilyPartyFB_QuestionTick % curFamilyid, 0) return answerList = eval(ipyData.GetAnswer()) -- Gitblit v1.8.0