summaryrefslogtreecommitdiff
path: root/sw-server/src/main
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-31 20:19:34 +0200
committerjbion <joffrey.bion@amadeus.com>2019-07-08 19:21:15 +0200
commitc3fc62e7117b2e970eea4eb84137b6624063fb6d (patch)
treebd9a29c611f78227519729e54ec18b7ac530740e /sw-server/src/main
parentRemove useless Travis CI config (diff)
downloadseven-wonders-c3fc62e7117b2e970eea4eb84137b6624063fb6d.tar.gz
seven-wonders-c3fc62e7117b2e970eea4eb84137b6624063fb6d.tar.bz2
seven-wonders-c3fc62e7117b2e970eea4eb84137b6624063fb6d.zip
Create multiplatform SevenWondersClient based on Krossbow
Diffstat (limited to 'sw-server/src/main')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ChooseNameAction.kt19
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/CreateGameAction.kt19
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/JoinGameAction.kt17
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/PrepareMoveAction.kt18
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ReorderPlayersAction.kt18
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/UpdateSettingsAction.kt18
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/api/LobbyDTO.kt17
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/api/PlayerDTO.kt14
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/Converters.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ErrorDTO.kt)20
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/ExceptionHandler.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ExceptionHandler.kt)4
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/SevenWonders.kt)2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/api/Converters.kt14
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/AnonymousUsersHandshakeHandler.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/config/AnonymousUsersHandshakeHandler.kt)2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/config/TopicSubscriptionInterceptor.kt)4
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSecurityConfig.kt)2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSocketConfig.kt)2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameBrowserController.kt)18
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameController.kt)15
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/HomeController.kt)10
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/LobbyController.kt)18
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/doc/Documentation.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/doc/Documentation.kt)2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt)9
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Player.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt)4
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt)6
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepository.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/PlayerRepository.kt)6
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt (renamed from sw-server/src/main/kotlin/org/luxons/sevenwonders/validation/DestinationAccessValidator.kt)4
26 files changed, 68 insertions, 214 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ChooseNameAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ChooseNameAction.kt
deleted file mode 100644
index ab444780..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ChooseNameAction.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-import javax.validation.constraints.Size
-
-/**
- * The action to choose the player's name. This is the first action that should be called.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class ChooseNameAction(
- /**
- * The display name of the player. May contain spaces and special characters.
- */
- @Size(min = 2, max = 20)
- @ApiTypeProperty(required = true)
- val playerName: String
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/CreateGameAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/CreateGameAction.kt
deleted file mode 100644
index c10f9c34..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/CreateGameAction.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-import javax.validation.constraints.Size
-
-/**
- * The action to create a game.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class CreateGameAction(
- /**
- * The name of the game to create.
- */
- @Size(min = 2, max = 30)
- @ApiTypeProperty(required = true)
- val gameName: String
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/JoinGameAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/JoinGameAction.kt
deleted file mode 100644
index 002309b3..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/JoinGameAction.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-
-/**
- * The action to join a game.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class JoinGameAction(
- /**
- * The ID of the game to join.
- */
- @ApiTypeProperty(required = true)
- val gameId: Long
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/PrepareMoveAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/PrepareMoveAction.kt
deleted file mode 100644
index ed420cfc..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/PrepareMoveAction.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-import org.luxons.sevenwonders.model.PlayerMove
-
-/**
- * The action to prepare the next move during a game.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class PrepareMoveAction(
- /**
- * The move to prepare.
- */
- @ApiTypeProperty(required = true)
- val move: PlayerMove
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ReorderPlayersAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ReorderPlayersAction.kt
deleted file mode 100644
index 79a32137..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/ReorderPlayersAction.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-
-/**
- * The action to update the order of the players around the table. Can only be called in the lobby by the owner of the
- * game.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class ReorderPlayersAction(
- /**
- * The list of usernames of the players, in the new order.
- */
- @ApiTypeProperty(required = true)
- val orderedPlayers: List<String>
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/UpdateSettingsAction.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/UpdateSettingsAction.kt
deleted file mode 100644
index 33303044..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/actions/UpdateSettingsAction.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.luxons.sevenwonders.actions
-
-import org.hildan.livedoc.core.annotations.types.ApiType
-import org.hildan.livedoc.core.annotations.types.ApiTypeProperty
-import org.luxons.sevenwonders.doc.Documentation
-import org.luxons.sevenwonders.model.CustomizableSettings
-
-/**
- * The action to update the settings of the game. Can only be called in the lobby by the owner of the game.
- */
-@ApiType(group = Documentation.GROUP_ACTIONS)
-class UpdateSettingsAction(
- /**
- * The new values for the settings.
- */
- @ApiTypeProperty(required = true)
- val settings: CustomizableSettings
-)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/LobbyDTO.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/LobbyDTO.kt
deleted file mode 100644
index b4445f32..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/LobbyDTO.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.luxons.sevenwonders.api
-
-import org.luxons.sevenwonders.lobby.Lobby
-import org.luxons.sevenwonders.lobby.State
-
-data class LobbyDTO(
- val id: Long,
- val name: String,
- val owner: String,
- val players: List<PlayerDTO>,
- val state: State
-)
-
-fun Lobby.toDTO(currentUser: String): LobbyDTO {
- val players = getPlayers().map { it.toDTO(currentUser) }
- return LobbyDTO(id, name, owner.username, players, state)
-}
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/PlayerDTO.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/PlayerDTO.kt
deleted file mode 100644
index 54c69122..00000000
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/api/PlayerDTO.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.luxons.sevenwonders.api
-
-import org.luxons.sevenwonders.lobby.Player
-
-data class PlayerDTO(
- val username: String,
- val displayName: String,
- val index: Int,
- val isGameOwner: Boolean,
- val isUser: Boolean
-)
-
-fun Player.toDTO(currentUser: String) =
- PlayerDTO(username, displayName, index, isGameOwner, username === currentUser)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ErrorDTO.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/Converters.kt
index c3eae0b5..7e1a6fdf 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ErrorDTO.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/Converters.kt
@@ -1,25 +1,9 @@
-package org.luxons.sevenwonders.errors
+package org.luxons.sevenwonders.server
+import org.luxons.sevenwonders.model.api.errors.ValidationErrorDTO
import org.springframework.validation.FieldError
import org.springframework.validation.ObjectError
-enum class ErrorType {
- VALIDATION, CLIENT, SERVER
-}
-
-data class ErrorDTO(
- val code: String,
- val message: String,
- val type: ErrorType,
- val details: List<ValidationErrorDTO> = emptyList()
-)
-
-data class ValidationErrorDTO(
- val path: String,
- val message: String,
- val rejectedValue: Any? = null
-)
-
fun ObjectError.toDTO() = (this as? FieldError)?.fieldError() ?: objectError()
fun FieldError.fieldError(): ValidationErrorDTO =
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ExceptionHandler.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/ExceptionHandler.kt
index 76d01f5f..f006505b 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/errors/ExceptionHandler.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/ExceptionHandler.kt
@@ -1,5 +1,7 @@
-package org.luxons.sevenwonders.errors
+package org.luxons.sevenwonders.server
+import org.luxons.sevenwonders.model.api.errors.ErrorDTO
+import org.luxons.sevenwonders.model.api.errors.ErrorType
import org.slf4j.LoggerFactory
import org.springframework.messaging.converter.MessageConversionException
import org.springframework.messaging.handler.annotation.MessageExceptionHandler
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/SevenWonders.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt
index 04f03956..51710115 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/SevenWonders.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders
+package org.luxons.sevenwonders.server
import org.hildan.livedoc.spring.boot.starter.EnableJSONDoc
import org.springframework.boot.autoconfigure.SpringBootApplication
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/api/Converters.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/api/Converters.kt
new file mode 100644
index 00000000..6f0fc180
--- /dev/null
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/api/Converters.kt
@@ -0,0 +1,14 @@
+package org.luxons.sevenwonders.server.api
+
+import org.luxons.sevenwonders.model.api.LobbyDTO
+import org.luxons.sevenwonders.model.api.PlayerDTO
+import org.luxons.sevenwonders.server.lobby.Lobby
+import org.luxons.sevenwonders.server.lobby.Player
+
+fun Lobby.toDTO(currentUser: String): LobbyDTO {
+ val players = getPlayers().map { it.toDTO(currentUser) }
+ return LobbyDTO(id, name, owner.username, players, state)
+}
+
+fun Player.toDTO(currentUser: String) =
+ PlayerDTO(username, displayName, index, isGameOwner, username === currentUser)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/AnonymousUsersHandshakeHandler.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/AnonymousUsersHandshakeHandler.kt
index db707d1b..56b3400f 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/AnonymousUsersHandshakeHandler.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/AnonymousUsersHandshakeHandler.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.config
+package org.luxons.sevenwonders.server.config
import org.springframework.http.server.ServerHttpRequest
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/TopicSubscriptionInterceptor.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt
index f4c55c2c..5342503b 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/TopicSubscriptionInterceptor.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt
@@ -1,6 +1,6 @@
-package org.luxons.sevenwonders.config
+package org.luxons.sevenwonders.server.config
-import org.luxons.sevenwonders.validation.DestinationAccessValidator
+import org.luxons.sevenwonders.server.validation.DestinationAccessValidator
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.messaging.Message
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSecurityConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt
index 06b2bc90..9557ba1a 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSecurityConfig.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.config
+package org.luxons.sevenwonders.server.config
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.annotation.web.builders.HttpSecurity
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSocketConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
index b49d39cc..72312b70 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/config/WebSocketConfig.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.config
+package org.luxons.sevenwonders.server.config
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameBrowserController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt
index f856365f..e2f0458e 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameBrowserController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt
@@ -1,14 +1,14 @@
-package org.luxons.sevenwonders.controllers
+package org.luxons.sevenwonders.server.controllers
import org.hildan.livedoc.core.annotations.Api
-import org.luxons.sevenwonders.actions.CreateGameAction
-import org.luxons.sevenwonders.actions.JoinGameAction
-import org.luxons.sevenwonders.api.LobbyDTO
-import org.luxons.sevenwonders.api.toDTO
-import org.luxons.sevenwonders.errors.ApiMisuseException
-import org.luxons.sevenwonders.lobby.Lobby
-import org.luxons.sevenwonders.repositories.LobbyRepository
-import org.luxons.sevenwonders.repositories.PlayerRepository
+import org.luxons.sevenwonders.model.api.LobbyDTO
+import org.luxons.sevenwonders.model.api.actions.CreateGameAction
+import org.luxons.sevenwonders.model.api.actions.JoinGameAction
+import org.luxons.sevenwonders.server.ApiMisuseException
+import org.luxons.sevenwonders.server.api.toDTO
+import org.luxons.sevenwonders.server.lobby.Lobby
+import org.luxons.sevenwonders.server.repositories.LobbyRepository
+import org.luxons.sevenwonders.server.repositories.PlayerRepository
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.messaging.handler.annotation.MessageMapping
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt
index a923f845..e1fae39b 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/GameController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt
@@ -1,14 +1,13 @@
-package org.luxons.sevenwonders.controllers
+package org.luxons.sevenwonders.server.controllers
import org.hildan.livedoc.core.annotations.Api
-import org.luxons.sevenwonders.actions.PrepareMoveAction
-import org.luxons.sevenwonders.api.PlayerDTO
-import org.luxons.sevenwonders.api.toDTO
import org.luxons.sevenwonders.engine.Game
import org.luxons.sevenwonders.model.GameState
-import org.luxons.sevenwonders.model.cards.CardBack
-import org.luxons.sevenwonders.lobby.Player
-import org.luxons.sevenwonders.repositories.PlayerRepository
+import org.luxons.sevenwonders.model.api.actions.PrepareMoveAction
+import org.luxons.sevenwonders.model.cards.PreparedCard
+import org.luxons.sevenwonders.server.api.toDTO
+import org.luxons.sevenwonders.server.lobby.Player
+import org.luxons.sevenwonders.server.repositories.PlayerRepository
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.messaging.handler.annotation.MessageMapping
@@ -98,5 +97,3 @@ class GameController @Autowired constructor(
private val logger = LoggerFactory.getLogger(GameController::class.java)
}
}
-
-class PreparedCard(val player: PlayerDTO, val cardBack: CardBack)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/HomeController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt
index bd672000..a0d53f8b 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/HomeController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt
@@ -1,10 +1,10 @@
-package org.luxons.sevenwonders.controllers
+package org.luxons.sevenwonders.server.controllers
import org.hildan.livedoc.core.annotations.Api
-import org.luxons.sevenwonders.actions.ChooseNameAction
-import org.luxons.sevenwonders.api.PlayerDTO
-import org.luxons.sevenwonders.api.toDTO
-import org.luxons.sevenwonders.repositories.PlayerRepository
+import org.luxons.sevenwonders.model.api.PlayerDTO
+import org.luxons.sevenwonders.model.api.actions.ChooseNameAction
+import org.luxons.sevenwonders.server.api.toDTO
+import org.luxons.sevenwonders.server.repositories.PlayerRepository
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.messaging.handler.annotation.MessageMapping
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/LobbyController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt
index 4e4120a9..19834ef1 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/controllers/LobbyController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt
@@ -1,13 +1,13 @@
-package org.luxons.sevenwonders.controllers
+package org.luxons.sevenwonders.server.controllers
import org.hildan.livedoc.core.annotations.Api
-import org.luxons.sevenwonders.actions.ReorderPlayersAction
-import org.luxons.sevenwonders.actions.UpdateSettingsAction
-import org.luxons.sevenwonders.api.LobbyDTO
-import org.luxons.sevenwonders.api.toDTO
-import org.luxons.sevenwonders.lobby.Player
-import org.luxons.sevenwonders.repositories.LobbyRepository
-import org.luxons.sevenwonders.repositories.PlayerRepository
+import org.luxons.sevenwonders.model.api.LobbyDTO
+import org.luxons.sevenwonders.model.api.actions.ReorderPlayersAction
+import org.luxons.sevenwonders.model.api.actions.UpdateSettingsAction
+import org.luxons.sevenwonders.server.api.toDTO
+import org.luxons.sevenwonders.server.lobby.Player
+import org.luxons.sevenwonders.server.repositories.LobbyRepository
+import org.luxons.sevenwonders.server.repositories.PlayerRepository
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.messaging.handler.annotation.MessageMapping
@@ -98,7 +98,7 @@ class LobbyController @Autowired constructor(
val game = lobby.startGame()
logger.info("Game {} successfully started", game.id)
- template.convertAndSend("/topic/lobby/" + lobby.id + "/started", "")
+ template.convertAndSend("/topic/lobby/" + lobby.id + "/started", Unit)
}
companion object {
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/doc/Documentation.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/doc/Documentation.kt
index 3b04356a..f033ddd0 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/doc/Documentation.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/doc/Documentation.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.doc
+package org.luxons.sevenwonders.server.doc
object Documentation {
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt
index 4b9f5bc3..7158a417 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt
@@ -1,12 +1,9 @@
-package org.luxons.sevenwonders.lobby
+package org.luxons.sevenwonders.server.lobby
import org.luxons.sevenwonders.engine.Game
-import org.luxons.sevenwonders.model.CustomizableSettings
import org.luxons.sevenwonders.engine.data.GameDefinition
-
-enum class State {
- LOBBY, PLAYING
-}
+import org.luxons.sevenwonders.model.CustomizableSettings
+import org.luxons.sevenwonders.model.api.State
class Lobby(
val id: Long,
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Player.kt
index d057fcb2..8ed7d048 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Player.kt
@@ -1,7 +1,7 @@
-package org.luxons.sevenwonders.lobby
+package org.luxons.sevenwonders.server.lobby
-import org.luxons.sevenwonders.errors.ApiMisuseException
import org.luxons.sevenwonders.engine.Game
+import org.luxons.sevenwonders.server.ApiMisuseException
class Player(
val username: String,
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt
index 02866ffc..ff06f549 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt
@@ -1,8 +1,8 @@
-package org.luxons.sevenwonders.repositories
+package org.luxons.sevenwonders.server.repositories
import org.luxons.sevenwonders.engine.data.GameDefinition
-import org.luxons.sevenwonders.lobby.Lobby
-import org.luxons.sevenwonders.lobby.Player
+import org.luxons.sevenwonders.server.lobby.Lobby
+import org.luxons.sevenwonders.server.lobby.Player
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Repository
import java.util.HashMap
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/PlayerRepository.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepository.kt
index 4d552eaa..00badf75 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/repositories/PlayerRepository.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepository.kt
@@ -1,7 +1,7 @@
-package org.luxons.sevenwonders.repositories
+package org.luxons.sevenwonders.server.repositories
-import org.luxons.sevenwonders.errors.ApiMisuseException
-import org.luxons.sevenwonders.lobby.Player
+import org.luxons.sevenwonders.server.ApiMisuseException
+import org.luxons.sevenwonders.server.lobby.Player
import org.springframework.stereotype.Repository
import java.util.HashMap
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/validation/DestinationAccessValidator.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt
index 5f704357..04daf311 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/validation/DestinationAccessValidator.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt
@@ -1,6 +1,6 @@
-package org.luxons.sevenwonders.validation
+package org.luxons.sevenwonders.server.validation
-import org.luxons.sevenwonders.repositories.LobbyRepository
+import org.luxons.sevenwonders.server.repositories.LobbyRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import java.util.regex.Pattern
bgstack15