Ejemplo n.º 1
0
 public void Reset()
 {
     if (this.mTurnLog == null)
     {
         this.mTurnLog = new Dictionary <int, List <SceneBattle.MultiPlayRecvData> >();
     }
     this.mTurnLog.Clear();
     this.mStartedParam           = (AudienceStartParam)null;
     this.mRoomParam              = (JSON_MyPhotonRoomParam)null;
     this.mNonAnalyzeLog          = (string)null;
     this.mReadCnt                = 0;
     this.mRetryStartQuestCnt     = 0;
     this.mDownloadLogger         = (DownloadLogger)null;
     this.mDownloadLogger         = new DownloadLogger();
     this.mDownloadLogger.Manager = this;
     this.mState = VersusAudienceManager.CONNECT_STATE.REQ;
 }
Ejemplo n.º 2
0
        public void Analyze(string log)
        {
            string json = string.Empty;
            string src  = string.Empty;

            if (!string.IsNullOrEmpty(this.mNonAnalyzeLog))
            {
                log = this.mNonAnalyzeLog + log;
                this.mNonAnalyzeLog = string.Empty;
            }
            if (log.IndexOf("creatorName") != -1)
            {
                json = log;
            }
            else if (log.IndexOf("players") != -1)
            {
                src = log;
            }
            else if (log.IndexOf("bm") != -1)
            {
                try
                {
                    byte[] data = MyEncrypt.Decrypt(((AudienceLog)JsonUtility.FromJson <AudienceLog>(log)).bm);
                    SceneBattle.MultiPlayRecvData buffer;
                    if (GameUtility.Binary2Object <SceneBattle.MultiPlayRecvData>(out buffer, data))
                    {
                        if (!this.mTurnLog.ContainsKey(buffer.b))
                        {
                            this.mTurnLog[buffer.b] = new List <SceneBattle.MultiPlayRecvData>();
                        }
                        this.mTurnLog[buffer.b].Add(buffer);
                    }
                }
                catch
                {
                    this.mNonAnalyzeLog = log;
                }
            }
            else if (log.IndexOf("bin") != -1)
            {
                try
                {
                    SceneBattle.MultiPlayRecvBinData multiPlayRecvBinData = (SceneBattle.MultiPlayRecvBinData)JsonUtility.FromJson <SceneBattle.MultiPlayRecvBinData>(log);
                    string buffer;
                    GameUtility.Binary2Object <string>(out buffer, multiPlayRecvBinData.bin);
                    this.Analyze(buffer);
                    return;
                }
                catch
                {
                    this.mNonAnalyzeLog = log;
                }
            }
            else
            {
                this.mNonAnalyzeLog = log;
            }
            if (!string.IsNullOrEmpty(json))
            {
                try
                {
                    this.mRoomParam = JSON_MyPhotonRoomParam.Parse(json);
                }
                catch
                {
                    Debug.LogWarning((object)json);
                    this.mNonAnalyzeLog = json;
                }
            }
            if (string.IsNullOrEmpty(src))
            {
                return;
            }
            try
            {
                this.mStartedParam = JSONParser.parseJSONObject <AudienceStartParam>(src);
            }
            catch
            {
                Debug.LogWarning((object)src);
                this.mNonAnalyzeLog = src;
            }
        }