File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
plugin/src/client/sc/plugin2021
sdk/src/server-api/sc/networking/clients Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package sc.plugin2021
22
33import org.slf4j.LoggerFactory
44import sc.api.plugins.IGameState
5- import sc.framework.plugins.Player
65import sc.framework.plugins.protocol.MoveRequest
6+ import sc.networking.clients.AbstractLobbyClientListener
77import sc.networking.clients.IControllableGame
88import sc.networking.clients.ILobbyClientListener
99import sc.networking.clients.LobbyClient
@@ -22,7 +22,7 @@ import kotlin.system.exitProcess
2222abstract class AbstractClient (
2323 host : String ,
2424 port : Int
25- ): ILobbyClientListener {
25+ ): AbstractLobbyClientListener() {
2626 companion object {
2727 private val logger = LoggerFactory .getLogger(AbstractClient ::class .java)
2828 }
@@ -105,11 +105,6 @@ abstract class AbstractClient(
105105 client.joinRoomRequest(GamePlugin .PLUGIN_UUID )
106106 }
107107
108- override fun onGameJoined (roomId : String ) {}
109- override fun onGamePrepared (response : GamePreparedResponse ) {}
110- override fun onGamePaused (roomId : String , nextPlayer : Player ) {}
111- override fun onGameObserved (roomId : String ) {}
112-
113108 override fun onGameLeft (roomId : String ) {
114109 logger.info(" $this : Got game left in room $roomId " )
115110 client.stop()
Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ import sc.shared.GameResult
99
1010abstract class AbstractLobbyClientListener : ILobbyClientListener {
1111 override fun onNewState (roomId : String , state : IGameState ) {}
12+ override fun onGameOver (roomId : String , data : GameResult ) {}
13+ override fun onGamePaused (roomId : String , nextPlayer : Player ) {}
1214 override fun onRoomMessage (roomId : String , data : ProtocolMessage ) {}
1315 override fun onError (roomId : String? , error : ProtocolErrorMessage ) {}
16+
1417 override fun onGamePrepared (response : GamePreparedResponse ) {}
1518 override fun onGameLeft (roomId : String ) {}
1619 override fun onGameJoined (roomId : String ) {}
17- override fun onGameOver (roomId : String , data : GameResult ) {}
18- override fun onGamePaused (roomId : String , nextPlayer : Player ) {}
1920 override fun onGameObserved (roomId : String ) {}
2021}
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import sc.shared.GameResult
1111/* * Receives updates within a GameRoom on the client-side. */
1212interface ILobbyClientListener {
1313 fun onNewState (roomId : String , state : IGameState )
14+ fun onGameOver (roomId : String , data : GameResult )
15+ fun onGamePaused (roomId : String , nextPlayer : Player )
1416 fun onRoomMessage (roomId : String , data : ProtocolMessage )
1517 fun onError (roomId : String? , error : ProtocolErrorMessage )
18+
1619 fun onGamePrepared (response : GamePreparedResponse )
1720 fun onGameLeft (roomId : String )
1821 fun onGameJoined (roomId : String )
19- fun onGameOver (roomId : String , data : GameResult )
20- fun onGamePaused (roomId : String , nextPlayer : Player )
2122 fun onGameObserved (roomId : String )
2223}
You can’t perform that action at this time.
0 commit comments