| | |
| | | import NetPackCommon
|
| | | import PyDataManager
|
| | | import PyGameData
|
| | | import PlayerBillboard
|
| | | import PlayerActBossTrial
|
| | | import PlayerCompensation
|
| | | import PlayerFamilyParty
|
| | | import PlayerFamilySWRH
|
| | |
| | | if not family:
|
| | | return 0
|
| | | return GetFamilyTotalFightPower(family)
|
| | | # 徽章
|
| | | def GetFamilyEmblem(curFamily): return curFamily.GetExtra6()
|
| | | def SetFamilyEmblem(curFamily, value): return curFamily.SetExtra6(value)
|
| | |
|
| | | # 公告修改次数
|
| | | def GetFamilyBroadcastCnt(curFamily): return curFamily.GetExtra3()
|
| | |
| | | def GetMemberJoinTime(curMember): return curMember.GetExattr4()
|
| | | def SetMemberJoinTime(curMember, joinTime): return curMember.SetExattr4(joinTime)
|
| | | #----------------------------------------------------------------------
|
| | |
|
| | | def OnGameServerInitOK():
|
| | | ## 服务器启动成功处理
|
| | | DoFamilySort()
|
| | | return
|
| | |
|
| | | def OnMixServerInit():
|
| | | ## 合服后首次启动成功处理
|
| | | |
| | | # 仙盟联赛重置
|
| | | GameWorldFamilyWar.DoFamilyWarReset()
|
| | | # 重置所有仙盟联赛评级
|
| | | familyManager = GameWorld.GetFamilyManager()
|
| | | for i in xrange(familyManager.GetCount()):
|
| | | family = familyManager.GetAt(i)
|
| | | SetFamilyWarRank(family, 0)
|
| | | |
| | | # 仙盟榜相关榜单重新上榜
|
| | | familyID = family.GetID()
|
| | | familyBillInfo = GetFamilyBillboardInfo(family)
|
| | | |
| | | familySubmitTotal = PlayerActBossTrial.GetFamilySubmitTotalByID(familyID)
|
| | | PlayerBillboard.UpdateFamilyBillboard(ShareDefine.Def_BT_BossTrialSubmitFamily, familyBillInfo, familySubmitTotal)
|
| | | |
| | | DoFamilySort()
|
| | | return
|
| | |
|
| | | def OnLoadDBPlayerOK():
|
| | | ## 服务器启动加载DB玩家成功处理
|
| | | |
| | | # 检查仙盟ServerID
|
| | | familyManager = GameWorld.GetFamilyManager()
|
| | | for i in xrange(familyManager.GetCount()):
|
| | | family = familyManager.GetAt(i)
|
| | | if family.GetServerID():
|
| | | continue
|
| | | familyID = family.GetID()
|
| | | # 没有则默认取盟主的
|
| | | leaderID = family.GetLeaderID()
|
| | | leaderAccID = PlayerControl.GetDBPlayerAccIDByID(leaderID)
|
| | | if not leaderAccID:
|
| | | continue
|
| | | serverID = GameWorld.GetAccIDServerID(leaderAccID)
|
| | | family.SetServerID(serverID)
|
| | | GameWorld.Log("启动更新仙盟所属服务器ID: familyID=%s,serverID=%s,leaderID=%s,%s" % (familyID, serverID, leaderID, leaderAccID))
|
| | | |
| | | return
|
| | |
|
| | | def RandomFakeFamily():
|
| | | '''随机3个假仙盟'''
|
| | |
| | | return
|
| | | GameWorld.Log("创建仙盟: familyID=%s,playerID=%s" % (curFamily.GetID(), curPlayerID))
|
| | | #---创建家族---
|
| | | curFamily.SetServerID(GameWorld.GetAccIDServerID(curPlayer.GetAccID()))
|
| | | curFamily.SetCreateTime(GameWorld.GetCurrentDataTimeStr())
|
| | | curFamily.SetLV(1)
|
| | | curFamily.SetAcceptJoin(ShareDefine.FamilyAcceptJoin_Agree) #设置收人方式为直接通过申请
|
| | |
| | |
|
| | | ##--------------------------------------------------------------------------------------------------
|
| | |
|
| | | def GetFamilyBillboardInfo(curFamily):
|
| | | ## 获取仙盟榜单信息 区服ID、徽章、仙盟名、盟主名、仙盟总战力、仙盟等级
|
| | | familyID = curFamily.GetID()
|
| | | name = curFamily.GetName()
|
| | | id2 = curFamily.GetLeaderID()
|
| | | name2 = curFamily.GetLeaderName()
|
| | | fightPower = GetFamilyTotalFightPower(curFamily)
|
| | | value1 = fightPower / ChConfig.Def_PerPointValue
|
| | | value2 = fightPower % ChConfig.Def_PerPointValue
|
| | | value3 = GetFamilyEmblem(curFamily)
|
| | | value4 = curFamily.GetLV()
|
| | | value5 = curFamily.GetServerID()
|
| | | return {"id":familyID, "name":name, "id2":id2, "name2":name2, "value1":value1, "value2":value2, |
| | | "value3":value3, "value4":value4, "value5":value5}
|
| | |
|