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,
|
}
|