示例#1
0
 public override void ReadFrom(ref SpanBufferReader bufferReader)
 {
     UserId             = bufferReader.ReadString();
     UserName           = bufferReader.ReadString();
     Secret             = bufferReader.ReadString();
     CurrentPlayerCount = bufferReader.ReadVarUInt();
 }
示例#2
0
 public void ReadFrom(ref SpanBufferReader bufferReader)
 {
     Platform     = (Platform)bufferReader.ReadByte();
     UserId       = bufferReader.ReadString();
     UserName     = bufferReader.ReadString();
     SessionToken = bufferReader.ReadVarBytes().ToArray();
 }
 public void ReadFrom(ref SpanBufferReader bufferReader)
 {
     UserId        = bufferReader.ReadString();
     UserName      = bufferReader.ReadString();
     Random        = bufferReader.ReadBytes(32).ToArray();
     PublicKey     = bufferReader.ReadVarBytes().ToArray();
     Configuration = new GameplayServerConfiguration();
     Configuration.ReadFrom(ref bufferReader);
     Secret = bufferReader.ReadString();
 }
 public void ReadFrom(ref SpanBufferReader bufferReader)
 {
     UserId    = bufferReader.ReadString();
     UserName  = bufferReader.ReadString();
     Random    = bufferReader.ReadBytes(32).ToArray();
     PublicKey = bufferReader.ReadVarBytes().ToArray();
     Secret    = bufferReader.ReadString();
     Code      = bufferReader.ReadString();
     Password  = bufferReader.ReadString();
     UseRelay  = bufferReader.ReadBool();
 }
示例#5
0
        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;
        }
示例#6
0
 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();
 }
示例#7
0
        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)
        {
            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();
        }
示例#9
0
        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)
 {
     UserId   = bufferReader.ReadString();
     UserName = bufferReader.ReadString();
     Secret   = bufferReader.ReadString();
 }