From e4a5fbde4c804262a7cfd17d89d427b4ff36accb Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 十月 2025 19:41:26 +0800
Subject: [PATCH] 225 【付费内容】功能基金-服务端
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py | 136 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 117 insertions(+), 19 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 6e63e0f..5bc9315 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
@@ -20,10 +20,12 @@
import ShareDefine
import PlayerControl
import NetPackCommon
+import PlayerViewCache
import ChPyNetSendPack
import PlayerFamilyTech
import PlayerFamilyEmblem
import PlayerFamilyZhenfa
+import PlayerFamilyZhenbaoge
import IPY_PlayerDefine
import IpyGameDataPY
import IPY_GameWorld
@@ -68,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
@@ -75,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):
@@ -89,7 +101,7 @@
PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
__FamilyAffair_CheckReset(curPlayer)
PlayerFamilyZhenfa.OnPlayerLogin(curPlayer)
- #PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer)
+ PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer)
return
def OnPlayerLogout(curPlayer):
@@ -194,12 +206,12 @@
if not PlayerControl.PayMoney(curPlayer, moneyType, needMoney, "CreateFamily"):
return
- newFamilyID = random.randint(10000, 20000) # 先随机,之后替换接口
serverID = GameWorld.GetPlayerServerID(curPlayer)
- curFamily = familyMgr.AddFamily(newFamilyID, fullFamilyName, serverID)
+ curFamily = familyMgr.AddFamily(fullFamilyName, serverID)
if curFamily == None:
GameWorld.ErrLog("创建家族失败", playerID)
return
+ newFamilyID = curFamily.GetID()
curFamily.SetLV(1)
emblemIDList = PlayerFamilyEmblem.GetDefaultFamilyEmblemIDList()
if not emblemID or emblemID not in emblemIDList:
@@ -214,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):
@@ -319,7 +331,6 @@
#玩家缓存
#PlayerViewCache.OnPlayerFamilyChange(jionPlayer.GetPlayerID(), curFamily.GetID(), curFamily.GetName())
- #PlayerTeam.OnTeamMemFamilyRefresh(jionPlayer, curFamily.GetID())
#SetMemberFightPower(familyMember, PlayerControl.GetFightPower(jionPlayer))
#GetFamilyMgr().AddFamilyIDToFightPowerChangeList(curFamily.GetID(), jionPlayer.GetPlayerID())
return
@@ -397,7 +408,6 @@
#触发家族升级事件, 在SetFamilyLV之后,任务可以取等级判定
if isLVUP:
pass
- #EventShell.EventResponse_OnFamilyLVUp(curPlayer)
if lastFamilyID != 0 and curPlayer.GetFamilyID() == 0:
#玩家离开家族
@@ -407,7 +417,6 @@
#刚进家族并为族长,触发建家族事件
if curPlayer.GetFamilyMemberLV() == IPY_GameWorld.fmlLeader:
pass
- #EventShell.EventResponse_OnCreateFamily(curPlayer)
#进入家族触发事件
__OnEnterFamily(curPlayer, tick)
@@ -421,13 +430,8 @@
familyMgr = DBDataMgr.GetFamilyMgr()
familyMgr.DelPlayerReqJoinFamilyIDAll(curPlayer.GetPlayerID())
Sync_RequestAddFamilyInfo(curPlayer)
- #EventShell.EventResponse_OnFamily(curPlayer)
__FamilyAffair_CheckReset(curPlayer)
PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
- #GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
- #GameLogic_FamilyBoss.OnEnterFamily(curPlayer)
- #PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
- #PlayerFamilyZhenfa.OnEnterFamily(curPlayer)
return
def __OnLeaveFamily(curPlayer, tick):
@@ -440,8 +444,6 @@
curPlayer.SetFamilyLV(0)
PlayerControl.SetLeaveFamilyTimeEx(curPlayer, int(time.time()))
- #触发玩家离开家族的任务
- #EventShell.EventResponse_OnLeaveFamily(curPlayer)
FBLogic.OnLeaveFamily(curPlayer, tick)
return
@@ -755,7 +757,7 @@
reqInfo.ReqTime = reqTime
if curPlayer:
reqInfo.IsOnLine = True
- viewCache = DBDataMgr.GetPlayerViewCacheMgr().FindViewCache(playerID)
+ viewCache = PlayerViewCache.FindViewCache(playerID)
if viewCache:
reqInfo.Name = viewCache.GetPlayerName()
reqInfo.NameLen = len(reqInfo.Name)
@@ -1355,6 +1357,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
@@ -1535,7 +1633,7 @@
starInfo = affairStarDict.get(str(star), [])
needDuration = starInfo[1] if len(starInfo) > 1 else 0
# 可扩展减时长属性
- speedPer = PlayerControl.GetAffairSpeedPer(curPlayer)
+ speedPer = 0#PlayerControl.GetAffairSpeedPer(curPlayer)
if speedPer:
needDuration = int(needDuration * max(10000 - speedPer, 0) / 10000.0)
#GameWorld.DebugLog("事务加速: needDuration=%s,speedPer=%s" % (needDuration, speedPer), curPlayer.GetPlayerID())
--
Gitblit v1.8.0