diff --git a/common/src/main/kotlin/com/bluedragonmc/server/event/GameStateChangedEvent.kt b/common/src/main/kotlin/com/bluedragonmc/server/event/GameStateChangedEvent.kt index 5588a4d..77ab54d 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/event/GameStateChangedEvent.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/event/GameStateChangedEvent.kt @@ -1,6 +1,5 @@ package com.bluedragonmc.server.event -import com.bluedragonmc.api.grpc.CommonTypes import com.bluedragonmc.server.Game import com.bluedragonmc.server.utils.GameState @@ -9,13 +8,4 @@ import com.bluedragonmc.server.utils.GameState * Used to propagate state updates to external services, * such as with the MessagingModule. */ -class GameStateChangedEvent(game: Game, val oldState: GameState, val newState: GameState) : GameEvent(game) { - val rpcGameState: CommonTypes.GameState - get() { - return CommonTypes.GameState.newBuilder() - .setGameState(newState.mapToRpcState()) - .setJoinable(newState.canPlayersJoin) - .setOpenSlots(game.maxPlayers - game.players.size) - .build() - } -} \ No newline at end of file +class GameStateChangedEvent(game: Game, val oldState: GameState, val newState: GameState) : GameEvent(game) diff --git a/src/main/kotlin/com/bluedragonmc/server/impl/OutgoingRPCHandlerImpl.kt b/src/main/kotlin/com/bluedragonmc/server/impl/OutgoingRPCHandlerImpl.kt index e21adc4..0b9716e 100644 --- a/src/main/kotlin/com/bluedragonmc/server/impl/OutgoingRPCHandlerImpl.kt +++ b/src/main/kotlin/com/bluedragonmc/server/impl/OutgoingRPCHandlerImpl.kt @@ -56,7 +56,7 @@ class OutgoingRPCHandlerImpl(serverAddress: String, serverPort: Int) : OutgoingR Messaging.outgoing.initGame(parent.id, parent.gameType, parent.rpcGameState) eventNode.listenAsync { event -> - Messaging.outgoing.updateGameState(parent.id, event.rpcGameState) + Messaging.outgoing.updateGameState(parent.id, event.game.rpcGameState) } eventNode.listenAsync { event ->