| | |
| | | using UnityEngine;
|
| | |
|
| | |
|
| | | public class GuildManager : GameSystemManager<GuildManager>
|
| | | public partial class GuildManager : GameSystemManager<GuildManager>
|
| | | {
|
| | | // 家族自定义记录类型
|
| | | public const int CustomyActionType = 0; //通用
|
| | | public const int MemberChangeActionType = 12; //公会变更记录
|
| | | public const int FamilyActionsType = 15; // 公会记录徽章类型15
|
| | | public const int ZBGFamilyActionType = 16; // 珍宝阁记录类型
|
| | |
| | |
|
| | | void OnBeforePlayerDataInitializeEx()
|
| | | {
|
| | | guildChanged = false;
|
| | | isQueryZBGYet = false;
|
| | | }
|
| | |
|
| | |
| | | PlayerDatas.Instance.baseData.FamilyId = 0;
|
| | | m_FairyRequesteds.Clear();
|
| | | familyActions.Clear();
|
| | | guildChanged = false;
|
| | | applyList.Clear();
|
| | | PlayerDatas.Instance.fairyData.ClearData();
|
| | |
|
| | |
| | |
|
| | | // 查找的公会ID:公会数据
|
| | | public Dictionary<int, FairyData> guildsDict = new Dictionary<int, FairyData>();
|
| | | public int myFairyRank;
|
| | | // 按查询页存储
|
| | | public List<int> pageIndexList = new List<int>(); //正常是按页查询,顺序添加即可
|
| | | public int curPageIndex;
|
| | |
| | | SetFairyViewData(data, guildInfo);
|
| | | pageIndexList.Add((int)guildInfo.FamilyID);
|
| | | }
|
| | |
|
| | | myFairyRank = (int)vNetData.Rank; //0-没有公会或没有在榜上;>0-对应排名
|
| | |
|
| | | if (OnRefreshFairyList != null)
|
| | | {
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | float lastChangeMarkTime = 0; //打开界面情况下避免短时间多次立即请求,C/S通信也是有时间间隔
|
| | | public bool guildChanged = false;
|
| | | //Type:0-无;1-成员加入;2-成员退出;3-收人设置修改;4-公告修改;5-徽章修改;6-盟主变更;7-成员职位变更;8-成员上线;9-成员离线;
|
| | | //公会数据变化,请求新的公会信息,如在打开公会列表时请求,其他功能根据自身情况请求
|
| | | public void UpdateGuildDataChangeMark(HA521_tagMCFamilyChange netPack)
|
| | | {
|
| | | guildChanged = true;
|
| | | if (Time.time - lastChangeMarkTime < 0.2f)
|
| | | {
|
| | | //小优化 如果有问题也可以去除
|
| | | return;
|
| | | }
|
| | | lastChangeMarkTime = Time.time;
|
| | | if ((netPack.Type == 1 || netPack.Type == 2) && UIManager.Instance.IsOpened<GuildBaseWin>())
|
| | | {
|
| | | RequestGuildData();
|
| | | }
|
| | | }
|
| | |
|
| | | public void RequestGuildData()
|
| | | {
|
| | | if (guildChanged)
|
| | | {
|
| | | guildChanged = false;
|
| | | var pack = new CA626_tagCMGetFamilyInfo();
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendKickFairy(uint playerID)
|
| | | {
|