#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
#
|
#---------------------------------------------------------------------
|
##@package PlayerFamilySWRH
|
# @todo: ÊØÎÀÈË»Ê
|
#
|
# @author: xdh
|
# @date 2018-04-02
|
# @version 1.0
|
#
|
#---------------------------------------------------------------------
|
#"""Version = 2018-04-02 16:00"""
|
#---------------------------------------------------------------------
|
import GameWorld
|
import PyGameData
|
import ChPyNetSendPack
|
import NetPackCommon
|
import ShareDefine
|
import ChConfig
|
import copy
|
#---------------------------------------------------------------------
|
|
def OnLogin(curPlayer):
|
familyID = curPlayer.GetFamilyID()
|
if familyID:
|
NotifySWRHInfo(curPlayer, familyID)
|
return
|
|
def SWRHFBOver(familyID):
|
if familyID not in PyGameData.g_swrhJoinRecord:
|
PyGameData.g_swrhJoinRecord.append(familyID)
|
|
NotifySWRHFamily(familyID)
|
return
|
|
def NotifySWRHFamily(familyID):
|
#֪ͨ
|
family = GameWorld.GetFamilyManager().FindFamily(familyID)
|
if not family:
|
return
|
for i in range(0, family.GetCount()):
|
notifyMember = family.GetAt(i)
|
curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(notifyMember.GetPlayerID())
|
if curPlayer == None:
|
continue
|
NotifySWRHInfo(curPlayer, familyID)
|
return
|
|
def NotifySWRHInfo(curPlayer, familyID):
|
familySWRHInfo = ChPyNetSendPack.tagGCFamilySWRHInfo()
|
familySWRHInfo.HasJoin = familyID in PyGameData.g_swrhJoinRecord
|
NetPackCommon.SendFakePack(curPlayer, familySWRHInfo)
|
return
|
|
|
def OnSWRHStateChange(dictName, isOpen):
|
|
copyJoinRecord = copy.deepcopy(PyGameData.g_swrhJoinRecord)
|
PyGameData.g_swrhJoinRecord = []
|
|
if isOpen:
|
for familyID in copyJoinRecord:
|
NotifySWRHFamily(familyID)
|
|
return
|
|
#ÊÇ·ñÔÚÊØÎÀÈ˻ʻÖÐ
|
def IsInFamilySWRH():return GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyInvade)
|
|