| | |
| | |
|
| | | public 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; // 珍宝阁记录类型
|
| | | public const int GuildBossActionType = 18; //讨伐
|
| | |
|
| | | // 申请的公会列表
|
| | | private List<int> m_FairyRequesteds = new List<int>();
|
| | | // 公会自定义记录附加数据,按类型存储
|
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | TimeMgr.Instance.OnHourEvent += UpdateZBGRedpoint;
|
| | | }
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | TimeMgr.Instance.OnHourEvent -= UpdateZBGRedpoint;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | guildChanged = false;
|
| | | applyList.Clear();
|
| | | PlayerDatas.Instance.fairyData.ClearData();
|
| | |
|
| | | isQueryZBGYet = false;
|
| | | zhenbaogeCutState = 0;
|
| | | familyZBGActions.Clear();
|
| | | sortPlayerCut.Clear();
|
| | | }
|
| | |
|
| | | //退出公会
|
| | |
| | | UIManager.Instance.GetUI<MainWin>()?.ClickFunc(0);
|
| | |
|
| | |
|
| | | isQueryZBGYet = false;
|
| | | zhenbaogeCutState = 0;
|
| | | familyZBGActions.Clear();
|
| | | sortPlayerCut.Clear();
|
| | | // isQueryZBGYet = false;
|
| | | // zhenbaogeCutState = 0;
|
| | | // familyZBGActions.Clear();
|
| | | // sortPlayerCut.Clear();
|
| | |
|
| | | UpdateZBGRedpoint();
|
| | | UpdateDonateRedPoint();
|
| | |
| | | public event Action UpdateZhenbaogeEvent;
|
| | | public bool isQueryZBGYet = false;
|
| | | public float lastZBGStartTime = 0; //过天刷新用
|
| | | public const int ZBGFamilyActionType = 16;
|
| | | |
| | | //{id:数据} 砍价行为,value1为玩家ID,特殊约定为1时为家族的数据
|
| | | public Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction> familyZBGActions = new Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction>();
|
| | | public List<int> sortPlayerCut = new List<int>();
|
| | |
| | |
|
| | |
|
| | |
|
| | |
|
| | | #region 仙盟商店开启
|
| | | public int fairyStoreLimit = 0;
|
| | | public bool fairyStoreOpen
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 行商 砍价
|
| | | if (UpdateHawkerAction(_package))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 徽章
|
| | | if (GuildEmblemModel.Instance.UpdateEmblemAction(_package))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 公会讨伐
|
| | | if (GuildBossManager.Instance.UpdateGuildBossInfo(_package))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //上面各个功能要return
|
| | | UpdataCommonAction(_package);
|
| | | }
|
| | |
|
| | | // 通用记录 只适用单条数据的记录情况 或有服务端保证列表全部信息直接覆盖,其他功能比较复杂各自负责存储
|
| | | void UpdataCommonAction(HA513_tagMCFamilyActionInfo _package)
|
| | | {
|
| | | if (!familyActions.ContainsKey((int)_package.FamilyID))
|
| | | {
|
| | | familyActions.Add((int)_package.FamilyID, new Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction[]>());
|
| | |
| | |
|
| | | familyActions[(int)_package.FamilyID][_package.ActionType] = _package.FamilyActionList;
|
| | |
|
| | | UpdateHawkerAction(_package);
|
| | |
|
| | | FamilyActionInfoEvent?.Invoke((int)_package.FamilyID, _package.ActionType);
|
| | | }
|
| | |
|
| | | // 通用记录 |
| | | public bool TryGetFamilyActions(int actionType, out HA513_tagMCFamilyActionInfo.tagMCFamilyAction[] familyAction)
|
| | | {
|
| | | familyAction = null;
|
| | |
| | |
|
| | |
|
| | | //更新砍价信息
|
| | | public void UpdateHawkerAction(HA513_tagMCFamilyActionInfo vNetData)
|
| | | public bool UpdateHawkerAction(HA513_tagMCFamilyActionInfo vNetData)
|
| | | {
|
| | | if (vNetData.ActionType != ZBGFamilyActionType)
|
| | | {
|
| | | return;
|
| | | return false;
|
| | | }
|
| | | bool restart = false;
|
| | | if (vNetData.FamilyActionList.Length == 1 && vNetData.FamilyActionList[0].Value1 == 1)
|
| | |
| | |
|
| | | UpdateFamilyActionEvent?.Invoke(restart);
|
| | | UpdateZBGRedpoint();
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | //砍价人数
|
| | |
| | |
|
| | | #region 红点
|
| | |
|
| | | Redpoint donateRedpoint = new Redpoint(MainRedDot.guildHallRedpointID, MainRedDot.guildHallRedpointID * 10);
|
| | | Redpoint donateRedpoint = new Redpoint(MainRedDot.guildHallRedpointID, MainRedDot.donateRedpointID);
|
| | | //珍宝阁(行商)
|
| | | Redpoint zbgRedpoint = new Redpoint(MainRedDot.MainGuildRedpoint, MainRedDot.MainGuildRedpoint * 100 + 1);
|
| | | Redpoint zbgRedpoint = new Redpoint(MainRedDot.MainGuildRedpoint, MainRedDot.hawkerRedpointID);
|
| | |
|
| | | void UpdateDonateRedPoint()
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.ServerNow.Hour < 10)
|
| | | return;
|
| | |
|
| | | if (zhenbaogeCutState == 0)
|
| | | {
|