summaryrefslogtreecommitdiff
path: root/sw-client
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-05-21 13:46:30 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-05-21 13:58:28 +0200
commit4f3eec40a87c5e4f52fc89238642dd7a17650540 (patch)
treec910270b5477975100bfd82852d784409346f334 /sw-client
parentPrevent bots with already used names (diff)
downloadseven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.tar.gz
seven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.tar.bz2
seven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.zip
Allow custom player icons
Diffstat (limited to 'sw-client')
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt12
1 files changed, 3 insertions, 9 deletions
diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
index 3dca33c1..ce0ef1fd 100644
--- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
+++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
@@ -22,13 +22,7 @@ import org.luxons.sevenwonders.model.PlayerTurnInfo
import org.luxons.sevenwonders.model.api.ConnectedPlayer
import org.luxons.sevenwonders.model.api.LobbyDTO
import org.luxons.sevenwonders.model.api.SEVEN_WONDERS_WS_ENDPOINT
-import org.luxons.sevenwonders.model.api.actions.AddBotAction
-import org.luxons.sevenwonders.model.api.actions.ChooseNameAction
-import org.luxons.sevenwonders.model.api.actions.CreateGameAction
-import org.luxons.sevenwonders.model.api.actions.JoinGameAction
-import org.luxons.sevenwonders.model.api.actions.PrepareMoveAction
-import org.luxons.sevenwonders.model.api.actions.ReorderPlayersAction
-import org.luxons.sevenwonders.model.api.actions.UpdateSettingsAction
+import org.luxons.sevenwonders.model.api.actions.*
import org.luxons.sevenwonders.model.api.errors.ErrorDTO
import org.luxons.sevenwonders.model.cards.PreparedCard
@@ -63,10 +57,10 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat
fun watchErrors(): Flow<ErrorDTO> = stompSession.subscribe("/user/queue/errors", ErrorDTO.serializer())
- suspend fun chooseName(displayName: String): ConnectedPlayer = stompSession.request(
+ suspend fun chooseName(displayName: String, icon: Icon? = null): ConnectedPlayer = stompSession.request(
sendDestination = "/app/chooseName",
receiveDestination = "/user/queue/nameChoice",
- payload = ChooseNameAction(displayName),
+ payload = ChooseNameAction(displayName, icon),
serializer = ChooseNameAction.serializer(),
deserializer = ConnectedPlayer.serializer()
)
bgstack15