public void ReadFrom(ref SpanBufferReader bufferReader) { ServerName = bufferReader.ReadString(); UserId = bufferReader.ReadString(); UserName = bufferReader.ReadString(); Secret = bufferReader.ReadString(); Password = bufferReader.ReadString(); CurrentPlayerCount = bufferReader.ReadVarInt(); MaximumPlayerCount = bufferReader.ReadVarInt(); DiscoveryPolicy = (DiscoveryPolicy)bufferReader.ReadByte(); InvitePolicy = (InvitePolicy)bufferReader.ReadByte(); Configuration = new GameplayServerConfiguration(); Configuration.ReadFrom(ref bufferReader); Random = bufferReader.ReadBytes(32).ToArray(); PublicKey = bufferReader.ReadVarBytes().ToArray(); }
public void ReadFrom(ref SpanBufferReader bufferReader) { Platform = (Platform)bufferReader.ReadByte(); UserId = bufferReader.ReadString(); UserName = bufferReader.ReadString(); SessionToken = bufferReader.ReadVarBytes().ToArray(); }
public override void ReadFrom(ref SpanBufferReader bufferReader) { BeatmapDifficultyMask = (BeatmapDifficultyMask)bufferReader.ReadByte(); GameplayModifiersMask = (GameplayModifiersMask)bufferReader.ReadUInt16(); SongPackBloomFilterTop = bufferReader.ReadUInt64(); SongPackBloomFilterBottom = bufferReader.ReadUInt64(); }
public override void ReadFrom(ref SpanBufferReader bufferReader) { Result = (ResultCode)bufferReader.ReadByte(); if (!Success) { return; } RemoteEndPoint = bufferReader.ReadIPEndPoint(); Code = bufferReader.ReadString(); }
public override void ReadFrom(ref SpanBufferReader bufferReader) { UserId = bufferReader.ReadString(); UserName = bufferReader.ReadString(); RemoteEndPoint = bufferReader.ReadIPEndPoint(); Random = bufferReader.ReadBytes(32).ToArray(); PublicKey = bufferReader.ReadVarBytes().ToArray(); var flags = bufferReader.ReadByte(); IsConnectionOwner = (flags & 1) > 0; IsDedicatedServer = (flags & 2) > 0; }
public override void ReadFrom(ref SpanBufferReader bufferReader) { Result = (ResultCode)bufferReader.ReadUInt8(); if (!Success) { return; } UserId = bufferReader.ReadString(); UserName = bufferReader.ReadString(); Secret = bufferReader.ReadString(); DiscoveryPolicy = (DiscoveryPolicy)bufferReader.ReadByte(); InvitePolicy = (InvitePolicy)bufferReader.ReadByte(); MaximumPlayerCount = bufferReader.ReadVarInt(); Configuration = new GameplayServerConfiguration(); Configuration.ReadFrom(ref bufferReader); var flags = bufferReader.ReadByte(); IsConnectionOwner = (flags & 1) > 0; IsDedicatedServer = (flags & 2) > 0; RemoteEndPoint = bufferReader.ReadIPEndPoint(); Random = bufferReader.ReadBytes(32).ToArray(); PublicKey = bufferReader.ReadVarBytes().ToArray(); }
public void TestReadEndOfBuffer() { using var bufferWriter = new SpanBufferWriter(stackalloc byte[64]); bufferWriter.WriteString("test", Encoding.UTF8); var bufferReader = new SpanBufferReader(bufferWriter); _ = bufferReader.ReadString(Encoding.UTF8); try { bufferReader.ReadByte(); } catch (EndOfBufferException) { Assert.Pass(); return; } Assert.Fail(); }
public void ReadFrom(ref SpanBufferReader bufferReader) { Result = (ResultCode)bufferReader.ReadByte(); }