Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
| | |
| | | return waveLineupLists.Count(list => list.Length > 0); |
| | | } |
| | | |
| | | static List<int> allLevels = new List<int>(); |
| | | // 获取目标关卡的索引 |
| | | public static int GetToTargetLevelIndex(int targetLevel) |
| | | { |
| | | var levels = GetKeys(); |
| | | levels.Sort(); |
| | | return levels.IndexOf(targetLevel); |
| | | if (allLevels.IsNullOrEmpty()) |
| | | { |
| | | allLevels = GetKeys(); |
| | | allLevels.Sort(); |
| | | } |
| | | return allLevels.IndexOf(targetLevel); |
| | | |
| | | } |
| | | |
| | |
| | | break; |
| | | case PlayerDataType.ExAttr1: |
| | | baseData.ExAttr1 = Math.Max((int)value, 10100); //新号初始处理 |
| | | Debug.LogFormat("---- 收到服务端ExAttr1: {0}", baseData.ExAttr1); |
| | | break; |
| | | case PlayerDataType.ExAttr2: |
| | | baseData.ExAttr2 = Math.Max((int)value, 10101); //新号初始处理 |
| | | Debug.LogFormat("---- 收到服务端ExAttr2: {0}", baseData.ExAttr2); |
| | | break; |
| | | case PlayerDataType.ExAttr3://称号 |
| | | baseData.TitleID = (int)value; |
| | |
| | | |
| | | public class CA212_tagCMViewPlayerInfo : GameNetPackBasic { |
| | | public uint PlayerID; |
| | | public byte EquipClassLV; //大于0为查看指定境界阶装备信息, 0为查看默认信息 |
| | | public uint ServerID; //玩家服务器ID,发0默认本服玩家 |
| | | |
| | | public CA212_tagCMViewPlayerInfo () { |
| | | combineCmd = (ushort)0x03FE; |
| | |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (PlayerID, NetDataType.DWORD); |
| | | WriteBytes (EquipClassLV, NetDataType.BYTE); |
| | | WriteBytes (ServerID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A6 19 查看目标公会 #tagCSViewTagFamily |
| | | |
| | | public class CA619_tagCSViewTagFamily : GameNetPackBasic { |
| | | public uint FamilyID; |
| | | public uint DataServerID; //数据所在服务器ID |
| | | |
| | | public CA619_tagCSViewTagFamily () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA619; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (FamilyID, NetDataType.DWORD); |
| | | WriteBytes (DataServerID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2bf49c967e6a89b4c93efd500fbd7583 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //类型 |
| | | static Dictionary<int, ulong> lastPackUIDDict = new Dictionary<int, ulong>() |
| | | { |
| | | #if UNITY_EDITOR |
| | | {(int)PlayerDataType.ExAttr1, 0}, |
| | | {(int)PlayerDataType.ExAttr2, 0}, |
| | | #endif |
| | | {(int)PlayerDataType.default26, 0}, |
| | | }; |
| | | public override void Done(GameNetPackBasic vNetPack) |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 19 查看目标公会信息 #tagSCTagFamilyInfo |
| | | |
| | | public class DTCA519_tagSCTagFamilyInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HA519_tagSCTagFamilyInfo vNetData = vNetPack as HA519_tagSCTagFamilyInfo; |
| | | GuildManager.Instance.UpdateViewFamilyInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e31d54337b63cd94cb7faac99d8f1eaf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using LitJson; |
| | | using Codice.Client.BaseCommands; |
| | | |
| | | // B4 20 回合制战斗状态 #tagMCTurnFightState |
| | | |
| | |
| | | { |
| | | JsonData extendData = JsonMapper.ToObject(vNetData.Msg); |
| | | battleField.OnTurnFightState(vNetData.TurnNum, vNetData.State, (int)vNetData.FuncLineID, extendData); |
| | | if (vNetData.MapID == 1 && (vNetData.FuncLineID > PlayerDatas.Instance.baseData.ExAttr2)) |
| | | { |
| | | Debug.LogErrorFormat("---- 收到服务端 DTCB420_tagMCTurnFightState 的 FuncLineID :{0} 大于客户端记录 ExAttr2 {1}", vNetData.FuncLineID, PlayerDatas.Instance.baseData.ExAttr2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Register(typeof(HB162_tagSCFuncPresetSwitchInfo), typeof(DTCB162_tagSCFuncPresetSwitchInfo)); |
| | | Register(typeof(HB163_tagSCBatPresetSwitchInfo), typeof(DTCB163_tagSCBatPresetSwitchInfo)); |
| | | Register(typeof(HA001_tagBroadCastInfo), typeof(DTCA001_tagBroadCastInfo)); |
| | | Register(typeof(HA519_tagSCTagFamilyInfo), typeof(DTCA519_tagSCTagFamilyInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 19 查看目标公会信息 #tagSCTagFamilyInfo |
| | | |
| | | public class HA519_tagSCTagFamilyInfo : GameNetPackBasic { |
| | | public uint FamilyID; //家族ID |
| | | public byte FamilyNameLen; |
| | | public string FamilyName; //size = FamilyNameLen |
| | | public uint LeaderID; //族长ID |
| | | public byte LeaderNameLen; |
| | | public string LeaderName; //size = LeaderNameLen |
| | | public uint LeaderServerID; //会长区服ID |
| | | public byte FamilyLV; //家族等级 |
| | | public uint ServerID; //区服ID |
| | | public uint EmblemID; //徽章ID |
| | | public string EmblemWord; //徽章文字 |
| | | public uint FightPower; //总战力,求余亿部分 |
| | | public uint FightPowerEx; //总战力,整除亿部分 |
| | | public ushort BroadcastLen; //公告 |
| | | public string Broadcast; //size = BroadcastLen |
| | | public byte MemberCount; //成员人数 |
| | | public uint DataServerID; //数据所在服务器ID |
| | | |
| | | public HA519_tagSCTagFamilyInfo () { |
| | | _cmd = (ushort)0xA519; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out FamilyID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FamilyNameLen, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FamilyName, vBytes, NetDataType.Chars, FamilyNameLen); |
| | | TransBytes (out LeaderID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out LeaderNameLen, vBytes, NetDataType.BYTE); |
| | | TransBytes (out LeaderName, vBytes, NetDataType.Chars, LeaderNameLen); |
| | | TransBytes (out LeaderServerID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FamilyLV, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ServerID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out EmblemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out EmblemWord, vBytes, NetDataType.Chars, 3); |
| | | TransBytes (out FightPower, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FightPowerEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BroadcastLen, vBytes, NetDataType.WORD); |
| | | TransBytes (out Broadcast, vBytes, NetDataType.Chars, BroadcastLen); |
| | | TransBytes (out MemberCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out DataServerID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 487779c3213b8a94e861c50bc592c1dd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | TransBytes (out FamilyList[i].LeaderID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyList[i].LeaderNameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].LeaderName, vBytes, NetDataType.Chars, FamilyList[i].LeaderNameLen);
|
| | | TransBytes (out FamilyList[i].LeaderServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyList[i].FamilyLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].JoinReview, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].JoinLVMin, vBytes, NetDataType.WORD);
|
| | |
| | | public uint LeaderID; //族长ID
|
| | | public byte LeaderNameLen;
|
| | | public string LeaderName; //size = LeaderNameLen
|
| | | public uint LeaderServerID; //族长服务器ID
|
| | | public byte FamilyLV; //家族等级
|
| | | public byte JoinReview; //成员加入是否需要审核,默认0自动加入
|
| | | public ushort JoinLVMin; //限制最低可加入的玩家等级
|
| | |
| | | public string FamilyName;
|
| | | public uint FamilyEmblemID; //仙盟徽章ID
|
| | | public string FamilyEmblemWord; //徽章文字
|
| | | public uint FamilyDataServerID; //公会数据所在服务器ID,A619查看公会用
|
| | | public uint PlusDataSize;
|
| | | public string PlusData; //扩展记录
|
| | |
|
| | |
| | | TransBytes (out FamilyName, vBytes, NetDataType.Chars, 33);
|
| | | TransBytes (out FamilyEmblemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyEmblemWord, vBytes, NetDataType.Chars, 3);
|
| | | TransBytes (out FamilyDataServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusDataSize, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusData, vBytes, NetDataType.Chars, PlusDataSize);
|
| | | }
|
| | |
| | | // B0 40 游历信息 #tagSCTravelInfo
|
| | |
|
| | | public class HB040_tagSCTravelInfo : GameNetPackBasic {
|
| | | public byte Energy; //剩余体力
|
| | | public uint Energy; //剩余体力
|
| | | public uint EnergyTime; //上次恢复体力时间戳
|
| | | public uint TravelCnt; //累计游历次数
|
| | | public byte SceneryType; //景观类型
|
| | |
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Energy, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Energy, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out EnergyTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TravelCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out SceneryType, vBytes, NetDataType.BYTE);
|
| | |
| | | |
| | | public partial class BeautyMMManager : GameSystemManager<BeautyMMManager> |
| | | { |
| | | public byte m_Energy; //剩余体力 |
| | | public int m_Energy; //剩余体力 |
| | | public uint m_EnergyTime; //上次恢复体力时间戳 |
| | | public uint m_TravelCnt; //累计游历次数 |
| | | public byte m_SceneryType; //景观类型 |
| | |
| | | |
| | | public void UpdateTravelInfo(HB040_tagSCTravelInfo netPack) |
| | | { |
| | | m_Energy = netPack.Energy; |
| | | m_Energy = (int)netPack.Energy; |
| | | m_EnergyTime = netPack.EnergyTime; |
| | | m_TravelCnt = netPack.TravelCnt; |
| | | m_SceneryType = netPack.SceneryType; |
| | |
| | | public void UpdateBeautyMMData(HB130_tagSCBeautyInfo data) |
| | | { |
| | | int activeMMID = 0; |
| | | int activeSkinID = 0; |
| | | foreach (var beauty in data.BeautyList) |
| | | { |
| | | if (DTC0403_tagPlayerLoginLoadOK.finishedLogin) |
| | | if (data.Count == 1) |
| | | { |
| | | //data.Count == 1 可以理解为解锁回报 |
| | | if (beautyMMDataDict.ContainsKey(beauty.BeautyID)) |
| | | { |
| | | if (beautyMMDataDict[beauty.BeautyID].State != beauty.State) |
| | |
| | | |
| | | foreach (var skin in beauty.SkinList) |
| | | { |
| | | if (data.Count == 1) |
| | | { |
| | | //data.Count == 1 可以理解为解锁回报 |
| | | if (beautyMMSkinDataDict.ContainsKey(skin.SkinID)) |
| | | { |
| | | if (beautyMMSkinDataDict[skin.SkinID].State != skin.State) |
| | | { |
| | | activeSkinID = skin.SkinID; |
| | | } |
| | | } |
| | | else if (skin.State != 0) |
| | | { |
| | | activeSkinID = skin.SkinID; |
| | | } |
| | | } |
| | | |
| | | beautyMMSkinDataDict[skin.SkinID] = new BeautyMMSkinData() |
| | | { |
| | | State = skin.State, |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMActiveWin>(activeMMID); |
| | | } |
| | | else if (activeSkinID > 0) |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMSkinActiveWin>(activeSkinID); |
| | | } |
| | | } |
| | | |
| | | //0 全部 1 已激活 2 未激活 |
| New file |
| | |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class BeautyMMSkinActiveWin : UIBase |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] ImageEx roleImg; |
| | | |
| | | [SerializeField] Text attrText; |
| | | |
| | | int skinID; |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | skinID = functionOrder; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | var skinConfig = BeautySkinConfig.Get(skinID); |
| | | nameText.text = skinConfig.Name; |
| | | roleImg.SetOrgSprite(skinConfig.BigRole, "BeautyMMBigRole"); |
| | | roleImg.SetNativeSize(); |
| | | |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.NavyYellow, "+{1}"); |
| | | attrText.text = PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0], format); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 25e9d541898b482469cf32bf0533a66b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | var skinData = BeautyMMManager.Instance.GetSkinData(skinID); |
| | | var mmData = BeautyMMManager.Instance.GetBeautyMMData(mmID); |
| | | var state = skinData.State; |
| | | if (mmData != null && mmData.State != 0 && skinConfig.UnlockWay == 1) |
| | | { |
| | | state = 1; |
| | | } |
| | | // if (mmData != null && mmData.State != 0 && skinConfig.UnlockWay == 1) |
| | | // { |
| | | // //默认签到自己解锁 |
| | | // state = 1; |
| | | // } |
| | | if (state != 0) |
| | | { |
| | | lockObj.SetActive(false); |
| | |
| | | BeautyMMManager.Instance.selectSkinID = BeautyMMManager.Instance.GetUsedSkinID(mmID); |
| | | clothesScroller.OnRefreshCell += OnRefreshCell; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange += OnSelectSkinIDChange; |
| | | BeautyMMManager.Instance.OnBeautyMMDataUpdate += OnSelectSkinIDChange; |
| | | CreateScroller(); |
| | | Display(); |
| | | } |
| | |
| | | { |
| | | clothesScroller.OnRefreshCell -= OnRefreshCell; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange -= OnSelectSkinIDChange; |
| | | BeautyMMManager.Instance.OnBeautyMMDataUpdate -= OnSelectSkinIDChange; |
| | | } |
| | | |
| | | void OnSelectSkinIDChange() |
| | |
| | | if (skinData.State == 0) |
| | | { |
| | | attrTipText.text = Language.Get("PhantasmPavilion11"); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.lightYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0])); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.NavyYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0])); |
| | | } |
| | | else |
| | | { |
| | | attrTipText.text = Language.Get("PhantasmPavilion07"); |
| | | var value = skinConfig.InitAttrValueList[0] + skinData.Star * skinConfig.AttrPerStarAddList[0]; |
| | | |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.lightYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], value)) + |
| | | Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.Green, "+" + PlayerPropertyConfig.GetValueDescription(skinConfig.AttrIDList[0], skinConfig.AttrPerStarAddList[0]))); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.NavyYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], value)) + |
| | | Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.LightGreen, "+" + PlayerPropertyConfig.GetValueDescription(skinConfig.AttrIDList[0], skinConfig.AttrPerStarAddList[0]))); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name); |
| | | } |
| | | |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)data.PlayerID, serverID: (int)data.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | } |
| | | |
| | | public float GetHeight(string content, ArrayList list) |
| | |
| | | [SerializeField] MoneyMoveByPath moneyMoveByPathCell; //掉落物金钱
|
| | | [SerializeField] RectTransform defaultDropRect; //默认掉落位置
|
| | | [SerializeField] Text[] expTexts;
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[20]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[20]; //掉落货币,金钱,经验等
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[100]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[100]; //掉落货币,金钱,经验等
|
| | |
|
| | |
|
| | | void Awake()
|
| | |
| | | |
| | | void Display() |
| | | { |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | headCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, |
| | | PlayerDatas.Instance.baseData.face, |
| | |
| | | bzAttrText.text = GetAddAttrs(bossAction); |
| | | var layer = bossAction == null ? 0 : bossAction.Value3; |
| | | var bzTime = bossAction == null ? 0 : bossAction.Value2; |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.AllSeconds); |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID)); |
| | | if (remainTime == 0) |
| | | { |
| | | //时间到了 客户端自己清0 |
| | |
| | | { |
| | | var layerNum = action == null ? 0 : action.Value3; |
| | | var bzTime = action == null ? 0 : action.Value2; |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.AllSeconds); |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID)); |
| | | if (remainTime == 0) |
| | | { |
| | | //时间到了 客户端自己清0 |
| | |
| | | |
| | | void OnSecondEvent() |
| | | { |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | var bossAction = GuildBossManager.Instance.GetGuildBossAction(); |
| | | ShowBzInfo(bossAction); |
| | | OtherPlayerAnimation(); |
| | |
| | | |
| | | void OnSecondEvent() |
| | | { |
| | | timeText.text = Language.Get("Guild_74", TimeUtility.SecondsToShortDHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | timeText.text = Language.Get("Guild_74", TimeUtility.SecondsToShortDHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - |
| | | TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | } |
| | | |
| | | int index = 0; |
| | |
| | | void OnCut() |
| | | { |
| | | //砍价的cd限制: 公会没有记录自己砍过价,但今天有砍价记录,且退出过公会 |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0 && GuildManager.Instance.needCheckCutCD && (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60 < GuildManager.Instance.zbgChangFamilyCD ) |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0 && GuildManager.Instance.needCheckCutCD && (TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60 < GuildManager.Instance.zbgChangFamilyCD ) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("ZhenbaogeCut1", GuildManager.Instance.zbgChangFamilyCD - (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60); |
| | | SysNotifyMgr.Instance.ShowTip("ZhenbaogeCut1", GuildManager.Instance.zbgChangFamilyCD - (TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60); |
| | | return; |
| | | } |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0) |
| | |
| | | OnRefreshCrossServerInfoEvent?.Invoke();
|
| | | }
|
| | |
|
| | | // 获取当前时间, 公会跨区前取本服时间,跨服后取跨服时间
|
| | | public DateTime GetServerNow()
|
| | | {
|
| | | if (zoneID == 0)
|
| | | {
|
| | | return TimeUtility.ServerNow;
|
| | | }
|
| | | else
|
| | | {
|
| | | return TimeUtility.CrossServerNow;
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetServerTick()
|
| | | {
|
| | | if (zoneID == 0)
|
| | | {
|
| | | return TimeUtility.AllSeconds;
|
| | | }
|
| | | else
|
| | | {
|
| | | return TimeUtility.AllSecondsCrossServer;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | punishTime = quitGuildPunishTime[Math.Min(quitCount, quitGuildPunishTime.Length - 1)];
|
| | | }
|
| | |
|
| | | return punishTime * 60 - (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | return punishTime * 60 - (TimeUtility.GetCommServerTick(zoneID)- PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public void SendFindGuildNoDecrypt(string msg, int pageIndex = 0, int pageSize = 20)
|
| | | {
|
| | | if (pageIndex == 0)
|
| | | {
|
| | | //默认查询第一页即代表重新开始查询,清空之前的数据
|
| | | guildsDict.Clear();
|
| | | pageIndexList.Clear();
|
| | | }
|
| | | var pack = new CA620_tagCMViewFamilyPage();
|
| | | pack.Msg = msg;
|
| | | pack.MsgLen = (byte)msg.Length;
|
| | | pack.PageIndex = (byte)pageIndex;
|
| | | pack.ShowCount = (byte)pageSize;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA523_tagMCFamilyViewList.tagMCFamilyView view)
|
| | | {
|
| | | data.Rank = view.Rank;
|
| | | data.FamilyID = (int)view.FamilyID;
|
| | | data.FamilyName = view.FamilyName;
|
| | | data.LeaderID = (int)view.LeaderID;
|
| | | data.LeaderServerID = (int)view.LeaderServerID;
|
| | | data.LeaderName = view.LeaderName;
|
| | | data.FamilyLV = view.FamilyLV;
|
| | | data.JoinReview = view.JoinReview;
|
| | |
| | | data.MemberCount = view.MemberCount;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 查看目标公会
|
| | | public Dictionary<int, FairyData> viewGuildsDict = new Dictionary<int, FairyData>();
|
| | |
|
| | | public event Action OnUpdateViewFamilyInfo;
|
| | |
|
| | | public void UpdateViewFamilyInfo(HA519_tagSCTagFamilyInfo pack)
|
| | | {
|
| | | FairyData data = new FairyData();
|
| | | SetFairyViewData(data, pack);
|
| | | viewGuildsDict[(int)data.FamilyID] = data;
|
| | | OnUpdateViewFamilyInfo?.Invoke();
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA519_tagSCTagFamilyInfo view)
|
| | | {
|
| | | data.FamilyID = (int)view.FamilyID;
|
| | | data.FamilyName = view.FamilyName;
|
| | | data.LeaderID = (int)view.LeaderID;
|
| | | data.LeaderServerID = (int)view.LeaderServerID;
|
| | | data.LeaderName = view.LeaderName;
|
| | | data.FamilyLV = view.FamilyLV;
|
| | | data.ServerID = (int)view.ServerID;
|
| | | data.EmblemID = (int)view.EmblemID;
|
| | | data.EmblemWord = view.EmblemWord;
|
| | | data.totalFightPower = view.FightPowerEx * Constants.ExpPointValue + view.FightPower;
|
| | | data.MemberCount = view.MemberCount;
|
| | | }
|
| | |
|
| | | public void SendViewGuild(int fairyID, int serverID)
|
| | | {
|
| | | var pack = new CA619_tagCSViewTagFamily();
|
| | | pack.FamilyID = (uint)fairyID;
|
| | | pack.DataServerID = (uint)serverID;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 申请列表
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.ServerNow.Hour < 10)
|
| | | if (TimeUtility.GetCommServerNow(zoneID).Hour < 10)
|
| | | return;
|
| | |
|
| | | if (zhenbaogeCutState == 0)
|
| | |
| | | |
| | | avatarCell.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID, playerInfo.ServerID); |
| | | }); |
| | | |
| | | contribText.text = playerInfo.ContribDay + "/" + playerInfo.ContribTotal; |
| | |
| | | |
| | | int guildID; |
| | | int leaderID; |
| | | int leaderServerID; |
| | | protected override void InitComponent() |
| | | { |
| | | opearteBtn.AddListener(() => |
| | |
| | | |
| | | leaderAvatar.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, leaderServerID); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | void Display() |
| | | { |
| | | var guildInfo = GuildManager.Instance.guildsDict[guildID]; |
| | | FairyData guildInfo = null; |
| | | if (GuildManager.Instance.guildsDict.ContainsKey(guildID)) |
| | | { |
| | | guildInfo = GuildManager.Instance.guildsDict[guildID]; |
| | | } |
| | | else |
| | | { |
| | | if (GuildManager.Instance.viewGuildsDict.ContainsKey(guildID)) |
| | | { |
| | | guildInfo = GuildManager.Instance.viewGuildsDict[guildID]; |
| | | } |
| | | } |
| | | if (guildInfo == null) return; |
| | | leaderID = guildInfo.LeaderID; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, (int)ViewPlayerType.viewGuildLeader); |
| | | leaderServerID = guildInfo.ServerID; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, leaderServerID, (int)ViewPlayerType.viewGuildLeader); |
| | | |
| | | var config = FamilyConfig.Get(guildInfo.FamilyLV); |
| | | guildEmblem.Display(guildInfo.EmblemID, guildInfo.EmblemWord, 0.7f); |
| | |
| | | public long totalFightPower;
|
| | | public string Broadcast;
|
| | | public int LeaderID; //族长玩家ID
|
| | | public int LeaderServerID; //族长服务器ID
|
| | | public int MemberCount;
|
| | | public int lastChangeNameTick;
|
| | |
|
| | |
| | | autoBtn.SetActive(false); |
| | | goldRushItemBtn.SetActive(false); |
| | | } |
| | | |
| | | |
| | | foreach (var npc in funcNPCs) |
| | | { |
| | | var key = npc.heroSkinID; |
| | | if (!FuncOpen.Instance.IsFuncOpen(FuncNPCManager.Instance.funcNPCToFuncID[key])) |
| | | { |
| | | npc.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | npc.SetActive(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | void OnFiveSecondEvent() |
| | | { |
| | | var index = FuncNPCManager.Instance.GetRandomAffairNpcTalk(); |
| | | var talk = FuncNPCManager.Instance.GetAffairTalk(funcNPCs[index].heroSkinID); |
| | | var skinID = FuncNPCManager.Instance.GetRandomAffairNpcTalk(); |
| | | var talk = FuncNPCManager.Instance.GetAffairTalk(skinID); |
| | | var index = 0; |
| | | for (int i = 0; i < funcNPCs.Length; i++) |
| | | { |
| | | if (funcNPCs[i].heroSkinID == skinID) |
| | | { |
| | | index = i; |
| | | break; |
| | | } |
| | | } |
| | | if (talk != null) |
| | | { |
| | | talkTexts[index].text = Language.Get(talk); |
| | |
| | | //内政NPC |
| | | Dictionary<int, string[]> affairNpcTalkDic = new Dictionary<int, string[]>(); |
| | | public List<int> affairTalkIndexList = new List<int>(); |
| | | public Dictionary<int, int> funcNPCToFuncID = new Dictionary<int, int>(); |
| | | public float lastAffairTalkTime; |
| | | public int lastAffiarRandomIndex; |
| | | |
| | |
| | | affairNpcTalkDic.Add(npcID, talkList); |
| | | } |
| | | |
| | | for (int i = 0; i < affairNpcTalkDic.Count; i++) |
| | | { |
| | | affairTalkIndexList.Add(i); |
| | | } |
| | | |
| | | |
| | | json = JsonMapper.ToObject(config.Numerical2); |
| | | keys = json.Keys.ToList(); |
| | |
| | | guildTalkIndexList.Add(i); |
| | | } |
| | | |
| | | funcNPCToFuncID = ConfigParse.ParseIntDict(config.Numerical3); |
| | | } |
| | | |
| | | |
| | | void RefreshAffairTalkIndexList() |
| | | { |
| | | affairTalkIndexList.Clear(); |
| | | foreach (var key in affairNpcTalkDic.Keys) |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcNPCToFuncID[key])) |
| | | { |
| | | continue; |
| | | } |
| | | if (funcNPCToFuncID[key] == 54 && MinggeManager.Instance.isStartAuto) |
| | | { |
| | | //算命中不参与喊话 |
| | | continue; |
| | | } |
| | | affairTalkIndexList.Add(key); |
| | | } |
| | | } |
| | | |
| | | |
| | | //随机某个NPC对话,与上一次随机的NPC索引不重复 |
| | | //返回NPCID |
| | | public int GetRandomAffairNpcTalk() |
| | | { |
| | | RefreshAffairTalkIndexList(); |
| | | int index = Random.Range(0, affairTalkIndexList.Count); |
| | | if (index == lastAffiarRandomIndex) |
| | | { |
| | | index = (index + 1) % affairTalkIndexList.Count; |
| | | } |
| | | lastAffiarRandomIndex = index; |
| | | return index; |
| | | return affairTalkIndexList[index]; |
| | | } |
| | | |
| | | public int GetRandomGuildNpcTalk() |
| | |
| | | void OnOK() |
| | | { |
| | | CloseWindow(); |
| | | if (curUseCount == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("UseItem1"); |
| | | return; |
| | | } |
| | | if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, curUseCount, 2)) |
| | | { |
| | | ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID)); |
| | | ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID), (int)curUseCount); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null || string.IsNullOrEmpty(m_OutputText)) |
| | | { |
| | | return 0f; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(Vector2.zero); |
| | | return cachedTextGeneratorForLayout.GetPreferredWidth(m_OutputText, settings) / pixelsPerUnit; |
| | | |
| | | float width = 0f; |
| | | try |
| | | { |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(m_OutputText, settings) / pixelsPerUnit; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed: {ex.Message}"); |
| | | width = 0f; |
| | | } |
| | | return width; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null || string.IsNullOrEmpty(m_OutputText)) |
| | | { |
| | | return 0f; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(new Vector2(rectTransform.rect.size.x, 0.0f)); |
| | | float _height = cachedTextGeneratorForLayout.GetPreferredHeight(m_OutputText, settings) / pixelsPerUnit; |
| | | return _height; |
| | | |
| | | float height = 0f; |
| | | try |
| | | { |
| | | height = cachedTextGeneratorForLayout.GetPreferredHeight(m_OutputText, settings) / pixelsPerUnit; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredHeight failed: {ex.Message}"); |
| | | height = 0f; |
| | | } |
| | | return height; |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | |
| | | private Dictionary<int, Match> matchDics = new Dictionary<int, Match>(); |
| | | |
| | | // 字符宽度缓存,避免重复计算相同字符 |
| | | private Dictionary<string, float> charWidthCache = new Dictionary<string, float>(); |
| | | |
| | | private bool IsModifySize(int _index,out int _size) |
| | | { |
| | | _size = 0; |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null) |
| | | { |
| | | Debug.LogWarning("SetFitterSize: font, rectTransform or cachedTextGeneratorForLayout is null"); |
| | | return; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(Vector2.zero); |
| | | |
| | | float cache = 0; |
| | |
| | | float ratio = GetResolutionRatio(); |
| | | |
| | | matchDics.Clear(); |
| | | charWidthCache.Clear(); |
| | | |
| | | foreach (Match match in ImgAnalysis.Unity_Img_Regex.Matches(fitterText)) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(match.Value, settings) * ratio; |
| | | cache = GetCharWidthCached(match.Value, settings, ratio); |
| | | |
| | | if (width + cache > (rectTransform.rect.width - 5)) |
| | | { |
| | | CacluHrefAndImgIndex(Mathf.Max(0, i - 1)); |
| | |
| | | else |
| | | { |
| | | var _size = 0; |
| | | var _cacheFontSize = fontSize; |
| | | // 不再修改 fontSize,使用临时 TextGenerator 计算不同字号的宽度 |
| | | if (_modifySize && IsModifySize(i, out _size)) |
| | | { |
| | | fontSize = _size; |
| | | settings = GetGenerationSettings(Vector2.zero); |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(fitterText[i].ToString(), settings) * ratio; |
| | | fontSize = _cacheFontSize; |
| | | settings = GetGenerationSettings(Vector2.zero); |
| | | cache = GetCharWidthWithCustomSize(fitterText[i], _size, ratio); |
| | | } |
| | | else |
| | | { |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(fitterText[i].ToString(), settings) * ratio; |
| | | cache = GetCharWidthCached(fitterText[i].ToString(), settings, ratio); |
| | | } |
| | | |
| | | if (width + cache > (rectTransform.rect.width - 5)) |
| | | { |
| | | CacluHrefAndImgIndex(Mathf.Max(0, i - 1)); |
| | |
| | | m_OutputText = textBuilder.ToString(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取字符宽度(带缓存) |
| | | /// </summary> |
| | | private float GetCharWidthCached(string charStr, TextGenerationSettings settings, float ratio) |
| | | { |
| | | string cacheKey = $"{fontSize}_{charStr}"; |
| | | |
| | | if (charWidthCache.ContainsKey(cacheKey)) |
| | | { |
| | | return charWidthCache[cacheKey]; |
| | | } |
| | | |
| | | float width = 0; |
| | | try |
| | | { |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(charStr, settings) * ratio; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed for '{charStr}': {ex.Message}"); |
| | | width = 0; |
| | | } |
| | | |
| | | charWidthCache[cacheKey] = width; |
| | | return width; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 使用自定义字号计算字符宽度(不修改原始 Text 组件的 fontSize) |
| | | /// </summary> |
| | | private float GetCharWidthWithCustomSize(char c, int customFontSize, float ratio) |
| | | { |
| | | string charStr = c.ToString(); |
| | | string cacheKey = $"{customFontSize}_{charStr}"; |
| | | |
| | | if (charWidthCache.ContainsKey(cacheKey)) |
| | | { |
| | | return charWidthCache[cacheKey]; |
| | | } |
| | | |
| | | float width = 0; |
| | | try |
| | | { |
| | | // 创建临时的 TextGenerationSettings,使用自定义字号 |
| | | TextGenerationSettings tempSettings = GetGenerationSettings(Vector2.zero); |
| | | tempSettings.fontSize = customFontSize; |
| | | |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(charStr, tempSettings) * ratio; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed for '{charStr}' with fontSize {customFontSize}: {ex.Message}"); |
| | | width = 0; |
| | | } |
| | | |
| | | charWidthCache[cacheKey] = width; |
| | | return width; |
| | | } |
| | | |
| | | private void CacluHrefAndImgIndex(int index) |
| | | { |
| | | for (int i = 0; i < m_ImgList.Count; i++) |
| | |
| | | return viewPlayerData; |
| | | } |
| | | |
| | | // 向服务端请求其他玩家数据 |
| | | public void ViewPlayerDetail(int playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewBattlePreSetType = (int)BattlePreSetType.Story) |
| | | // 向服务端请求其他玩家数据 serverID发0默认本服玩家 |
| | | public void ViewPlayerDetail(int playerId, int serverID, int viewType = (int)ViewPlayerType.viewPlayerData, int viewBattlePreSetType = (int)BattlePreSetType.Story) |
| | | { |
| | | // 自己不能查看自己的信息 |
| | | if (playerId == PlayerDatas.Instance.baseData.PlayerID) |
| | |
| | | |
| | | viewPlayerType = viewType; |
| | | viewPreSetType = viewBattlePreSetType; |
| | | ViewRoleParticulars(playerId); |
| | | ViewRoleParticulars(playerId, serverID); |
| | | } |
| | | |
| | | // 向服务端请求玩家数据 |
| | | void ViewRoleParticulars(int playerID) |
| | | void ViewRoleParticulars(int playerID, int serverID) |
| | | { |
| | | if (playerID <= 0) |
| | | return; |
| | |
| | | |
| | | CA212_tagCMViewPlayerInfo pak = new CA212_tagCMViewPlayerInfo(); |
| | | pak.PlayerID = (uint)playerID; |
| | | pak.ServerID = (uint)serverID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | } |
| | | public void OnRevRoleEquip(HA705_tagSCQueryPlayerCacheResult package) |
| | |
| | | viewPlayerData.FamilyID = (int)package.FamilyID; |
| | | viewPlayerData.FamilyName = UIHelper.ServerStringTrim(package.FamilyName); |
| | | viewPlayerData.FamilyEmblemID = (int)package.FamilyEmblemID; |
| | | viewPlayerData.FamilyDataServerID = (int)package.FamilyDataServerID; |
| | | viewPlayerData.FamilyEmblemWord = UIHelper.ServerStringTrim(package.FamilyEmblemWord); |
| | | |
| | | |
| | |
| | | { |
| | | if (viewPlayerType == (int)ViewPlayerType.viewPlayerData) |
| | | { |
| | | if (!UIManager.Instance.IsOpened<OtherPlayerDetailWin>()) |
| | | if (UIManager.Instance.IsOpened<OtherPlayerDetailWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<OtherPlayerDetailWin>(viewPreSetType); |
| | | UIManager.Instance.CloseWindow<OtherPlayerDetailWin>(); |
| | | } |
| | | UIManager.Instance.OpenWindow<OtherPlayerDetailWin>(viewPreSetType); |
| | | } |
| | | |
| | | OnRevPackage?.Invoke(viewPlayerType, playerID); |
| | |
| | | public int ServerID; |
| | | public long FightPower; |
| | | public int FamilyID; |
| | | public int FamilyDataServerID; //公会数据所在服务器ID,A619查看公会用 |
| | | public string FamilyName; |
| | | public int FamilyEmblemID; |
| | | public string FamilyEmblemWord; |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList += OnRefreshFairyList; |
| | | GuildManager.Instance.OnUpdateViewFamilyInfo += OnUpdateViewFamilyInfo; |
| | | funcPresetID = OtherPlayerDetailManager.Instance.GetFuncPresetID(manager.viewPlayer, functionOrder, (int)FuncPresetType.Global); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList -= OnRefreshFairyList; |
| | | GuildManager.Instance.OnUpdateViewFamilyInfo -= OnUpdateViewFamilyInfo; |
| | | } |
| | | |
| | | private void OnRefreshFairyList() |
| | | private void OnUpdateViewFamilyInfo() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (!GuildManager.Instance.guildsDict.ContainsKey(viewPlayerData.FamilyID)) |
| | | if (!GuildManager.Instance.viewGuildsDict.ContainsKey(viewPlayerData.FamilyID)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | SysNotifyMgr.Instance.ShowTip("GuildTip01"); |
| | | return; |
| | | } |
| | | GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString()); |
| | | GuildManager.Instance.SendViewGuild(viewPlayerData.FamilyID, viewPlayerData.FamilyDataServerID); |
| | | } |
| | | |
| | | private void OnClickMM() |
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData);
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public static class AvatarHelper
|
| | | {
|
| | | public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
|
| | | //serverID发0默认本服玩家
|
| | | public static void TryViewOtherPlayerInfo(int playerId, int serverID = 0, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | if (playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | return;
|
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(_playerId, viewType, viewPlayerLineupType);
|
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, serverID, viewType, viewPlayerLineupType);
|
| | | }
|
| | |
|
| | | public static AvatarModel GetAvatarModel(int playerId, int face, int facePic, int job = 0)
|
| | | {
|
| | | bool isMyself = playerId == PlayerDatas.Instance.PlayerId;
|
| | |
| | | { |
| | | case BattleConst.ArenaBattleField: |
| | | int playerId = (int)ArenaManager.Instance.atkPlayerId; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, (int)ViewPlayerType.viewArenaBattleEnemyHero, (int)BattlePreSetType.Arena); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, 0, (int)ViewPlayerType.viewArenaBattleEnemyHero, (int)BattlePreSetType.Arena); |
| | | break; |
| | | } |
| | | return; |
| | |
| | | { |
| | | return (int)(GetTodayEndTime() - ServerNow).TotalSeconds; |
| | | } |
| | | |
| | | #region 跨服和本服公用接口 |
| | | //当有的功能会从本服功能变成跨服功能的时候统一用这些接口处理时间 |
| | | //各自的功能传自己的zoneID |
| | | |
| | | // 获取当前时间, 公会跨区前取本服时间,跨服后取跨服时间 |
| | | public static DateTime GetCommServerNow(int zoneID = 0) |
| | | { |
| | | if (zoneID == 0) |
| | | { |
| | | return ServerNow; |
| | | } |
| | | else |
| | | { |
| | | return CrossServerNow; |
| | | } |
| | | } |
| | | |
| | | public static int GetCommServerTick(int zoneID = 0) |
| | | { |
| | | if (zoneID == 0) |
| | | { |
| | | return AllSeconds; |
| | | } |
| | | else |
| | | { |
| | | return AllSecondsCrossServer; |
| | | } |
| | | } |
| | | |
| | | public static DateTime GetCommTodayEndTime(int zoneID = 0) |
| | | { |
| | | var now = GetCommServerNow(zoneID).AddDays(1); |
| | | return new DateTime(now.Year, now.Month, now.Day); |
| | | } |
| | | #endregion |
| | | } |