@@ -30,9 +30,7 @@ abstract class AbstractClient @Throws(IOException::class) constructor(
3030 private val gameType = GamePlugin .PLUGIN_UUID
3131 }
3232
33- /* * The handler reacts to messages from the server received by the lobby client.
34- * It *must* be initialised before start.
35- */
33+ /* * The handler reacts to messages from the server received by the lobby client. */
3634 protected lateinit var handler: IGameHandler
3735
3836 /* * Initialise game handler. */
@@ -44,7 +42,7 @@ abstract class AbstractClient @Throws(IOException::class) constructor(
4442 private val client = try {
4543 LobbyClient (Configuration .xStream, Configuration .classesToRegister, host, port)
4644 } catch (e: ConnectException ) {
47- logger.error(" Could not connect to Server: " + e.message)
45+ logger.error(" Could not connect to Server: ${ e.message} " )
4846 exitProcess(1 )
4947 }
5048
@@ -85,13 +83,13 @@ abstract class AbstractClient @Throws(IOException::class) constructor(
8583
8684 /* * Called when an erroneous message is sent to the room. */
8785 override fun onError (roomId : String , error : ProtocolErrorMessage ) {
88- logger.debug(" onError: Client {} received error {} " , this , error.message)
86+ logger.debug(" onError: Client $this received error ${ error.message} " )
8987 this .error = error.message
9088 }
9189
9290 override fun onNewState (roomId : String , state : Any ) {
9391 val gameState = state as GameState
94- logger.debug(" {} got a new state {} " , this , gameState)
92+ logger.debug(" $this got a new state $ gameState" )
9593
9694 if (id == PlayerType .OBSERVER ) return
9795
@@ -119,14 +117,14 @@ abstract class AbstractClient @Throws(IOException::class) constructor(
119117 override fun onGameObserved (roomId : String ) {}
120118
121119 override fun onGameLeft (roomId : String ) {
122- logger.info(" {} got game left {} " , this , roomId )
120+ logger.info(" $this got game left $roomID " )
123121 client.stop()
124122 }
125123
126124 override fun onGameOver (roomId : String , data : GameResult ) {
127- logger.info(" {} on Game Over with game result {} " , this , data)
125+ logger.info(" $this on Game Over with game result $ data" )
128126 if (this ::handler.isInitialized) {
129- handler.gameEnded(data, team, error.orEmpty() )
127+ handler.gameEnded(data, team, error)
130128 }
131129 }
132130
0 commit comments