package com.rosetta.messenger.network

/**
 * Result packet (ID: 0x02)
 * Server response for various operations
 * Desktop uses: readInt16() for resultCode only
 */
class PacketResult : Packet() {
    var resultCode: Int = 0

    override fun getPacketId(): Int = 0x02

    override fun receive(stream: Stream) {
        // Desktop: this.resultCode = stream.readInt16();
        resultCode = stream.readInt16()
    }

    override fun send(): Stream {
        val stream = Stream()
        stream.writeInt16(getPacketId())
        stream.writeInt16(resultCode)
        return stream
    }
}
