Fixed server socket being closed after a restart.

Prevents a bug where multiple program instances can be run.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-01-27 05:49:58 -05:00
parent 44bdf70c98
commit 71edef2fa9
2 changed files with 6 additions and 4 deletions

View File

@ -74,9 +74,11 @@ public class Container extends AppGameContainer {
} }
} }
if (forceExit) if (forceExit) {
Opsu.closeSocket();
System.exit(0); System.exit(0);
} }
}
/** /**
* Actions to perform before destroying the game container. * Actions to perform before destroying the game container.
@ -85,9 +87,6 @@ public class Container extends AppGameContainer {
// save user options // save user options
Options.saveOptions(); Options.saveOptions();
// close server socket
Opsu.closeSocket();
// destroy images // destroy images
InternalTextureLoader.get().clear(); InternalTextureLoader.get().clear();

View File

@ -160,6 +160,9 @@ public class Opsu extends StateBasedGame {
else else
ErrorHandler.error("Error while creating game container.", e, true); ErrorHandler.error("Error while creating game container.", e, true);
} }
// close server socket
closeSocket();
} }
@Override @Override