Exemple #1
0
    // 바이너리 데이터를 패킷 데이터로 디시리얼라이즈하는 생성자.
    public ConnectPacket(byte[] data)
    {
        ConnectSerializer serializer = new ConnectSerializer();

        serializer.SetDeserializedData(data);
        serializer.Deserialize(ref m_packet);
    }
Exemple #2
0
    public byte[] GetData()
    {
        ConnectSerializer serializer = new ConnectSerializer();

        serializer.Serialize(m_packet);
        return(serializer.GetSerializedData());
    }
Exemple #3
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);
        }