コード例 #1
0
ファイル: RoflParser.cs プロジェクト: themotu/ReplayBook
        private static PayloadFields ParsePayloadHeader(byte[] bytedata)
        {
            var result = new PayloadFields {
            };

            result.MatchId             = BitConverter.ToUInt64(bytedata, 0);
            result.MatchLength         = BitConverter.ToUInt32(bytedata, 8);
            result.KeyframeAmount      = BitConverter.ToUInt32(bytedata, 12);
            result.ChunkAmount         = BitConverter.ToUInt32(bytedata, 16);
            result.EndChunkID          = BitConverter.ToUInt32(bytedata, 20);
            result.StartChunkID        = BitConverter.ToUInt32(bytedata, 24);
            result.KeyframeInterval    = BitConverter.ToUInt32(bytedata, 28);
            result.EncryptionKeyLength = BitConverter.ToUInt16(bytedata, 32);
            result.EncryptionKey       = Encoding.UTF8.GetString(bytedata, 34, result.EncryptionKeyLength);

            return(result);
        }
コード例 #2
0
        private static PayloadFields ParseMatchHeader(JObject jsonObject)
        {
            var result = new PayloadFields {
            };

            result.MatchId             = (ulong)jsonObject["matchID"];
            result.MatchLength         = (uint)jsonObject["matchLength"];
            result.KeyframeAmount      = 0;
            result.ChunkAmount         = 0;
            result.EndChunkID          = 0;
            result.StartChunkID        = 0;
            result.KeyframeInterval    = 0;
            result.EncryptionKeyLength = 0;
            result.EncryptionKey       = (string)jsonObject["encryptionKey"];

            return(result);
        }