| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using Cysharp.Threading.Tasks;
|
| | | using LitJson;
|
| | | using UnityEngine;
|
| | |
|
| | |
|
| | | public partial class GuildManager : GameSystemManager<GuildManager>
|
| | | using Cysharp.Threading.Tasks; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | |
| | | |
| | | public partial class GuildManager : GameSystemManager<GuildManager> |
| | | {
|
| | | // 家族自定义记录类型
|
| | | public const int MemberChangeActionType = 12; //公会变更记录
|
| | |
| | |
|
| | |
|
| | | //珍宝阁(行商)
|
| | | public int zhenbaogeCutState = 0;
|
| | | int m_ZhenbaogeCutState = 0;
|
| | | public int zhenbaogeCutState
|
| | | {
|
| | | get
|
| | | {
|
| | | if (familyZBGActions.Count - 1 >= 50)
|
| | | {
|
| | | //砍价人数超过上限后可直接购买
|
| | | m_ZhenbaogeCutState = 1;
|
| | | }
|
| | | return m_ZhenbaogeCutState;
|
| | | }
|
| | | set
|
| | | {
|
| | |
|
| | | m_ZhenbaogeCutState = value;
|
| | | }
|
| | | }
|
| | | public int zhenbaogeBuyState = 0;
|
| | | public bool needCheckCutCD = false;
|
| | | public event Action UpdateZhenbaogeEvent;
|
| | |
| | | public int zbgChangFamilyCD;
|
| | | public List<int> cutCntListForTalk = new List<int>();
|
| | | public int familyRecordMaxCount;
|
| | | public const int DefaultEmblemWordCharacterLimit = 1;
|
| | | public Dictionary<string, int> emblemWordCharacterLimitDict = new Dictionary<string, int>();
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | |
| | | config = FuncConfigConfig.Get("FamilyBillboardSet");
|
| | | pageCnt = int.Parse(config.Numerical1);
|
| | | queryPointNum = int.Parse(config.Numerical2);
|
| | |
|
| | | config = FuncConfigConfig.Get("FamilyEmblem");
|
| | | emblemWordCharacterLimitDict = JsonMapper.ToObject<Dictionary<string, int>>(config.Numerical1);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | public int GetEmblemWordCharacterLimit()
|
| | | {
|
| | | string langId = Language.Id;
|
| | | if (!string.IsNullOrEmpty(langId) && emblemWordCharacterLimitDict.TryGetValue(langId, out int limit) && limit > 0)
|
| | | {
|
| | | return limit;
|
| | | }
|
| | |
|
| | | return DefaultEmblemWordCharacterLimit;
|
| | | }
|
| | |
|
| | | public string LimitEmblemWord(string emblemWord)
|
| | | {
|
| | | if (string.IsNullOrEmpty(emblemWord))
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | |
|
| | | int limit = GetEmblemWordCharacterLimit();
|
| | | if (emblemWord.Length <= limit)
|
| | | {
|
| | | return emblemWord;
|
| | | }
|
| | |
|
| | | return emblemWord.Substring(0, limit);
|
| | | }
|
| | |
|
| | | bool CheckEmblemWord(string emblemWord)
|
| | | {
|
| | | if (string.IsNullOrEmpty(emblemWord))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | int limit = GetEmblemWordCharacterLimit();
|
| | | return emblemWord.Length <= limit;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | punishTime = quitGuildPunishTime[Math.Min(quitCount, quitGuildPunishTime.Length - 1)];
|
| | | }
|
| | |
|
| | | return punishTime * 60 - (TimeUtility.GetCommServerTick(zoneID)- PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | return punishTime * 60 - (TimeUtility.GetCommServerTick(zoneID) - PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (emblemWord.Length > 1)
|
| | | if (!CheckEmblemWord(emblemWord))
|
| | | {
|
| | | //预制体输入框限制,不限任意字符都只能输入1个字
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | #region 公会自定义记录
|
| | | public void UpdateFamilyAction(HA513_tagMCFamilyActionInfo _package)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.FamilyId != _package.FamilyID)
|
| | | // 公会攻防战 需要同时接收敌方攻击日志
|
| | | if (GuildAtkDefBatManager.Instance.UpdateFamilyActionInfo(_package))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (GuildAtkDefBatManager.Instance.UpdateAtkDefBatLogInfo(_package)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.baseData.FamilyId != _package.FamilyID) |
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | #region 查看目标公会
|
| | | public Dictionary<int, FairyData> viewGuildsDict = new Dictionary<int, FairyData>();
|
| | |
|
| | | public event Action OnUpdateViewFamilyInfo;
|
| | | public event Action<int> OnUpdateViewFamilyInfo;
|
| | |
|
| | | public void UpdateViewFamilyInfo(HA519_tagSCTagFamilyInfo pack)
|
| | | {
|
| | | FairyData data = new FairyData();
|
| | | SetFairyViewData(data, pack);
|
| | |
|
| | | // 存储并排序成员列表
|
| | | var memberList = new List<HA519_tagSCTagFamilyInfo.tagSCTagFamilyInfoMem>(pack.MemberList);
|
| | | memberList.Sort((a, b) =>
|
| | | {
|
| | | // 主排序:职务降序(3-族长 > 2-副族长 > 1-精英 > 0-成员)
|
| | | int jobCompare = b.FmLV.CompareTo(a.FmLV);
|
| | | if (jobCompare != 0) return jobCompare;
|
| | | // 次排序:战力降序
|
| | | long powerA = a.FightPowerEx * Constants.ExpPointValue + a.FightPower;
|
| | | long powerB = b.FightPowerEx * Constants.ExpPointValue + b.FightPower;
|
| | | return powerB.CompareTo(powerA);
|
| | | });
|
| | | data.memberList = memberList;
|
| | |
|
| | | viewGuildsDict[(int)data.FamilyID] = data;
|
| | | OnUpdateViewFamilyInfo?.Invoke();
|
| | | OnUpdateViewFamilyInfo?.Invoke((int)data.FamilyID);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取指定公会的排序后的成员列表(职务降序 → 战力降序)
|
| | | /// </summary>
|
| | | public List<HA519_tagSCTagFamilyInfo.tagSCTagFamilyInfoMem> GetSortedMemberList(int familyID)
|
| | | {
|
| | | if (viewGuildsDict.TryGetValue(familyID, out var data))
|
| | | {
|
| | | return data.memberList;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA519_tagSCTagFamilyInfo view)
|
| | |
| | | PublishNotice = 3,
|
| | | Kick = 4,
|
| | |
|
| | | } |
| | | } |