mirror of
https://github.com/tiennm99/try-solver.git
synced 2026-06-09 20:14:33 +00:00
Add netty websocket game server with web client
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.gameserver;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class GameMessage {
|
||||
private final String type;
|
||||
private final String payload;
|
||||
|
||||
@JsonCreator
|
||||
public GameMessage(
|
||||
@JsonProperty("type") String type,
|
||||
@JsonProperty("payload") String payload) {
|
||||
this.type = type;
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GameMessage{" +
|
||||
"type='" + type + '\'' +
|
||||
", payload='" + payload + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user