示例#1
0
        public static void Serialize(IOutOctetStream stream, IncomingLogic tendIn, OutgoingLogic tendOut)
        {
            stream.WriteUint8(tendOut.OutgoingSequenceId.Value);
            var header = tendIn.ReceivedHeader;

            stream.WriteUint8(header.SequenceId.Value);
            stream.WriteUint32(header.ReceivedBits.Bits);
        }
示例#2
0
        public static void Serialize(IOutOctetStream stream, string value)
        {
            var octets = Encoding.UTF8.GetBytes(value);

            stream.WriteUint8((byte)octets.Length);
            stream.WriteOctets(octets);
        }
 public static void Serialize(IOutOctetStream stream, ConnectRequest cmd)
 {
     stream.WriteUint8(CommandValues.ConnectRequest);
     stream.WriteUint32(cmd.MyNonce);
     stream.WriteUint32(cmd.RemoteNonce);
     UniqueSessionIdSerializer.Serialize(stream, cmd.SessionId);
     ConnectInfoSerializer.Serialize(stream, cmd.Info);
 }
 public static void Serialize(IOutOctetStream stream, PingRequestHeader cmd)
 {
     stream.WriteUint8(CommandValues.PingRequest);
     stream.WriteUint64((ushort)cmd.LocalElapsedMilliseconds);
 }
 public static void Serialize(IOutOctetStream stream, UniqueSessionID sessionId)
 {
     stream.WriteUint8((byte)sessionId.Value.Length);
     stream.WriteOctets(sessionId.Value);
 }
示例#6
0
 static void WriteHeader(IOutOctetStream outStream, byte mode, byte sequence, ushort connectionIdToSend)
 {
     outStream.WriteUint8(mode);
     outStream.WriteUint8(sequence);
     outStream.WriteUint16(connectionIdToSend);
 }
 public static void Serialize(IOutOctetStream stream, CustomConnectPayload payload)
 {
     stream.WriteUint8((byte)payload.Payload.Length);
     stream.WriteOctets(payload.Payload);
 }
示例#8
0
 public static void Serialize(IOutOctetStream stream, ChallengeRequest cmd)
 {
     stream.WriteUint8(CommandValues.ChallengeRequest);
     stream.WriteUint32(cmd.Nonce);
 }