|
@@ -33,12 +33,13 @@ public class GameOneClient {
|
|
|
public void onOpen(Session session) throws Exception{
|
|
|
System.out.println("game one 游戏已连接 server");
|
|
|
|
|
|
- session.getBasicRemote().sendText("{\"code\":\"" + Common.GAME_ONE_CODE + "\"}");
|
|
|
+ session.getBasicRemote().sendText("ping");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@OnClose
|
|
|
public void onClose(Session session) throws Exception{
|
|
|
- System.out.println("game on 游戏已断开 server:" + new Date());
|
|
|
+ System.out.println("game one 游戏已断开 server:" + new Date());
|
|
|
connect();
|
|
|
}
|
|
|
|
|
@@ -67,6 +68,12 @@ public class GameOneClient {
|
|
|
}
|
|
|
|
|
|
System.out.println("game one 接收数据" + message);
|
|
|
+
|
|
|
+ if(message.equals("pong")){
|
|
|
+ session.getBasicRemote().sendText("ping");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
appGameBettingTask.gameDataTask(message, Common.GAME_ONE_CODE);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|