Last active
November 23, 2021 07:28
-
-
Save vaibhavgoyal09/ddb1d34ae4a1f8b19b42b1ca5a33db58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Route.gameSocketRoute() { | |
route("/v1/game") { | |
standardWebSocket { socket, clientId, _, payload -> | |
when (payload) { | |
is GameMove -> { | |
socket.send(Frame.Text("Game move received ${payload.position}")) | |
} | |
is DisconnectRequest -> { | |
// Do something here | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment