Ejemplo n.º 1
0
        private HastyPacket PingPacket(Timestamp ms)
        {
            var writer    = new OctetWriter();
            var outStream = new StreamWriter(writer);
            var cmd       = new PingCommand(ms);

            PingSerializer.SerializePing(outStream, cmd);
            var payload = writer.Close();
            var packet  = PacketCreator.Create(Commands.Ping, payload);

            return(packet);
        }
Ejemplo n.º 2
0
        private HastyPacket ConnectPacket()
        {
            var writer    = new OctetWriter();
            var outStream = new StreamWriter(writer);

            var protocolVersion = new Model.Version(0, 0, 1);
            var cmd             = new ConnectCommand(protocolVersion, realm);

            ConnectSerializer.SerializeConnect(outStream, cmd);
            var payload = writer.Close();

            var packet = PacketCreator.Create(Commands.Connect, payload);

            return(packet);
        }