|
@@ -52,36 +52,27 @@ public class WebSocketConnent {
|
|
if(Common.GANME_ONE_NAME.equals(this.WS_URL_NAME)){
|
|
if(Common.GANME_ONE_NAME.equals(this.WS_URL_NAME)){
|
|
GameOneClient client = SpringContextSetting.getBean(GameOneClient.class);
|
|
GameOneClient client = SpringContextSetting.getBean(GameOneClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GANME_TWO_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GANME_TWO_NAME.equals(this.WS_URL_NAME)){
|
|
GameTwoClient client = SpringContextSetting.getBean(GameTwoClient.class);
|
|
GameTwoClient client = SpringContextSetting.getBean(GameTwoClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GAME_THREES_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GAME_THREES_NAME.equals(this.WS_URL_NAME)){
|
|
GameThreesClient client = SpringContextSetting.getBean(GameThreesClient.class);
|
|
GameThreesClient client = SpringContextSetting.getBean(GameThreesClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GAME_FOUR_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GAME_FOUR_NAME.equals(this.WS_URL_NAME)){
|
|
GameFourClient client = SpringContextSetting.getBean(GameFourClient.class);
|
|
GameFourClient client = SpringContextSetting.getBean(GameFourClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GAME_FIVE_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GAME_FIVE_NAME.equals(this.WS_URL_NAME)){
|
|
GameFiveClient client = SpringContextSetting.getBean(GameFiveClient.class);
|
|
GameFiveClient client = SpringContextSetting.getBean(GameFiveClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GAME_SIX_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GAME_SIX_NAME.equals(this.WS_URL_NAME)){
|
|
GameSixClient client = SpringContextSetting.getBean(GameSixClient.class);
|
|
GameSixClient client = SpringContextSetting.getBean(GameSixClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Common.GAME_SEVEN_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
|
|
+ }else if(Common.GAME_SEVEN_NAME.equals(this.WS_URL_NAME)){
|
|
GameSevenClient client = SpringContextSetting.getBean(GameSevenClient.class);
|
|
GameSevenClient client = SpringContextSetting.getBean(GameSevenClient.class);
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
|
|
+ }else if(Common.GAME_EIGHT_NAME.equals(this.WS_URL_NAME)){
|
|
|
|
+ GameEightClient client = SpringContextSetting.getBean(GameEightClient.class);
|
|
|
|
+ ContainerProvider.getWebSocketContainer().connectToServer(client, new URI(this.WS_NOW_URL));
|
|
}
|
|
}
|
|
|
|
|
|
System.out.println(this.WS_URL_NAME + " 已成功连接Websocket[" + this.WS_NOW_URL + "]");
|
|
System.out.println(this.WS_URL_NAME + " 已成功连接Websocket[" + this.WS_NOW_URL + "]");
|