|
@@ -1,14 +1,21 @@
|
|
|
package com.incubator.game.room;
|
|
|
|
|
|
+import cn.hutool.json.JSONException;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.incubator.common.log4j.Log;
|
|
|
import com.incubator.core.room.GRoomInterface;
|
|
|
import com.incubator.game.constant.RedisKeyConstant;
|
|
|
+import com.incubator.game.contest.Contest;
|
|
|
+import com.incubator.game.contest.ContestService;
|
|
|
+import com.incubator.game.data.entity.ZjUserInfolog;
|
|
|
import com.incubator.game.data.jedis.RedisUtil;
|
|
|
import com.incubator.game.data.po.RoomPO;
|
|
|
import com.incubator.game.player.Player;
|
|
|
import com.incubator.game.util.GDUtils;
|
|
|
+import com.incubator.game.util.SendGameInfoUtil;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.concurrent.Executors;
|
|
@@ -112,6 +119,13 @@ public class Room implements GRoomInterface {
|
|
|
public void destroy() {
|
|
|
Log.info("Room {} has been destroyed.", this.data.roomId);
|
|
|
this.isActive = false;
|
|
|
+ try {
|
|
|
+ cn.hutool.json.JSONObject object = new cn.hutool.json.JSONObject();
|
|
|
+ object.put("type","gameOver");
|
|
|
+ SendGameInfoUtil.sendGameInfo(object);
|
|
|
+ } catch (JSONException e) {
|
|
|
+ Log.error("向后台发送结算信息出错...{}", e);
|
|
|
+ }
|
|
|
this.scheduler.shutdownNow();
|
|
|
this.scheduler = null;
|
|
|
// 从缓存移除
|