Compare commits

...

5 Commits

Author SHA1 Message Date
educoder b5807406b1 update 2021-04-09 09:51:25 +08:00
educoder ac1f48898e update 2021-04-08 15:50:33 +08:00
educoder 3a326d1286 update 2021-04-08 14:02:35 +08:00
educoder fb38b1163d 调式 2021-04-08 14:00:31 +08:00
educoder b4952cba7d updat 2021-04-08 13:43:47 +08:00
1 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -74,7 +75,7 @@ public class JchService {
* @param buffer
*/
public void recv(String buffer, WebSocketSession session) {
logger.debug("webssh收到数据{}", buffer);
logger.info("webssh收到数据{}", buffer);
WebscoketObj webscoketObj = findBySession(session);
boolean overtime = Boolean.FALSE;
@ -131,7 +132,9 @@ public class JchService {
try {
if (webscoketObj.getConnectInfo() != null && overtime) {
String gameId = webscoketObj.getConnectInfo().getGameid();
overTimeService.websshOverTime(gameId);
if (StringUtils.isNotEmpty(gameId)) {
overTimeService.websshOverTime(gameId);
}
}
} catch (Exception e) {
logger.error("pod 接收消息出错", e);
@ -208,7 +211,9 @@ public class JchService {
webscoketObj.setConnectInfo(connectInfo);
websshService.active("" + connectInfo.getGameid());
if (StringUtils.isNotEmpty(connectInfo.getGameid())) {
websshService.active("" + connectInfo.getGameid());
}
logger.info("websocket {} open连接: tpiId:{},host:{},端口:{}", webSocketSession.getId(), connectInfo.getGameid(),
connectInfo.getHost(), connectInfo.getPort());