Skip to content

Commit 3fbb27d

Browse files
committed
fix(client): make roomId nullable in onError
1 parent 492301c commit 3fbb27d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

plugin/src/client/sc/plugin2021/AbstractClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ abstract class AbstractClient(
6969
client.sendMessageToRoom(roomId, move)
7070

7171
/** Called when an erroneous message is sent to the room. */
72-
override fun onError(roomId: String, error: ProtocolErrorMessage) {
73-
logger.debug("onError: Client $this received error ${error.message}")
72+
override fun onError(roomId: String?, error: ProtocolErrorMessage) {
73+
logger.debug("onError: Client $this received error ${error.message} in $roomId")
7474
this.error = error.message
7575
}
7676

sdk/src/server-api/sc/networking/clients/AbstractLobbyClientListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import sc.shared.GameResult
1010
abstract class AbstractLobbyClientListener: ILobbyClientListener {
1111
override fun onNewState(roomId: String, state: IGameState) {}
1212
override fun onRoomMessage(roomId: String, data: ProtocolMessage) {}
13-
override fun onError(roomId: String, error: ProtocolErrorMessage) {}
13+
override fun onError(roomId: String?, error: ProtocolErrorMessage) {}
1414
override fun onGamePrepared(response: GamePreparedResponse) {}
1515
override fun onGameLeft(roomId: String) {}
1616
override fun onGameJoined(roomId: String) {}

sdk/src/server-api/sc/networking/clients/ILobbyClientListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import sc.shared.GameResult
1212
interface ILobbyClientListener {
1313
fun onNewState(roomId: String, state: IGameState)
1414
fun onRoomMessage(roomId: String, data: ProtocolMessage)
15-
fun onError(roomId: String, error: ProtocolErrorMessage)
15+
fun onError(roomId: String?, error: ProtocolErrorMessage)
1616
fun onGamePrepared(response: GamePreparedResponse)
1717
fun onGameLeft(roomId: String)
1818
fun onGameJoined(roomId: String)

0 commit comments

Comments
 (0)