refactor: move CommandHandler to libs

This commit is contained in:
2025-04-16 00:42:59 +02:00
parent 1f995b6ed9
commit f03265292a
7 changed files with 189 additions and 93 deletions

View File

@@ -69,10 +69,10 @@ class GameSimulationTest :
// In the normal process, these handlers is invoque players connect to the websocket
run {
GlobalScope.launch(Dispatchers.IO) {
commandHandler.handle(player1, gameId, channelCommand1, channelNotification1)
commandHandler.handleIncomingPlayerCommands(player1, gameId, channelCommand1, channelNotification1)
}
GlobalScope.launch(Dispatchers.IO) {
commandHandler.handle(player2, gameId, channelCommand2, channelNotification2)
commandHandler.handleIncomingPlayerCommands(player2, gameId, channelCommand2, channelNotification2)
}
}

View File

@@ -42,7 +42,7 @@ class GameCommandHandlerTest :
) { channelNotification.trySendBlocking(it) }
GlobalScope.launch {
commandHandler.handle(
commandHandler.handleIncomingPlayerCommands(
player,
gameId,
channelCommand,