| | |
| | | // 消耗金币 |
| | | BigDecimal consume = (BigDecimal) fortObj; |
| | | |
| | | MsgModel msg = new MsgModel(consume, fishGold, SID_MID.get(session.getId())); |
| | | MsgModel msg = new MsgModel(consume, fishGold, SID_MID.get(session.getId()), fortId); |
| | | // 发送打渔消息 |
| | | fishHitProducer.sendFishHitMsg(JSONObject.toJSONString(msg)); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception { |
| | | log.info("离开websocket"); |
| | | Long memberId = SID_MID.get(session.getId()); |
| | | |
| | | if (memberId != null) { |
| | | MEMBER_SESSIONS.remove(memberId); |
| | | } |
| | | SID_MID.remove(session.getId()); |
| | | MEMBER_SESSIONS.remove(memberId); |
| | | } |
| | | } |