Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
| 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: |
| 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: |
| | |
| | | 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: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A7 05 查询玩家详细信息结果#tagSCQueryPlayerCacheResult
|
| | |
|
| | | public class HA705_tagSCQueryPlayerCacheResult : GameNetPackBasic {
|
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | }
|
| | | } |
| | |
| | | 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;
|
| | |
| | |
|
| | | #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 申请列表
|
| | | public event Action OnRefreshApplyList;
|
| | | private List<FairyApply> applyList = new List<FairyApply>();
|
| | |
| | | |
| | | 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; |
| | | leaderServerID = guildInfo.ServerID; |
| | |
| | | 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() |