From de17a057f7a93fe8c9ccb04dd44023b4c8ed1161 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 26 五月 2025 18:35:49 +0800 Subject: [PATCH] 16 卡牌服务端(仙盟珍宝阁支持;仙盟行为数据查询通知;去除特殊时间5点过天、过周、过月逻辑,统一保留0点触发;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 112 insertions(+), 5 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py index eeb08bc..66ac5ec 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py @@ -25,6 +25,7 @@ import PlayerFamilyTech import PlayerFamilyEmblem import PlayerFamilyZhenfa +import PlayerFamilyZhenbaoge import IPY_PlayerDefine import IpyGameDataPY import IPY_GameWorld @@ -69,6 +70,18 @@ IPY_PlayerDefine.fmlViceLeader:"DeputyLeaderMax", } +def FamilyOnDay(): + if GameWorld.IsCrossServer(): + return + + familyManager = DBDataMgr.GetFamilyMgr() + for i in range(0, familyManager.GetCount()): + family = familyManager.GetAt(i) + #珍宝阁 + PlayerFamilyZhenbaoge.OnDay(family) + + return + def PlayerOnDay(curPlayer): if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Family): return @@ -76,9 +89,7 @@ Sync_FamilyDayRewardState(curPlayer) __FamilyAffair_Refresh(curPlayer, True) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeCut, 0) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeBuy, 0) - #PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer) + PlayerFamilyZhenbaoge.PlayerOnDay(curPlayer) return def OnPlayerLogin(curPlayer, tick): @@ -90,7 +101,7 @@ PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer) __FamilyAffair_CheckReset(curPlayer) PlayerFamilyZhenfa.OnPlayerLogin(curPlayer) - #PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer) + PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer) return def OnPlayerLogout(curPlayer): @@ -215,7 +226,7 @@ #XW_JZ_EstablishSud <n color="255,255,0">恭喜您,家族建立成功!</n> 25 - - PlayerControl.NotifyCode(curPlayer, "XW_JZ_EstablishSud") PlayerControl.WorldNotify(0, "jiazu_liubo_671654", [curPlayer.GetName(), fullFamilyName, newFamilyID]) - #PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily) + PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily) return def CheckInputFamilyName(curPlayer, inputName): @@ -1356,6 +1367,102 @@ ## ------------------------------------------------------------------------------------------------ +#// A6 17 查询家族行为信息 #tagCMQueryFamilyAction +# +#struct tagCMQueryFamilyAction +#{ +# tagHead Head; +# BYTE ActionType; // 行为类型 +# DWORD FamilyID; // 家族ID,发0默认自己家族 +#}; +def OnQueryFamilyAction(index, cliendData, tick): + curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) + + if not curPlayer: + return + + actionType = cliendData.ActionType + familyID = cliendData.FamilyID + if not familyID: + familyID = curPlayer.GetFamilyID() + + SendFamilyActionInfo(curPlayer, familyID, actionType) + return + +def SendFamilyActionInfo(curPlayer, familyID, actionType): + ## 发送家族行为 + # @param curPlayer: 为None时通知该仙盟所有成员 + + familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, actionType) + + clientPack = ChPyNetSendPack.tagMCFamilyActionInfo() + clientPack.FamilyID = familyID + clientPack.ActionType = actionType + clientPack.FamilyActionList = [] + + for index in xrange(familyAction.Count()): + familyActionData = familyAction.At(index) + + actionData = ChPyNetSendPack.tagMCFamilyAction() + actionData.Time = familyActionData.GetTime() + actionData.Name = familyActionData.GetName() + actionData.NameLen = len(actionData.Name) + actionData.Value1 = familyActionData.GetValue1() + actionData.Value2 = familyActionData.GetValue2() + actionData.Value3 = familyActionData.GetValue3() + actionData.Value4 = familyActionData.GetValue4() + actionData.Value5 = familyActionData.GetValue5() + actionData.Value6 = familyActionData.GetValue6() + actionData.UseData = familyActionData.GetUserData() + actionData.UseDataLen = len(actionData.UseData) + clientPack.FamilyActionList.append(actionData) + + clientPack.Count = len(clientPack.FamilyActionList) + + if curPlayer: + NetPackCommon.SendFakePack(curPlayer, clientPack) + return + Broadcast_FamilyPack(familyID, clientPack) + return + +def SendFamilyAction(actionDataList, curPlayer=None): + ## 同步指定仙盟action + # @param actionDataList: 支持列表或指定actionData + # @param curPlayer: 为None时通知该仙盟所有成员 + if not isinstance(actionDataList, list): + actionDataList = [actionDataList] + if not actionDataList: + return + familyActionData = actionDataList[0] + familyID = familyActionData.GetFamilyID() + actionType = familyActionData.GetActionType() + + clientPack = ChPyNetSendPack.tagMCFamilyActionInfo() + clientPack.FamilyID = familyID + clientPack.ActionType = actionType + clientPack.FamilyActionList = [] + for familyActionData in actionDataList: + actionData = ChPyNetSendPack.tagMCFamilyAction() + actionData.Time = familyActionData.GetTime() + actionData.Name = familyActionData.GetName() + actionData.NameLen = len(actionData.Name) + actionData.Value1 = familyActionData.GetValue1() + actionData.Value2 = familyActionData.GetValue2() + actionData.Value3 = familyActionData.GetValue3() + actionData.Value4 = familyActionData.GetValue4() + actionData.Value5 = familyActionData.GetValue5() + actionData.Value6 = familyActionData.GetValue6() + actionData.UseData = familyActionData.GetUserData() + actionData.UseDataLen = len(actionData.UseData) + clientPack.FamilyActionList.append(actionData) + clientPack.Count = len(clientPack.FamilyActionList) + + if curPlayer: + NetPackCommon.SendFakePack(curPlayer, clientPack) + return + Broadcast_FamilyPack(familyID, clientPack) + return + def GetFamilyDayAward(curPlayer): ##领取仙盟每日奖励 2小时脱机挂时间 return -- Gitblit v1.8.0