package ru.dbotthepony.kstarbound.network.packets.serverbound

import ru.dbotthepony.kstarbound.network.IServerPacket
import ru.dbotthepony.kstarbound.server.ServerConnection
import java.io.DataInputStream
import java.io.DataOutputStream

object WorldStartAcknowledgePacket : IServerPacket {
	override fun write(stream: DataOutputStream, isLegacy: Boolean) {
		if (isLegacy) stream.writeBoolean(false)
	}

	override fun play(connection: ServerConnection) {
		connection.worldStartAcknowledged = true
	}

	fun read(stream: DataInputStream, isLegacy: Boolean): WorldStartAcknowledgePacket {
		if (isLegacy) stream.readBoolean()
		return WorldStartAcknowledgePacket
	}
}
