diff --git a/src/main/java/me/mrletsplay/shareserver/ShareServer.java b/src/main/java/me/mrletsplay/shareserver/ShareServer.java index 3af3e25..8517c8a 100644 --- a/src/main/java/me/mrletsplay/shareserver/ShareServer.java +++ b/src/main/java/me/mrletsplay/shareserver/ShareServer.java @@ -8,7 +8,7 @@ public class ShareServer { private static final Map SESSIONS = new HashMap<>(); public static void main(String[] args) { - new ShareWSServer().start(); + new ShareWSServer().run(); } public static Session getOrCreateSession(String sessionID) { diff --git a/src/main/java/me/mrletsplay/shareserver/ShareWSServer.java b/src/main/java/me/mrletsplay/shareserver/ShareWSServer.java index e54be85..48565b4 100644 --- a/src/main/java/me/mrletsplay/shareserver/ShareWSServer.java +++ b/src/main/java/me/mrletsplay/shareserver/ShareWSServer.java @@ -85,6 +85,7 @@ public class ShareWSServer extends WebSocketServer { SessionUser user = conn.getAttachment(); Session session = user.session(); boolean isHost = getHost(getPeers(session)).equals(conn); + System.out.println("[" + user.siteID() + "] " + m); switch(m.getType()) { case CHANGE -> getPeers(session).forEach(peer -> send(peer, m)); case REQUEST_FULL_SYNC, REQUEST_CHECKSUM -> { @@ -114,11 +115,6 @@ public class ShareWSServer extends WebSocketServer { conn.close(CloseFrame.POLICY_VALIDATION, "Invalid message received"); } } - -// System.out.println("Got a message"); -// getConnections().forEach(c -> { -// if(conn != c) c.send(message); -// }); } private List getPeers(Session session) {