diff --git a/client/src/commonMain/kotlin/ui/waitingRoom.kt b/client/src/commonMain/kotlin/ui/waitingRoom.kt index 1fd33e7..0e81048 100644 --- a/client/src/commonMain/kotlin/ui/waitingRoom.kt +++ b/client/src/commonMain/kotlin/ui/waitingRoom.kt @@ -71,7 +71,6 @@ suspend fun waitingRoom(room: UUID) { scroll.horizontal.view.visible = false scroll.scrollTopRatio = 1f onEvent(PacketEvent) { event -> - println("chat") val packet = event.packet if (packet !is ChatPacket) return@onEvent val (username, message) = packet diff --git a/client/src/commonMain/kotlin/websocket/websocket.kt b/client/src/commonMain/kotlin/websocket/websocket.kt index b274a79..60c6d39 100644 --- a/client/src/commonMain/kotlin/websocket/websocket.kt +++ b/client/src/commonMain/kotlin/websocket/websocket.kt @@ -50,4 +50,4 @@ fun serverPacket(serverPacket: ServerPacket): PacketController = when(serve PLAYER_LEAVE -> packet() } as PacketController -private inline fun packet() = packet { { sceneContainer.dispatch(PacketEvent(it)) } } +private inline fun packet() = packet { sceneContainer.dispatch(PacketEvent(it)) } diff --git a/server/src/main/kotlin/application/websocket.kt b/server/src/main/kotlin/application/websocket.kt index 9676402..8800781 100644 --- a/server/src/main/kotlin/application/websocket.kt +++ b/server/src/main/kotlin/application/websocket.kt @@ -21,7 +21,7 @@ import java.util.* import kotlin.collections.LinkedHashSet val serverUUID = UUID.generateUUID() -val connections: MutableSet = Collections.synchronizedSet(LinkedHashSet()) +val connections: MutableSet = Collections.synchronizedSet(LinkedHashSet()) fun getPlayersByRoom(room: UUID) = connections.filter { runCatching { getPlayerBySession(it.session).room?.equals(room) }.getOrNull()?: false } @@ -60,9 +60,6 @@ fun Application.configureWebsocket() { suspend fun serverPacket(websocket: DefaultWebSocketSession, session: UUID, clientPacket: ClientPacket): PacketController = when(clientPacket) { ClientPacket.GET_ROOM_NUMBER -> packet { transaction { Room.find(Rooms.id eq it).first().name } - } - ClientPacket.LEAVE_ROOM -> packet { - } ClientPacket.CHAT -> packet { received -> val player = getPlayerBySession(session) diff --git a/shared/src/commonMain/kotlin/network/Packets.kt b/shared/src/commonMain/kotlin/network/Packets.kt index dc443c4..9606dc6 100644 --- a/shared/src/commonMain/kotlin/network/Packets.kt +++ b/shared/src/commonMain/kotlin/network/Packets.kt @@ -4,7 +4,6 @@ import kotlinx.serialization.Serializable enum class ClientPacket { GET_ROOM_NUMBER, - LEAVE_ROOM, CHAT }