Code cleanup

This commit is contained in:
drdev
2014-10-25 20:25:19 +00:00
parent da824e6fc0
commit 0c3e46dbf5
2 changed files with 12 additions and 19 deletions

View File

@@ -77,7 +77,6 @@ public enum CHomeUI implements ICDoc, IMenuProvider {
*/
@Override
public void initialize() {
Singletons.getControl().getForgeMenu().setProvider(this);
selectPrevious();

View File

@@ -19,7 +19,6 @@ import java.util.concurrent.CopyOnWriteArraySet;
public class NetServer {
private final Server srv = new Server();
private final Set<ClientSocket> _openSockets = new CopyOnWriteArraySet<ClientSocket>();
@@ -42,8 +41,7 @@ public class NetServer {
}
@SuppressWarnings("serial")
public class GameServlet extends WebSocketServlet
{
public class GameServlet extends WebSocketServlet {
@Override
public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
System.out.printf("Connection from %s recieved%n", request.getRemoteAddr());
@@ -51,13 +49,10 @@ public class NetServer {
}
}
public class ClientSocket implements WebSocket.OnTextMessage, IClientSocket
{
public class ClientSocket implements WebSocket.OnTextMessage, IClientSocket {
private Connection _connection;
private IConnectionObserver _client;
@Override
public void onClose(int closeCode, String message) {
System.out.println("Lost connection: " + closeCode + ", " + message);
@@ -97,8 +92,7 @@ public class NetServer {
}
public void listen(int port) {
if (!srv.isStarted())
{
if (!srv.isStarted()) {
portNumber = port;
URI serverUri = null;
try {
@@ -108,10 +102,10 @@ public class NetServer {
String host = connector.getHost();
serverUri = new URI(String.format("ws://%s:%d/", host == null ? "localhost" : host ,port));
} catch (Exception e) {
}
catch (Exception e) {
throw new RuntimeException(e);
}
System.out.println("Server started @ " + serverUri);
}
else {
@@ -123,9 +117,9 @@ public class NetServer {
try {
srv.stop();
portNumber = -1;
} catch (Exception e) {
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}