Beispiel #1
0
 public void setEndOfGameStats(byte[] content)
 {
     if (content == null)
     {
         Logger.Instance.WriteLog("EndOfGameStatas bytes is null");
         return;
     }
     this.endOfGameStatsBytes = content;
     this.gameStats           = new EndOfGameStats(this.endOfGameStatsBytes);
     if (!this.gameStats.DecodeData())
     {
         return;
     }
     if (this.gameStats.Players != null)
     {
         if (this.gameStats.Players.Count > 0)
         {
             this.players = new PlayerInfo[this.gameStats.Players.Count];
             for (int i = 0; i < this.gameStats.Players.Count; i++)
             {
                 this.players[i] = new PlayerInfo();
                 this.players[i].championName = this.gameStats.Players[i].SkinName;
                 this.players[i].playerName   = this.gameStats.Players[i].SummonerName;
                 this.players[i].team         = this.gameStats.Players[i].TeamId;
                 this.players[i].clientID     = i;
             }
         }
     }
 }
Beispiel #2
0
        public void readFromFile(string path, bool withOutChunks)
        {
            this.relatedFileName = path;
            try
            {
                FileStream   lprFile    = new FileStream(path, FileMode.Open, FileAccess.Read);
                BinaryReader dataReader = new BinaryReader(lprFile);
                int          lenTemp;
                this.ThisLPRVersion = dataReader.ReadInt32();
                if (this.ThisLPRVersion >= 0)                                    //Lowest need Version
                {
                    lenTemp = dataReader.ReadInt32();                            //4 byte for recording spec version string length
                    this.spectatorClientVersion = dataReader.ReadChars(lenTemp); //n byte for recording spec version string

                    this.gameId = dataReader.ReadInt64();
                    this.gameEndStartupChunkId    = dataReader.ReadInt32();
                    this.gameStartChunkId         = dataReader.ReadInt32();
                    this.gameEndChunkId           = dataReader.ReadInt32();
                    this.gameEndKeyFrameId        = dataReader.ReadInt32();
                    this.gameLength               = dataReader.ReadInt32();
                    this.gameDelayTime            = dataReader.ReadInt32();
                    this.gameClientAddLag         = dataReader.ReadInt32();
                    this.gameChunkTimeInterval    = dataReader.ReadInt32();
                    this.gameKeyFrameTimeInterval = dataReader.ReadInt32();
                    this.gameELOLevel             = dataReader.ReadInt32();
                    this.gameLastChunkTime        = dataReader.ReadInt32();
                    this.gameLastChunkDuration    = dataReader.ReadInt32();

                    lenTemp                    = dataReader.ReadInt32();
                    this.gamePlatform          = dataReader.ReadChars(lenTemp);
                    lenTemp                    = dataReader.ReadInt32();
                    this.observerEncryptionKey = dataReader.ReadChars(lenTemp);
                    lenTemp                    = dataReader.ReadInt32();
                    this.gameCreateTime        = dataReader.ReadChars(lenTemp);
                    lenTemp                    = dataReader.ReadInt32();
                    this.gameStartTime         = dataReader.ReadChars(lenTemp);
                    lenTemp                    = dataReader.ReadInt32();
                    this.gameEndTime           = dataReader.ReadChars(lenTemp);

                    lenTemp         = dataReader.ReadInt32();
                    this.lolVersion = dataReader.ReadChars(lenTemp);

                    Boolean resultExists = dataReader.ReadBoolean();
                    if (resultExists)
                    {
                        lenTemp = dataReader.ReadInt32();
                        this.endOfGameStatsBytes = dataReader.ReadBytes(lenTemp);
                        this.gameStats           = new EndOfGameStats(this.endOfGameStatsBytes);
                    }
                    if (dataReader.ReadBoolean())
                    {
                        readPlayerOldFormat(dataReader);
                    }

                    if (!withOutChunks)
                    {
                        readChunks(dataReader);
                    }
                    dataReader.Close();
                    lprFile.Close();
                }
            }
            catch
            {
                IsBroken = true;
            }
        }