|  |  |  | 
|---|
|  |  |  | PyGameData.g_marryReqInfo.pop(reqPlayerID, None) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK) | 
|---|
|  |  |  | __DoMarryResponse(curPlayer, playerID, reqPlayer, reqPlayerID, isOK) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK, needResponse=True): | 
|---|
|  |  |  | def __DoMarryResponse(curPlayer, playerID, reqPlayer, reqPlayerID, isOK, needResponse=True): | 
|---|
|  |  |  | ''' 提亲回应 | 
|---|
|  |  |  | @param curPlayer: 回应玩家 | 
|---|
|  |  |  | @param reqPlayer: 提亲玩家 | 
|---|
|  |  |  | 
|---|
|  |  |  | if not ipyData: | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | playerID = curPlayer.GetPlayerID() | 
|---|
|  |  |  | #playerID = curPlayer.GetPlayerID() | 
|---|
|  |  |  | reqPlayerName = reqPlayer.GetName() if reqPlayer else PlayerSocial.GetSocialPlayerName(reqPlayerID) | 
|---|
|  |  |  | playerName = curPlayer.GetName() | 
|---|
|  |  |  | playerName = curPlayer.GetName() if curPlayer else PlayerSocial.GetSocialPlayerName(playerID) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if needResponse: | 
|---|
|  |  |  | responsePack = ChPyNetSendPack.tagGCMarryResponseRet() | 
|---|
|  |  |  | 
|---|
|  |  |  | # 拒绝 | 
|---|
|  |  |  | if not isOK: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | if needResponse: | 
|---|
|  |  |  | if needResponse and curPlayer: | 
|---|
|  |  |  | NetPackCommon.SendFakePack(curPlayer, responsePack) # 回应方仅同意时同步 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # ===================== 以下执行成亲逻辑 ===================== | 
|---|
|  |  |  | 
|---|
|  |  |  | if PyDataManager.GetBlacklistManager().CheckBlacklistBoth(playerID, tagPlayerID, curPlayer): | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if not tagPlayer or PlayerControl.GetIsTJG(tagPlayer): | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "LoveOffline") # 离线 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curCouple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID) | 
|---|
|  |  |  | if curCouple and curCouple.GetCoupleID(playerID) != tagPlayerID: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "HaveCouple") # 已经有其他伴侣了 | 
|---|
|  |  |  | 
|---|
|  |  |  | if tagCouple and tagCouple.GetCoupleID(tagPlayerID) != playerID: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "TagHaveCouple") # 对方已经有其他伴侣了 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if not tagPlayer or PlayerControl.GetIsTJG(tagPlayer): | 
|---|
|  |  |  | if not curCouple: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "LoveOffline") # 离线 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 回应方可不检查亲密度 | 
|---|
|  |  |  | if checkIntimacy: | 
|---|
|  |  |  | 
|---|
|  |  |  | reqData.bridePriceID = bridePriceID | 
|---|
|  |  |  | reqData.reqTime = curTime | 
|---|
|  |  |  | PyGameData.g_marryReqInfo[playerID] = reqData | 
|---|
|  |  |  | __DoMarryResponse(tagPlayer, curPlayer, playerID, 1, False) | 
|---|
|  |  |  | __DoMarryResponse(tagPlayer, tagPlayerID, curPlayer, playerID, 1, False) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if tagPlayerID in PyGameData.g_marryReqInfo: | 
|---|
|  |  |  | 
|---|
|  |  |  | reqData.bridePriceID = bridePriceID | 
|---|
|  |  |  | reqData.reqTime = curTime | 
|---|
|  |  |  | PyGameData.g_marryReqInfo[playerID] = reqData | 
|---|
|  |  |  | if __DoMarryResponse(tagPlayer, curPlayer, playerID, 1): | 
|---|
|  |  |  | if __DoMarryResponse(tagPlayer, tagPlayerID, curPlayer, playerID, 1): | 
|---|
|  |  |  | return | 
|---|
|  |  |  | GameWorld.Log("玩家提亲时,目标刚好已经先提过亲,且在有效期内,直接成亲!tagPlayerID=%s,tagBridePriceID=%s,bridePriceID=%s" | 
|---|
|  |  |  | % (tagPlayerID, tagBridePriceID, bridePriceID), playerID) | 
|---|
|  |  |  | if __DoMarryResponse(curPlayer, tagPlayer, tagPlayerID, 1): | 
|---|
|  |  |  | if __DoMarryResponse(curPlayer, playerID, tagPlayer, tagPlayerID, 1): | 
|---|
|  |  |  | return | 
|---|
|  |  |  | else: | 
|---|
|  |  |  | GameWorld.DebugLog("对方有提亲,但是对象不一样或已超时! tagPlayerID=%s, timeout=%s" % (tagReqData.playerIDB, __CheckMarryReqTimeout(tagReqData)), playerID) | 
|---|