From 93b6f00c8b142fee8560d58c54d71de135584788 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 03 十二月 2021 18:48:52 +0800 Subject: [PATCH] 9341 【BT5】【主干】【后端】情缘系统(增加魅力等级属性;伴侣亲密度等级属性;优化已成亲的伴侣再次提亲时直接成亲) --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 40 insertions(+), 15 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py index 7eeaebd..5cd5ace 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py @@ -358,6 +358,15 @@ def OnPlayerLogin(curPlayer): PyDataManager.GetDBPyUnNotifyLoveGiftRecManager().LoginNotify(curPlayer) + + # 同步伴侣亲密度 + playerID = curPlayer.GetPlayerID() + couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID) + if couple: + coupleID = couple.GetCoupleID(playerID) + intimacys = PyDataManager.GetIntimacyManager().GetIntimacys(playerID) + intimacys.SyncMapServerIntimacy(curPlayer, coupleID) + Sync_CoupleInfo(curPlayer) Sync_CandyList(curPlayer) return @@ -458,7 +467,7 @@ __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK) return -def __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK): +def __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK, needResponse=True): ''' 提亲回应 @param curPlayer: 回应玩家 @param reqPlayer: 提亲玩家 @@ -476,20 +485,22 @@ reqPlayerName = reqPlayer.GetName() if reqPlayer else PlayerSocial.GetSocialPlayerName(reqPlayerID) playerName = curPlayer.GetName() - responsePack = ChPyNetSendPack.tagGCMarryResponseRet() - responsePack.PlayerIDA = reqPlayerID - responsePack.PlayerNameA = reqPlayerName - responsePack.NameALen = len(responsePack.PlayerNameA) - responsePack.PlayerIDB = playerID - responsePack.PlayerNameB = playerName - responsePack.NameBLen = len(responsePack.PlayerNameB) - responsePack.IsOK = isOK - if reqPlayer: - NetPackCommon.SendFakePack(reqPlayer, responsePack) # 必回复提亲方 + if needResponse: + responsePack = ChPyNetSendPack.tagGCMarryResponseRet() + responsePack.PlayerIDA = reqPlayerID + responsePack.PlayerNameA = reqPlayerName + responsePack.NameALen = len(responsePack.PlayerNameA) + responsePack.PlayerIDB = playerID + responsePack.PlayerNameB = playerName + responsePack.NameBLen = len(responsePack.PlayerNameB) + responsePack.IsOK = isOK + if reqPlayer: + NetPackCommon.SendFakePack(reqPlayer, responsePack) # 必回复提亲方 # 拒绝 if not isOK: return - NetPackCommon.SendFakePack(curPlayer, responsePack) # 回应方仅同意时同步 + if needResponse: + NetPackCommon.SendFakePack(curPlayer, responsePack) # 回应方仅同意时同步 # ===================== 以下执行成亲逻辑 ===================== GameWorld.Log("执行成亲: reqPlayerID=%s,playerID=%s,bridePriceID=%s" % (reqPlayerID, playerID, bridePriceID), playerID) @@ -540,7 +551,11 @@ if not player: continue mapServerCoupleInfo = couple.GetSendMapServerCoupleInfo(player.GetPlayerID()) - dataMsg = [reqPlayerID, bridePriceID, mapServerCoupleInfo] + + curIntimacys = PyDataManager.GetIntimacyManager().GetIntimacys(player.GetPlayerID()) + coupleIntimacy = curIntimacys.GetTagIntimacy(couple.GetCoupleID(player.GetPlayerID())) if curIntimacys else 0 + + dataMsg = [reqPlayerID, bridePriceID, mapServerCoupleInfo, coupleIntimacy] MapServer_QueryPlayer_DoLogic_Love(player, "MarrySuccess", dataMsg, playerID) Sync_CoupleInfo(player) @@ -841,6 +856,7 @@ if not __MarryCheckComm(curPlayer, tagPlayer, tagPlayerID, True): return + curTime = int(time.time()) playerID = curPlayer.GetPlayerID() if (playerID, tagPlayerID) in PyGameData.g_marryCandyInfo or (tagPlayerID, playerID) in PyGameData.g_marryCandyInfo: @@ -865,8 +881,17 @@ GameWorld.Log("聘礼提亲次数不足,无法提亲! bridePriceID=%s,buyCount(%s) >= canBuyMax(%s)" % (bridePriceID, buyCount, canBuyMax), playerID) return - - curTime = int(time.time()) + + GameWorld.Log("已成亲的伴侣再次提亲,直接成亲! tagPlayerID=%s,coupleID=%s" % (tagPlayerID, coupleID), playerID) + reqData = MarryReq() + reqData.playerIDA = playerID + reqData.playerIDB = tagPlayerID + reqData.bridePriceID = bridePriceID + reqData.reqTime = curTime + PyGameData.g_marryReqInfo[playerID] = reqData + __DoMarryResponse(tagPlayer, curPlayer, playerID, 1, False) + return + if tagPlayerID in PyGameData.g_marryReqInfo: tagReqData = PyGameData.g_marryReqInfo[tagPlayerID] tagBridePriceID = tagReqData.bridePriceID -- Gitblit v1.8.0