hch
2 天以前 e95a97e663ba46ed474c89425dd92516a0d9b7dd
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
193
194
195
196
197
198
199
200
201
202
203
204
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
 
 
/** 玩家仙盟相关信息缓存数据 */
public class PlayerFairyData
{
 
    public bool HasFairy
    {
        get
        {
            if (fairy == null) return false;
            if (fairy.FamilyID == 0) return false;
            return true;
        }
    }
 
 
    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 = (int)vNetData.FamilyID;
        fairy.FamilyName = UIHelper.ServerStringTrim(vNetData.FamilyName);
        fairy.FamilyLV = vNetData.FamilyLV;
        fairy.FamilyLVExp = (int)vNetData.FamilyLVExp;
        fairy.JoinReview = vNetData.JoinReview;
        fairy.JoinLVMin = vNetData.JoinLVMin;
        fairy.ServerID = (int)vNetData.ServerID;
        fairy.EmblemID = (int)vNetData.EmblemID;
        fairy.EmblemWord = vNetData.EmblemWord;
        fairy.totalFightPower = vNetData.FightPowerEx * Constants.ExpPointValue + vNetData.FightPower;
        fairy.Broadcast = vNetData.Broadcast;
        fairy.LeaderID = (int)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 = (int)vNetData.MemberList[i].PlayerID;
            member.Name = vNetData.MemberList[i].Name;
            member.JoinTime = (int)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 = (int)vNetData.MemberList[i].Face;
            member.FacePic = (int)vNetData.MemberList[i].FacePic;
            member.TitleID = (int)vNetData.MemberList[i].TitleID;
            member.FightPower = vNetData.MemberList[i].FightPower + vNetData.MemberList[i].FightPowerEx * Constants.ExpPointValue;
            member.ServerID = (int)vNetData.MemberList[i].ServerID;
            member.ContribTotal = (int)vNetData.MemberList[i].ContribTotal;
            member.ContribDay = (int)vNetData.MemberList[i].ContribDay;
            member.DonateCntTotal = (int)vNetData.MemberList[i].DonateCntTotal;
            member.DonateCntDay = vNetData.MemberList[i].DonateCntDay;
            member.OffTime = (int)vNetData.MemberList[i].OffTime;
 
            if (member.PlayerID == PlayerDatas.Instance.baseData.PlayerID)
            {
                //自己
                mine = member;
                OnRefreshFairyMine?.Invoke();
            }
 
            // 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 void ClearData()
    {
        fairy = null;
        mine = null;
        memberDic.Clear();
        leaderID = 0;
    }
 
}
 
 
//公会数据
public class FairyData
{
    public int Rank;        //名次,从1开始
    public int FamilyID;
    public string FamilyName;    //家族名称
    public int FamilyLV;    //家族等级
    public int FamilyLVExp;    //家族等级经验
    public int JoinReview;    //成员加入是否需要审核,默认0自动加入
    public int JoinLVMin;    //限制最低可加入的玩家等级
    public int ServerID;    //区服ID,创建时以族长的区服ID赋值
    public int EmblemID;    //徽章ID
    public string EmblemWord;    //徽章文字
    public long totalFightPower;
    public string Broadcast;
    public int LeaderID;    //族长玩家ID
    public int MemberCount;
 
    //查找增加的字段
    public string LeaderName;
 
}
 
public class FairyMember
{
    public int PlayerID;
    public string Name;        //size = NameLen
    public int JoinTime;        //加入家族时时间戳
    public int FmLV;        //家族职位: 0-成员;1-精英;2-副族长;3-族长
    public int LV;        //等级
    public int Job;        //职业
    public int RealmLV;        //境界
    public int Face;        //基本脸型
    public int FacePic;        //头像框
    public int TitleID;        //称号
    public long FightPower;        //战力,求余亿部分
    public int ServerID;        //所属区服ID
    public int ContribTotal;        //总贡献度
    public int ContribDay;        //日贡献度
    public int DonateCntTotal;        //总捐献次数
    public int DonateCntDay;        //日捐献次数
    public int OffTime;        // 0-在线; >0-/离线时间戳
}
 
public class FairyApply
{
    public int PlayerID;
    public string Name;      
    public int ReqTime;        //申请时间戳
    public int LV;        //等级
    public int Job;        //职业
    public int RealmLV;        //境界
    public int Face;        //基本脸型
    public int FacePic;        //头像框
    public int TitleID;        //称号
    public long FightPower;     
    public int ServerID;        //所属区服ID
    public int IsOnLine;        //是否在线
}
 
//权限ID: 1-收人,2-变更职位,3-发布公告,4-踢人
public enum LimitFunc
{
    CanCall = 1,
    CanJobTitle,
    CanNotify,
    CanKick,
}