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:
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user