{"action":"closed","issue":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/191","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/191/comments","events_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/191/events","html_url":"https://github.com/Cardshifter/Cardshifter/issues/191","id":71124838,"number":191,"title":"WebsocketNotConnectedException causing errors on entire server","user":{"login":"Zomis","id":1405379,"avatar_url":"https://avatars.githubusercontent.com/u/1405379?v=3","gravatar_id":"","url":"https://api.github.com/users/Zomis","html_url":"https://github.com/Zomis","followers_url":"https://api.github.com/users/Zomis/followers","following_url":"https://api.github.com/users/Zomis/following{/other_user}","gists_url":"https://api.github.com/users/Zomis/gists{/gist_id}","starred_url":"https://api.github.com/users/Zomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zomis/subscriptions","organizations_url":"https://api.github.com/users/Zomis/orgs","repos_url":"https://api.github.com/users/Zomis/repos","events_url":"https://api.github.com/users/Zomis/events{/privacy}","received_events_url":"https://api.github.com/users/Zomis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/next%20release","name":"next release","color":"ededed"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/server","name":"server","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"Zomis","id":1405379,"avatar_url":"https://avatars.githubusercontent.com/u/1405379?v=3","gravatar_id":"","url":"https://api.github.com/users/Zomis","html_url":"https://github.com/Zomis","followers_url":"https://api.github.com/users/Zomis/followers","following_url":"https://api.github.com/users/Zomis/following{/other_user}","gists_url":"https://api.github.com/users/Zomis/gists{/gist_id}","starred_url":"https://api.github.com/users/Zomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zomis/subscriptions","organizations_url":"https://api.github.com/users/Zomis/orgs","repos_url":"https://api.github.com/users/Zomis/repos","events_url":"https://api.github.com/users/Zomis/events{/privacy}","received_events_url":"https://api.github.com/users/Zomis/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/milestones/4","html_url":"https://github.com/Cardshifter/Cardshifter/milestones/0.6","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/milestones/4/labels","id":821777,"number":4,"title":"0.6","description":"","creator":{"login":"Zomis","id":1405379,"avatar_url":"https://avatars.githubusercontent.com/u/1405379?v=3","gravatar_id":"","url":"https://api.github.com/users/Zomis","html_url":"https://github.com/Zomis","followers_url":"https://api.github.com/users/Zomis/followers","following_url":"https://api.github.com/users/Zomis/following{/other_user}","gists_url":"https://api.github.com/users/Zomis/gists{/gist_id}","starred_url":"https://api.github.com/users/Zomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zomis/subscriptions","organizations_url":"https://api.github.com/users/Zomis/orgs","repos_url":"https://api.github.com/users/Zomis/repos","events_url":"https://api.github.com/users/Zomis/events{/privacy}","received_events_url":"https://api.github.com/users/Zomis/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":38,"state":"open","created_at":"2014-10-10T23:19:18Z","updated_at":"2015-05-30T01:00:49Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-04-26T21:48:35Z","updated_at":"2015-05-30T01:00:49Z","closed_at":"2015-05-30T01:00:49Z","body":"When a websocket loses connection without being marked as offline, big fat error happens causing all other clients that connect receive an error message because the server cannot send a message to this websocket:\r\n\r\n    [2015-04-26 23:39:52,721]  INFO ClientWebSocket [WebsocketSelector21] (  ClientWebSocket.java: 44) - Sending to client: com.cardshifter.api.outgoing.ClientDisconnectedMessage@2abbd36a - [0, 0, 0, 42, 0, 0, 0, 10, 0, 100, 0, 105, 0, 115, 0, 99, 0, 111, 0, 110, 0, 110, 0, 101, 0, 99, 0, 116, 0, 0, 0, 5, 0, 90, 0, 111, 0, 109, 0, 105, 0, 115, 0, 0, 0, 1]\r\n    [2015-04-26 23:39:52,721]  WARN  ServerWeb [WebsocketSelector21] (        ServerWeb.java: 87) - Connection error: org.java_websocket.WebSocketImpl@6c2fad21\r\n    org.java_websocket.exceptions.WebsocketNotConnectedException\r\n    \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:566)\r\n    \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:543)\r\n    \tat com.cardshifter.server.clients.ClientWebSocket.onSendToClient(ClientWebSocket.java:45)\r\n    \tat com.cardshifter.api.ClientIO.sendToClient(ClientIO.java:27)\r\n    \tat com.cardshifter.core.game.ServerGame.lambda$send$115(ServerGame.java:95)\r\n    \tat com.cardshifter.core.game.ServerGame$$Lambda$210/1399698386.accept(Unknown Source)\r\n\r\nUse if-check to make sure websocket is connected before sending message. And/Or catch exception(s)"}}