| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using System.Threading; |
| | | using LitJson; |
| | | |
| | | public class ServerListParser : SingletonMonobehaviour<ServerListParser> |
| | |
| | | public void PushCommonServerListRawData(string content) |
| | | { |
| | | hasCommonResult = false; |
| | | ThreadPool.QueueUserWorkItem((object aaa) => |
| | | { |
| | | serverInfoCommon = JsonMapper.ToObject<ServerInfoCommon>(content); |
| | | hasCommonResult = true; |
| | | }); |
| | | ParseCommonServerListAsync(content).Forget(); |
| | | } |
| | | |
| | | private async UniTaskVoid ParseCommonServerListAsync(string content) |
| | | { |
| | | await UniTask.Yield(); |
| | | serverInfoCommon = JsonMapper.ToObject<ServerInfoCommon>(content); |
| | | hasCommonResult = true; |
| | | } |
| | | |
| | | public void PushPlayerServerListRawData(string content) |
| | |
| | | if (RankArr["player"]["group_list"].Count == 0) |
| | | return; |
| | | |
| | | ThreadPool.QueueUserWorkItem((object aaa) => |
| | | { |
| | | serverInfoPlayer = JsonMapper.ToObject<ServerInfoPlayer>(content); |
| | | hasPlayerResult = true; |
| | | SetIsInWhiteList(); |
| | | }); |
| | | ParsePlayerServerListAsync(content).Forget(); |
| | | } |
| | | |
| | | private async UniTaskVoid ParsePlayerServerListAsync(string content) |
| | | { |
| | | await UniTask.Yield(); |
| | | serverInfoPlayer = JsonMapper.ToObject<ServerInfoPlayer>(content); |
| | | hasPlayerResult = true; |
| | | SetIsInWhiteList(); |
| | | } |
| | | |
| | | public void ReportCommonResult() |