yyl
4 天以前 c124d98bdf9659cf764bebb799bee42c30eb152f
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
 
 
/** 玩家仙盟相关信息缓存数据 */
public class PlayerFairyData
{
    private bool hasFairy = false;
    public bool HasFairy
    {
        get { return hasFairy; }
    }
 
 
    public FairyData fairy = null;  //自己的公会数据
    public FairyMember mine = null;
    public event Action OnRefreshFairyInfo;
    public event Action OnRefreshFairyMine;
    private Dictionary<int, FairyMember> memberDic = new Dictionary<int, FairyMember>();
 
    // 0-成员,1-精英,2-副盟主,3-盟主
    public int leaderID;
    // // 精英
    // public List<int> elitePlayerIDList = new List<int>();
    // // 副盟主
    // public List<int> deputyLeaderPlayerIDList = new List<int>();
 
    public void OnRefreshGuildInfo(HA520_tagMCRoleFamilyInfo vNetData)
    {
        if (fairy == null)
        {
            fairy = new FairyData();
        }
        fairy.FamilyID = vNetData.FamilyID;
        if (fairy.FamilyID != 0) hasFairy = true;
        fairy.FamilyName = UIHelper.ServerStringTrim(vNetData.FamilyName);
        fairy.FamilyLV = vNetData.FamilyLV;
        fairy.FamilyLVExp = vNetData.FamilyLVExp;
        fairy.JoinReview = vNetData.JoinReview;
        fairy.JoinLVMin = vNetData.JoinLVMin;
        fairy.ServerID = vNetData.ServerID;
        fairy.EmblemID = vNetData.EmblemID;
        fairy.EmblemWord = vNetData.EmblemWord;
        fairy.totalFightPower = vNetData.FightPowerEx * Constants.ExpPointValue + vNetData.FightPower;
        fairy.Broadcast = vNetData.Broadcast;
        fairy.LeaderID = vNetData.LeaderID;
        fairy.MemberCount = vNetData.MemberCount;
 
        mine = null;
 
        memberDic.Clear();
        for (int i = 0; i < vNetData.MemberCount; i++)
        {
            FairyMember member = new FairyMember();
            memberDic[(int)vNetData.MemberList[i].PlayerID] = member;
 
            member.PlayerID = vNetData.MemberList[i].PlayerID;
            member.Name = vNetData.MemberList[i].Name;
            member.JoinTime = vNetData.MemberList[i].JoinTime;
            member.FmLV = vNetData.MemberList[i].FmLV;
            member.LV = vNetData.MemberList[i].LV;
            member.Job = vNetData.MemberList[i].Job;
            member.RealmLV = vNetData.MemberList[i].RealmLV;
            member.Face = vNetData.MemberList[i].Face;
            member.FacePic = vNetData.MemberList[i].FacePic;
            member.TitleID = vNetData.MemberList[i].TitleID;
            member.FightPower = vNetData.MemberList[i].FightPower + vNetData.MemberList[i].FightPowerEx * Constants.ExpPointValue;
            member.ServerID = vNetData.MemberList[i].ServerID;
            member.ContribTotal = vNetData.MemberList[i].ContribTotal;
            member.ContribDay = vNetData.MemberList[i].ContribDay;
            member.DonateCntTotal = vNetData.MemberList[i].DonateCntTotal;
            member.DonateCntDay = vNetData.MemberList[i].DonateCntDay;
            member.OffTime = vNetData.MemberList[i].OffTime;
 
            if (member.PlayerID == PlayerDatas.Instance.baseData.PlayerID)
            {
                //自己
                mine = member;
            }
 
            // 0-成员,1-精英,2-副盟主,3-盟主
 
            // if (member.FmLV == 1)
            // {
            //     eliteList.Add(member);
            // }
            // else if (member.FamilyLV == 2)
            // {
            //     deputyLeaderList.Add(member);
            // }
            if (member.FmLV == 3)
            {
                leaderID = (int)member.PlayerID;
            }
        }
 
        if (OnRefreshFairyInfo != null) OnRefreshFairyInfo();
    }
 
    public FairyMember GetMember(int playerid)
    {
        FairyMember member = null;
        memberDic.TryGetValue(playerid, out member);
        return member;
    }
 
 
    #region 仙盟权力开启条件
    public bool IsCanFunc(LimitFunc funcType)
    {
        if (mine != null)
        {
            return mine.FmLV >= GuildManager.Instance.guildWorkToLevel[(int)funcType];
        }
        return false;
    }
    #endregion
 
 
}
 
 
//公会数据
public class FairyData
{
    public ushort Rank;        //名次,从1开始
    public uint FamilyID;
    public string FamilyName;    //家族名称
    public byte FamilyLV;    //家族等级
    public uint FamilyLVExp;    //家族等级经验
    public byte JoinReview;    //成员加入是否需要审核,默认0自动加入
    public ushort JoinLVMin;    //限制最低可加入的玩家等级
    public uint ServerID;    //区服ID,创建时以族长的区服ID赋值
    public uint EmblemID;    //徽章ID
    public string EmblemWord;    //徽章文字
    public long totalFightPower;
    public string Broadcast;
    public uint LeaderID;    //族长玩家ID
    public int MemberCount;
 
    //查找增加的字段
    public string LeaderName;
 
}
 
public class FairyMember
{
    public uint PlayerID;
    public string Name;        //size = NameLen
    public uint JoinTime;        //加入家族时时间戳
    public byte FmLV;        //家族职位: 0-成员;1-精英;2-副族长;3-族长
    public ushort LV;        //等级
    public byte Job;        //职业
    public byte RealmLV;        //境界
    public uint Face;        //基本脸型
    public uint FacePic;        //头像框
    public uint TitleID;        //称号
    public long FightPower;        //战力,求余亿部分
    public uint ServerID;        //所属区服ID
    public uint ContribTotal;        //总贡献度
    public uint ContribDay;        //日贡献度
    public uint DonateCntTotal;        //总捐献次数
    public byte DonateCntDay;        //日捐献次数
    public uint OffTime;        // 0-在线; >0-/离线时间戳
}
 
public class FairyApply
{
    public uint PlayerID;
    public string Name;      
    public uint ReqTime;        //申请时间戳
    public ushort LV;        //等级
    public byte Job;        //职业
    public byte RealmLV;        //境界
    public uint Face;        //基本脸型
    public uint FacePic;        //头像框
    public uint TitleID;        //称号
    public long FightPower;     
    public uint ServerID;        //所属区服ID
    public byte IsOnLine;        //是否在线
}
 
//权限ID: 1-收人,2-变更职位,3-发布公告,4-踢人
public enum LimitFunc
{
    CanCall = 1,
    CanJobTitle,
    CanNotify,
    CanKick,
}