9341 【BT5】【主干】【后端】情缘系统(1.删除拉黑伴侣限制提示;2.邮件支持配置物品邮件过天不删除;3.礼物魅力字段改为支持小数;4.合服首登同步魅力榜)
| | |
| | | struct tagLoveGift
|
| | | {
|
| | | BYTE _GiftNum; //聘礼ID
|
| | | DWORD AddCharmSelf; //单个增加自身魅力
|
| | | DWORD AddCharmTag; //单个增加对方魅力
|
| | | float AddCharmSelf; //单个增加自身魅力
|
| | | float AddCharmTag; //单个增加对方魅力
|
| | | DWORD AddIntimacy; //单个增加双方亲密度
|
| | | char WorldNotifyKey; //广播key
|
| | | };
|
| | |
| | |
|
| | | "LoveGift":(
|
| | | ("BYTE", "GiftNum", 1),
|
| | | ("DWORD", "AddCharmSelf", 0),
|
| | | ("DWORD", "AddCharmTag", 0),
|
| | | ("float", "AddCharmSelf", 0),
|
| | | ("float", "AddCharmTag", 0),
|
| | | ("DWORD", "AddIntimacy", 0),
|
| | | ("char", "WorldNotifyKey", 0),
|
| | | ),
|
| | |
| | | |
| | | def __init__(self): |
| | | self.GiftNum = 0
|
| | | self.AddCharmSelf = 0
|
| | | self.AddCharmTag = 0
|
| | | self.AddCharmSelf = 0.0
|
| | | self.AddCharmTag = 0.0
|
| | | self.AddIntimacy = 0
|
| | | self.WorldNotifyKey = "" |
| | | return |
| | |
| | |
|
| | | return
|
| | |
|
| | | def DoPlayerRealLoginOK(curPlayer, tick):
|
| | | def DoPlayerRealLoginOK(curPlayer, loginMsg, tick):
|
| | | ''' 玩家最终登录成功处理, 由 MapServer DoPlayerRealLoginOK 通知
|
| | | 该函数为地图最终登录成功才会执行到,以后一些功能类的登录处理建议均写到这里
|
| | | 旧的功能先不动( __DoPlayerLoginServer 函数中的功能),如果有登录相关的bug再考虑是否移动到此函数
|
| | | '''
|
| | | |
| | | GameWorld.Log("GameServer->DoPlayerRealLoginOK", curPlayer.GetPlayerID())
|
| | | isMixServerFirstLogin = loginMsg[0]
|
| | | GameWorld.Log("GameServer->DoPlayerRealLoginOK, isMixServerFirstLogin=%s" % isMixServerFirstLogin, curPlayer.GetPlayerID())
|
| | |
|
| | | if not PlayerControl.GetIsTJG(curPlayer):
|
| | | #家族副本boss状态通知
|
| | |
| | | #情缘
|
| | | PlayerLove.OnPlayerLogin(curPlayer)
|
| | |
|
| | | if isMixServerFirstLogin:
|
| | | PlayerCharm.OnMixServerFirstLogin(curPlayer)
|
| | | |
| | | return
|
| | |
|
| | | def __UpdOnedayJobPlayerLoginoffTime(curPlayer):
|
| | |
| | | Sync_PlayerCharmInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnMixServerFirstLogin(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | charmValueRecMgr = PyDataManager.GetDBPyCharmValueRecManager()
|
| | | if playerID not in charmValueRecMgr.charmTotalDict:
|
| | | return
|
| | | recTypeValueDict = charmValueRecMgr.charmTotalDict.get(playerID, {})
|
| | | charmTotal = recTypeValueDict.get(CharmValueRecType_Total, 0)
|
| | | charmWeek = recTypeValueDict.get(CharmValueRecType_Week, 0)
|
| | | charmDay = recTypeValueDict.get(CharmValueRecType_Day, 0)
|
| | | GameWorld.Log("合服首登同步魅力榜单: charmTotal=%s,charmWeek=%s,charmDay=%s" % (charmTotal, charmWeek, charmDay), playerID)
|
| | | PlayerBillboard.UpdatePlayerBillboardEx(curPlayer, playerID, ShareDefine.Def_BT_CharmTotal, charmTotal)
|
| | | PlayerBillboard.UpdatePlayerBillboardEx(curPlayer, playerID, ShareDefine.Def_BT_CharmWeek, charmWeek)
|
| | | PlayerBillboard.UpdatePlayerBillboardEx(curPlayer, playerID, ShareDefine.Def_BT_CharmDay, charmDay)
|
| | | return
|
| | |
|
| | | def GetPlayerCharmOfferSortList(playerID, recType):
|
| | | ## 获取排序后的玩家魅力贡献榜
|
| | |
|
| | |
| | | mailText = curMail.Text
|
| | | # 通知类模板邮件,过天可直接删除
|
| | | if tempSign in mailText and tempSignEnd in mailText and CheckCanDelCompensation(curMail, curMail.GUID):
|
| | | #tempKey = mailText[mailText.index(tempSign) + len(tempSign):mailText.index(tempSignEnd)]
|
| | | #GameWorld.DebugLog("过天删除无附件通知类邮件模板! tempKey=%s %s, %s" % (tempKey, curMail.PlayerID, curMail.GUID))
|
| | | needClearGUIDList.append([curMail.PlayerID, curMail.GUID])
|
| | | player = GameWorld.GetPlayerManager().FindPlayerByID(curMail.PlayerID)
|
| | | if player and player.GetInitOK():
|
| | | NotifyCompensationResult(player, curMail.GUID, 1)
|
| | | continue
|
| | | tempKey = mailText[mailText.index(tempSign) + len(tempSign):mailText.index(tempSignEnd)]
|
| | | notClearMailKeyList = IpyGameDataPY.GetFuncEvalCfg("MailSet", 1)
|
| | | if tempKey not in notClearMailKeyList:
|
| | | #GameWorld.DebugLog("过天删除无附件通知类邮件模板! tempKey=%s %s, %s" % (tempKey, curMail.PlayerID, curMail.GUID))
|
| | | needClearGUIDList.append([curMail.PlayerID, curMail.GUID])
|
| | | player = GameWorld.GetPlayerManager().FindPlayerByID(curMail.PlayerID)
|
| | | if player and player.GetInitOK():
|
| | | NotifyCompensationResult(player, curMail.GUID, 1)
|
| | | continue
|
| | |
|
| | | # 超过接收邮件30天则完全删除此邮件
|
| | | limitTime = datetime.datetime.strptime(curMail.CreateTime, ChConfig.TYPE_Time_Format) + datetime.timedelta(days = 30)
|
| | |
| | |
|
| | | couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
|
| | | if couple and couple.GetCoupleID(playerID) == friendID:
|
| | | GameWorld.Log('DeleteFriend -> 封包异常 ->伴侣不能删除好友.friendID=%s' % friendID, playerID)
|
| | | #GameWorld.Log('DeleteFriend -> 封包异常 ->伴侣不能删除好友.friendID=%s' % friendID, playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "DelFriendCoupleLimit")
|
| | | return
|
| | |
|
| | | #离线好友同时删除记录
|
| | |
| | |
|
| | | couple = PyDataManager.GetDBPyCoupleManager().GetCouple(curPlayer.GetID())
|
| | | if couple and couple.GetCoupleID(curPlayer.GetID()) == tagID:
|
| | | GameWorld.DebugLog("伴侣不能加入黑名单! tagID=%s" % tagID, curPlayer.GetID())
|
| | | #GameWorld.DebugLog("伴侣不能加入黑名单! tagID=%s" % tagID, curPlayer.GetID())
|
| | | PlayerControl.NotifyCode(curPlayer, "AddBlackCoupleLimit")
|
| | | return
|
| | |
|
| | | tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagID)
|
| | |
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | addCharmSelf = ipyData.GetAddCharmSelf() * giftCount
|
| | | addCharmTag = ipyData.GetAddCharmTag() * giftCount
|
| | | addCharmSelf = int(ipyData.GetAddCharmSelf() * giftCount)
|
| | | addCharmTag = int(ipyData.GetAddCharmTag() * giftCount)
|
| | | addIntimacy = ipyData.GetAddIntimacy() * giftCount
|
| | | worldNotifyKey = ipyData.GetWorldNotifyKey()
|
| | |
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | ChPlayer.DoPlayerRealLoginOK(curPlayer, tick)
|
| | | loginMsg = eval(resultName)
|
| | | ChPlayer.DoPlayerRealLoginOK(curPlayer, loginMsg, tick)
|
| | | return
|
| | |
|
| | | if callName == "SendMail":
|
| | |
| | | Def_PlayerKey_LoadMapIsLogin = 'LoadMapIsLogin' # 本次进入地图是否是登录的
|
| | | Def_PlayerKey_NotifyAllAttrState = 'NotifyAllAttrState' # 是否同步过所有属性,切图时第一次刷属性需要同步
|
| | | Def_PlayerKey_LoginTick = 'PlayerKey_LoginTick' # 玩家上线的当前服务器tick
|
| | | Def_PlayerKey_MixServerFirstLogin = 'MixServerFirstLogin' # 本次登录是否是合服首登
|
| | | Def_PlayerKey_CalcOLTimeTick = 'CalcOLTimeTick' # 上一次计算累计在线时长tick
|
| | | Def_PlayerKey_SitForZhenQi = 'PlayerKey_SitForZhenQi' # 打坐真气恢复时间
|
| | | Def_PlayerKey_Muse = 'PlayerKey_Muse' # 冥想恢复时间
|
| | |
| | | GameWorld.Log("MapServer->DoPlayerRealLoginOK", curPlayer.GetPlayerID())
|
| | |
|
| | | # 通知GameServer地图最终登录成功了
|
| | | msg = ""
|
| | | isMixServerFirstLogin = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MixServerFirstLogin)
|
| | | msg = str([isMixServerFirstLogin])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "PlayerRealLoginOK", msg, len(msg))
|
| | | return
|
| | |
|
| | |
| | | GameWorld.Log(" 新号不给合服奖励!", playerID)
|
| | | return
|
| | |
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MixServerFirstLogin, 1)
|
| | | |
| | | # 重置首充双倍
|
| | | PlayerCoin.DoResetCTGCount(curPlayer, "MixServer")
|
| | |
|