User controls, UI improvement

This commit is contained in:
Thomas
2020-08-04 16:00:55 +02:00
parent 1d1d79f90e
commit ea81b7f598
11 changed files with 182 additions and 68 deletions

View File

@@ -12,8 +12,8 @@ import gltronic.voozik.model.BiMap;
@Service
public class RoomManager implements IRoomManager{
BiMap<String, WebSocketSession> users = new BiMap<String, WebSocketSession>();
BiMap<String, String> rooms = new BiMap<String, String>();
private volatile BiMap<String, WebSocketSession> users = new BiMap<String, WebSocketSession>();
private volatile BiMap<String, String> rooms = new BiMap<String, String>();
public void login(WebSocketSession session, String name) throws InterruptedException, IOException {
if (name == null) {

View File

@@ -16,7 +16,7 @@ import gltronic.voozik.business.IRoomManager;
@Component
public class SocketHandler extends TextWebSocketHandler {
List<WebSocketSession> sessions = new CopyOnWriteArrayList<>();
private volatile List<WebSocketSession> sessions = new CopyOnWriteArrayList<>();
@Autowired
IRoomManager roomManager;
@@ -57,7 +57,7 @@ public class SocketHandler extends TextWebSocketHandler {
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
System.err.println("[WS] new connection");
System.err.println("[WS] new connection " + this);
sessions.add(session);
}