package com.rosetta.messenger.network

/**
 * User Info packet (ID: 0x01)
 * Get/Set user information
 * Protocol order: username, title, privateKey (matching TypeScript version)
 */
class PacketUserInfo : Packet() {
    var privateKey: String = ""
    var username: String = ""
    var title: String = ""

    override fun getPacketId(): Int = 0x01

    override fun receive(stream: Stream) {
        username = stream.readString()
        title = stream.readString()
        privateKey = stream.readString()
    }

    override fun send(): Stream {
        val stream = Stream()
        stream.writeInt16(getPacketId())
        stream.writeString(username)
        stream.writeString(title)
        stream.writeString(privateKey)
        return stream
    }
}
