コード例 #1
0
        public override async Task PopulateAsync()
        {
            using (var stream = new MinecraftStream(this.PacketData))
            {
                var secretLength = await stream.ReadVarIntAsync();

                this.SharedSecret = await stream.ReadUInt8ArrayAsync(secretLength);

                var tokenLength = await stream.ReadVarIntAsync();

                this.VerifyToken = await stream.ReadUInt8ArrayAsync(tokenLength);
            }
        }
コード例 #2
0
        public override async Task PopulateAsync()
        {
            using (var stream = new MinecraftStream(this.PacketData))
            {
                this.ServerId = await stream.ReadStringAsync() ?? string.Empty;

                var keyLength = await stream.ReadVarIntAsync();

                this.PublicKey = await stream.ReadUInt8ArrayAsync(keyLength);

                var tokenLength = await stream.ReadVarIntAsync();

                this.VerifyToken = await stream.ReadUInt8ArrayAsync(tokenLength);
            }
        }
コード例 #3
0
ファイル: PluginMessage.cs プロジェクト: roxxel/Obsidian
        public async Task ReadAsync(MinecraftStream stream)
        {
            this.Channel = await stream.ReadStringAsync();

            var length = stream.Length - stream.Position;

            this.PluginData = await stream.ReadUInt8ArrayAsync((int)length);
        }
コード例 #4
0
        public static async Task <Packet> ReadCompressedPacketAsync(MinecraftStream stream)
        {
            var packetLength = await stream.ReadVarIntAsync();

            var dataLength = await stream.ReadVarIntAsync();

            using var deStream = new MinecraftStream(new ZlibStream(stream, SharpCompress.Compressors.CompressionMode.Decompress, CompressionLevel.BestSpeed));

            var packetId = await deStream.ReadVarIntAsync();

            var packetData = await deStream.ReadUInt8ArrayAsync(dataLength - packetId.GetVarIntLength());

            return(new Packet(packetId, packetData));
        }
コード例 #5
0
ファイル: PluginMessage.cs プロジェクト: oliver4888/Obsidian
        public async Task ReadAsync(MinecraftStream stream)
        {
            this.Channel = await stream.ReadStringAsync();

            this.PluginData = await stream.ReadUInt8ArrayAsync();
        }