1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/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
#---------------------------------------------------------------------
 
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)
    
    #֪ͨ
    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):
    PyGameData.g_swrhJoinRecord = []
    
    
    return
 
#ÊÇ·ñÔÚÊØÎÀÈ˻ʻÖÐ
def IsInFamilySWRH():return GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyInvade)