fix local server-client disallowing connections
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
37db40dc22
commit
8bf1c23704
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Tue Aug 13 19:04:49 EDT 2024
|
||||
buildNumber=202
|
||||
#Thu Aug 15 18:38:57 EDT 2024
|
||||
buildNumber=204
|
||||
|
||||
@ -44,7 +44,7 @@ public class DebugSPWorldLoading {
|
||||
//initialize the local connection
|
||||
Globals.clientUsername = "testuser";
|
||||
Globals.clientPassword = AuthenticationManager.getHashedString("testpass");
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection();
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection(true);
|
||||
//wait for player object creation
|
||||
while(Globals.playerManager.getPlayers().size() < 1){
|
||||
try {
|
||||
|
||||
@ -72,7 +72,7 @@ public class LevelEditorLoading {
|
||||
//initialize the local connection
|
||||
Globals.clientUsername = "leveleditor";
|
||||
Globals.clientPassword = AuthenticationManager.getHashedString("leveleditor");
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection();
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection(false);
|
||||
//wait for player object creation
|
||||
while(Globals.playerManager.getPlayers().size() < 1){
|
||||
try {
|
||||
|
||||
@ -42,7 +42,7 @@ public class LevelLoading {
|
||||
//initialize the local connection
|
||||
Globals.clientUsername = "leveleditor";
|
||||
Globals.clientPassword = AuthenticationManager.getHashedString("leveleditor");
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection();
|
||||
ServerConnectionHandler serverPlayerConnection = LoadingUtils.initLocalConnection(true);
|
||||
//wait for player object creation
|
||||
while(Globals.playerManager.getPlayers().size() < 1){
|
||||
try {
|
||||
|
||||
@ -87,10 +87,14 @@ public class LoadingUtils {
|
||||
}
|
||||
|
||||
static final int STREAM_BUFFER_SIZE = 32 * 1024 * 1024;
|
||||
static ServerConnectionHandler initLocalConnection(){
|
||||
static ServerConnectionHandler initLocalConnection(boolean runServerThread){
|
||||
ServerConnectionHandler rVal = null;
|
||||
try {
|
||||
Globals.server = new Server(NetUtils.getPort());
|
||||
if(runServerThread){
|
||||
LoadingUtils.initServerThread();
|
||||
} else {
|
||||
Globals.server = new Server(NetUtils.getPort());
|
||||
}
|
||||
//client -> server pipe
|
||||
PipedInputStream clientInput = new PipedInputStream(STREAM_BUFFER_SIZE);
|
||||
PipedOutputStream serverOutput = new PipedOutputStream(clientInput);
|
||||
|
||||
@ -129,7 +129,7 @@ public class ClientNetworking implements Runnable {
|
||||
this.socket = new Socket(address,port);
|
||||
connected = true;
|
||||
} catch (IOException ex) {
|
||||
LoggerInterface.loggerNetworking.WARNING("Client failed to connect!");
|
||||
LoggerInterface.loggerNetworking.ERROR("Client failed to connect!", ex);
|
||||
}
|
||||
if(!connected){
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user