515 【挑战】PVP群英榜 - 测试各类排行榜,群英跨服战斗
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 30 查看榜单 #tagCMViewBillboard
|
| | |
|
| | | public class CA130_tagCMViewBillboard : GameNetPackBasic {
|
| | | public byte Type; //榜单类型
|
| | | public uint GroupValue1; //分组值1
|
| | | public uint GroupValue2; //分组值2,与分组值1组合归为同组榜单数据
|
| | | public ushort StartIndex; //查看的起始索引, 默认0 非名次
|
| | | public byte ViewCnt; //查看条数,默认20,单次最大不超过100,和StartIndex关联
|
| | | public uint ViewID; //附带查看指定ID所在名次前后数据,如玩家ID、家族ID等,与ViewCnt无关,服务端固定返回条数
|
| | | public ushort StartIndex; //查看的起始名次索引, 默认0
|
| | | public byte ViewCnt; //查看条数,默认20,单次最大不超过100
|
| | | public uint ViewID; //附带查看指定ID所在名次前后数据,如玩家ID、家族ID等
|
| | | public uint CrossServerID; //跨服榜时需发送所属跨服服务器ID,0默认本服
|
| | |
|
| | | public CA130_tagCMViewBillboard () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | |
| | | WriteBytes (StartIndex, NetDataType.WORD);
|
| | | WriteBytes (ViewCnt, NetDataType.BYTE);
|
| | | WriteBytes (ViewID, NetDataType.DWORD);
|
| | | WriteBytes (CrossServerID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e7faa43c224a58d489d17e76866fa935 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 10 跨服功能所属分区 #tagSCCrossZoneInfo
|
| | |
|
| | | public class DTCC010_tagSCCrossZoneInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HC010_tagSCCrossZoneInfo vNetData = vNetPack as HC010_tagSCCrossZoneInfo;
|
| | | CrossServerBaseManager.Instance.UpdateSCCrossZoneInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9b77e3d6c1900db4995c9d2fab85f831 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(HAA22_tagSCActHeroAppearPlayerInfo), typeof(DTCAA22_tagSCActHeroAppearPlayerInfo)); |
| | | Register(typeof(HA924_tagSCQunyingMatchList), typeof(DTCA924_tagSCQunyingMatchList)); |
| | | Register(typeof(HA925_tagSCQunyingPlayerInfo), typeof(DTCA925_tagSCQunyingPlayerInfo)); |
| | | Register(typeof(HC010_tagSCCrossZoneInfo), typeof(DTCC010_tagSCCrossZoneInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| | |
| | | public string BatStatMsg; //战斗相关统计信息
|
| | | public string PathDate; //战报路径日期, yyyyMMdd, 为空时代表公共类的战报,不为空时为玩家个人类战报
|
| | | public string GUID; //战报guid,前端根据功能MapID判断是否跨服功能,是的话从跨服服务器下载战报,否的话从本服下载
|
| | | public uint CrossServerID; //战报所在跨服ID,本服时为0
|
| | |
|
| | | public HB431_tagSCTurnFightRet () {
|
| | | _cmd = (ushort)0xB431;
|
| | |
| | | TransBytes (out BatStatMsg, vBytes, NetDataType.Chars, BatLen);
|
| | | TransBytes (out PathDate, vBytes, NetDataType.Chars, 8);
|
| | | TransBytes (out GUID, vBytes, NetDataType.Chars, 40);
|
| | | TransBytes (out CrossServerID, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 15e37157e4f2d9045aaf5e0f0166f99b |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // C0 10 跨服功能所属分区 #tagSCCrossZoneInfo
|
| | |
|
| | | public class HC010_tagSCCrossZoneInfo : GameNetPackBasic {
|
| | | public uint MapID; // 功能地图ID,有收到该封包时代表该功能开始跨服了,但并不一定有分区互通信息,可能处于分配阶段
|
| | | public uint CrossServerID; // 所属跨服服务器ID
|
| | | public uint ZoneID; // 所属分区,可能为0
|
| | | public ushort ServerCnt;
|
| | | public uint[] ServerIDList; // 互通服务器ID列表,可能为空
|
| | |
|
| | | public HC010_tagSCCrossZoneInfo () {
|
| | | _cmd = (ushort)0xC010;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out CrossServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ZoneID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ServerCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ServerIDList, vBytes, NetDataType.DWORD, ServerCnt);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dd35c1a0622229f468c39e902fdfc3af |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | managers.Add(QunyingManager.Instance);
|
| | | managers.Add(ViewBuffManager.Instance);
|
| | | managers.Add(HeroReturnManager.Instance);
|
| | | managers.Add(CrossServerBaseManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | |
| | | |
| | | //数据后续从manager中记录获取 |
| | | [HideInInspector] public int groupValue1 = 0; //一般用于跨服 |
| | | [HideInInspector] public int groupValue2 = 0; //一般用于跨服 |
| | | [HideInInspector] public static int groupValue1 = 0; //一般用于跨服 |
| | | [HideInInspector] public static int groupValue2 = 0; //一般用于跨服 |
| | | [HideInInspector] public static int crossServerID = 0; //一般用于跨服 |
| | | protected int rankType; //从functionOrder获取 |
| | | |
| | | protected override void InitComponent() |
| | |
| | | { |
| | | rankType = functionOrder; |
| | | RankModel.Instance.ResetQueryParam(); |
| | | RankModel.Instance.QueryRankByPage(rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID); |
| | | RankModel.Instance.QueryRankByPage(rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID, |
| | | groupValue1: groupValue1, groupValue2: groupValue2, crossServerID: crossServerID); |
| | | |
| | | RankModel.Instance.onRankRefresh += OnRankRefresh; |
| | | scrollerController.OnRefreshCell += OnRefreshCell; |
| | |
| | | { |
| | | RankModel.Instance.onRankRefresh -= OnRankRefresh; |
| | | scrollerController.OnRefreshCell -= OnRefreshCell; |
| | | |
| | | groupValue1 = 0; |
| | | groupValue2 = 0; |
| | | crossServerID = 0; |
| | | } |
| | | |
| | | protected override void OnClose() |
| | |
| | | { |
| | | var _cell = cell.GetComponent<PlayerRankCell>(); |
| | | _cell.Display(rankType, cell.index + 1); |
| | | RankModel.Instance.ListenRankPage(rankType, cell.index, groupValue1, groupValue2); |
| | | RankModel.Instance.ListenRankPage(rankType, cell.index, groupValue1, groupValue2, crossServerID); |
| | | } |
| | | |
| | | |
| | |
| | | }
|
| | | officialTitleCell.SetActive(true);
|
| | | //rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue));
|
| | | if (rankType == QunyingManager.rankType)
|
| | | if (rankType == QunyingManager.rankType || rankType == QunyingManager.crossRankType)
|
| | | {
|
| | | //区服
|
| | | if (GeneralDefine.IsRobot((int)rankData.id))
|
| | |
| | | //
|
| | | // startIndex 和 count 配对,与watchID无关联
|
| | | // watchID; //查看指定ID名次前后,查询范围服务端已固定,如果只要查指定目标,count可以设置1减少附加信息
|
| | | public void QueryRankByPage(int type, int startIndex = 0, int count = 20, int watchID = 0, bool forceQuery = false, int groupValue1 = 0, int groupValue2 = 0)
|
| | | public void QueryRankByPage(int type, int startIndex = 0, int count = 20, int watchID = 0, bool forceQuery = false,
|
| | | int groupValue1 = 0, int groupValue2 = 0, int crossServerID=0)
|
| | | {
|
| | | if (queryRankCD.ContainsKey(type) && !forceQuery)
|
| | | {
|
| | |
| | | pak.StartIndex = (ushort)startIndex; //排名从0开始
|
| | | pak.ViewCnt = (byte)count;
|
| | | pak.ViewID = (uint)watchID;
|
| | | pak.CrossServerID = (uint)crossServerID;
|
| | |
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | queryRankCD[type] = (int)Time.time;
|
| | | }
|
| | |
|
| | |
|
| | | public void ListenRankPage(int type, int index, int groupValue1 = 0, int groupValue2 = 0)
|
| | | public void ListenRankPage(int type, int index, int groupValue1 = 0, int groupValue2 = 0, int crossServerID = 0)
|
| | | {
|
| | | int page = index / pageCnt;
|
| | | if (index > page * pageCnt + queryPointNum)
|
| | |
| | | }
|
| | | }
|
| | | Debug.LogFormat("分页查询:{0} - {1}", index, page);
|
| | | QueryRankByPage(type, pageCnt * (page + 1), pageCnt, 0, true, groupValue1, groupValue2);
|
| | | QueryRankByPage(type, pageCnt * (page + 1), pageCnt, 0, true, groupValue1, groupValue2, crossServerID);
|
| | | queryPageTimes[page] = Time.realtimeSinceStartup;
|
| | | }
|
| | | }
|
| | |
| | | for (int i = 0; i < package.PageDataCnt; i++)
|
| | | {
|
| | | int orderIndex = (int)package.PageDataList[i].Rank;
|
| | | if (rankType == QunyingManager.rankType && GeneralDefine.IsRobot((int)package.PageDataList[i].ID))
|
| | | if ((rankType == QunyingManager.rankType || rankType == QunyingManager.crossRankType) && GeneralDefine.IsRobot((int)package.PageDataList[i].ID))
|
| | | {
|
| | | //群英榜机器人ID会重复 用排名替换ID
|
| | | package.PageDataList[i].ID = (uint)orderIndex;
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8fae93ee0ca9b9040896b208bbadd15f |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using dnlib.DotNet; |
| | | |
| | | |
| | | public class CrossServerBaseManager : GameSystemManager<CrossServerBaseManager> |
| | | { |
| | | public Dictionary<int, CrossZoneInfo> crossZoneInfoDict = new Dictionary<int, CrossZoneInfo>(); |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | void OnBeforePlayerDataInitialize() |
| | | { |
| | | crossZoneInfoDict.Clear(); |
| | | } |
| | | |
| | | public void UpdateSCCrossZoneInfo(HC010_tagSCCrossZoneInfo netPack) |
| | | { |
| | | crossZoneInfoDict[(int)netPack.MapID] = new CrossZoneInfo() |
| | | { |
| | | MapID = netPack.MapID, |
| | | ZoneID = netPack.ZoneID, |
| | | ServerIDList = netPack.ServerIDList, |
| | | CrossServerID = netPack.CrossServerID |
| | | }; |
| | | |
| | | } |
| | | |
| | | // 没有数据代表不在跨服中,群英有个特殊约定zoneid等于0代表结算中 |
| | | public bool IsOpenCrossServer(int mapID) |
| | | { |
| | | return crossZoneInfoDict.ContainsKey(mapID); |
| | | } |
| | | |
| | | public CrossZoneInfo GetCrossZoneInfo(int mapID) |
| | | { |
| | | if (crossZoneInfoDict.ContainsKey(mapID)) |
| | | { |
| | | return crossZoneInfoDict[mapID]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | public class CrossZoneInfo |
| | | { |
| | | public uint MapID; |
| | | public uint ZoneID; // 所属分区,可能为0 |
| | | public uint CrossServerID; // 所属跨服服务器ID |
| | | public uint[] ServerIDList; // 互通服务器ID列表,可能为空 |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 041122dd73b1a6645a00bfa5ead9b7e9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | LoginManager.Instance.sdkLogined = true; |
| | | var ip = ServerListCenter.Instance.currentServer.region_domain; |
| | | var port = ServerListCenter.Instance.currentServer.login_port; |
| | | var port = ServerListCenter.Instance.currentServer.http_port; |
| | | var gamePort = ServerListCenter.Instance.currentServer.game_port; |
| | | if (!string.IsNullOrEmpty(serverId.text)) |
| | | { |
| | |
| | | { |
| | | m_ServerName.text = _serverData.name.Replace("@gm", ""); |
| | | m_ServerIP = _serverData.region_domain; |
| | | m_Port = _serverData.login_port; |
| | | m_Port = _serverData.http_port; |
| | | m_GamePort = _serverData.game_port; |
| | | |
| | | switch ((ServerState)_serverData.running_status) |
| | |
| | | { |
| | | public ServerGroup recommend; |
| | | public ServerGroup[] common; |
| | | public ServerGroup[] crossserver; |
| | | |
| | | public bool FindServerData(int _id, out ServerData _serverData) |
| | | { |
| | |
| | | public int statue; |
| | | public int is_recommend; |
| | | public string region_domain; |
| | | public int login_port; |
| | | public int game_port; |
| | | public int login_port; //旧的 废弃 用新 http_port 但是为了兼容切换过程先留着,后续同步删除 |
| | | public int http_port; //网页相关的请求 |
| | | public int game_port; //游戏socket的登录端口 |
| | | public int web_game_port; //游戏web登录端口 |
| | | public DateTime start_date; |
| | | public int job; |
| | | public string roleid; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //跨服服务器 不展示但是可以搜索用 |
| | | if (serverInfoCommon != null && serverInfoCommon.crossserver != null) |
| | | { |
| | | for (int i = 0; i < serverInfoCommon.crossserver.Length; i++) |
| | | { |
| | | var group = serverInfoCommon.crossserver[i]; |
| | | for (int j = 0; j < group.group_list.Length; j++) |
| | | { |
| | | var serverData = group.group_list[j]; |
| | | if (serverData.region_flag == _id) |
| | | { |
| | | return serverData; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //从白名单的服务器表中查找(测试用) |
| | | if (serverInfoPlayer != null && serverInfoPlayer.gametest != null && serverInfoPlayer.gametest.group_list != null) |
| | |
| | | { |
| | | return $"{defaultHead}{data.region_domain}:{replacePort}"; |
| | | } |
| | | return $"{defaultHead}{data.region_domain}:{data.login_port}"; |
| | | |
| | | //旧的兼容 |
| | | if (data.login_port > 0) |
| | | return $"{defaultHead}{data.region_domain}:{data.login_port}"; |
| | | return $"{defaultHead}{data.region_domain}:{data.http_port}"; |
| | | |
| | | } |
| | | |
| | |
| | | statue = serverData.statue, |
| | | is_recommend = serverData.is_recommend, |
| | | region_domain = serverData.region_domain, |
| | | login_port = serverData.login_port, |
| | | http_port = serverData.http_port, |
| | | game_port = serverData.game_port, |
| | | start_date = serverData.start_date, |
| | | job = originalData.job, |
| | |
| | | [SerializeField] Button awardBtn; |
| | | [SerializeField] Button noteBtn; |
| | | |
| | | int rankType = 0; |
| | | protected override void InitComponent() |
| | | { |
| | | closeBtn.AddListener(CloseWindow); |
| | |
| | | }); |
| | | rankBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<PlayerRankWin>(QunyingManager.rankType); |
| | | var zoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(QunyingManager.DataMapID); |
| | | PlayerRankWin.groupValue1 = zoneInfo != null ? (int)zoneInfo.ZoneID : 0; |
| | | PlayerRankWin.crossServerID = zoneInfo != null ? (int)zoneInfo.CrossServerID : 0; |
| | | UIManager.Instance.OpenWindow<PlayerRankWin>(rankType); |
| | | }); |
| | | awardBtn.AddListener(() => |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | rankType = QunyingManager.Instance.GetRankType(); |
| | | if (!QunyingManager.Instance.openQYWinNeedRoll) |
| | | { |
| | | var myMatch = QunyingManager.Instance.GetMyMatchInfo(out int index); |
| | |
| | | battleScrollRect.verticalNormalizedPosition = 1f; |
| | | } |
| | | RankModel.Instance.ResetQueryParam(); |
| | | RankModel.Instance.QueryRankByPage(QunyingManager.rankType, 0, 3); |
| | | var zoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(QunyingManager.DataMapID); |
| | | int zoneID = zoneInfo != null ? (int)zoneInfo.ZoneID : 0; |
| | | int csID = zoneInfo != null ? (int)zoneInfo.CrossServerID : 0; |
| | | RankModel.Instance.QueryRankByPage(rankType, 0, 3, groupValue1: zoneID, crossServerID: csID); |
| | | QunyingManager.Instance.RequestRefreshFighters(0); |
| | | |
| | | RankModel.Instance.onRankRefresh += OnRankRefresh; |
| | |
| | | void OnDayEvent() |
| | | { |
| | | RankModel.Instance.ResetQueryParam(); |
| | | RankModel.Instance.QueryRankByPage(QunyingManager.rankType, 0, 3); |
| | | var zoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(QunyingManager.DataMapID); |
| | | int zoneID = zoneInfo != null ? (int)zoneInfo.ZoneID : 0; |
| | | int csID = zoneInfo != null ? (int)zoneInfo.CrossServerID : 0; |
| | | RankModel.Instance.QueryRankByPage(rankType, 0, 3, groupValue1: zoneID, crossServerID: csID); |
| | | QunyingManager.Instance.RequestRefreshFighters(0); |
| | | |
| | | } |
| | |
| | | { |
| | | for (int i = 0; i < playerTop3Cells.Length; i++) |
| | | { |
| | | playerTop3Cells[i].Display(QunyingManager.rankType, i + 1); |
| | | playerTop3Cells[i].Display(rankType, i + 1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | void OnRankRefresh(int type) |
| | | { |
| | | if (type != QunyingManager.rankType) |
| | | if (type != rankType) |
| | | return; |
| | | DisplayPlayerTop3(); |
| | | } |
| | |
| | | public const int challengeMoneyType = 56; //挑战 问鼎令 |
| | | public const int challengeShopID = 16; |
| | | public const int rankType = 10; |
| | | public const int crossRankType = 150; |
| | | public const int recType = 312; // 挑战记录类型 |
| | | public const int DataMapID = 32000; |
| | | |
| | |
| | | { |
| | | matchRedpoint.state = RedPointState.Simple; |
| | | } |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | public int GetRankType() |
| | | { |
| | | if (CrossServerBaseManager.Instance.IsOpenCrossServer(DataMapID)) |
| | | { |
| | | return crossRankType; |
| | | } |
| | | return rankType; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public class QunyingMatchInfo |
| | |
| | | { |
| | | Debug.Log("战斗时序 收到B431 并请求下载战报" + Time.time); |
| | | var date = UIHelper.ServerStringTrim(netData.PathDate); |
| | | RequestTurnFightData(guid, date, mapID); |
| | | RequestTurnFightData(guid, date, mapID, (int)netData.CrossServerID); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | public void RequestTurnFightData(string guid, string date, int mapID) |
| | | public void RequestTurnFightData(string guid, string date, int mapID, int crossServerID = 0) |
| | | { |
| | | //mobile.secondworld.net.cn:53080\S9006\20251202\3042602\5b11338f-cf2c-11f0-a0a0-000c29b22418.tfr |
| | | var serverID = UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID); |
| | | var serverID = crossServerID !=0 ? crossServerID : UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID); |
| | | |
| | | var url = ServerListCenter.Instance.GetServerUrl(serverID); |
| | | string assetVersionUrl = string.Empty; |