Added some debug statements and registry settings to server.
This commit is contained in:
parent
9c5cde199e
commit
b0a289e35f
|
@ -127,6 +127,7 @@ public class ServerInfoServlet extends HttpServlet {
|
|||
int rowCount = createStmt.executeUpdate();
|
||||
createStmt.close();
|
||||
if (rowCount != 1) throw new SQLException("Could not insert new server.");
|
||||
System.out.println("Registered new server " + info.name() + " @ " + info.address());
|
||||
} else {
|
||||
PreparedStatement updateStmt = con.prepareStatement("""
|
||||
UPDATE servers SET description = ?, location = ?, max_players = ?, current_players = ?
|
||||
|
@ -141,6 +142,7 @@ public class ServerInfoServlet extends HttpServlet {
|
|||
int rowCount = updateStmt.executeUpdate();
|
||||
updateStmt.close();
|
||||
if (rowCount != 1) throw new SQLException("Could not update server.");
|
||||
System.out.println("Updated server information for " + info.name() + " @ " + info.address());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,5 +158,6 @@ public class ServerInfoServlet extends HttpServlet {
|
|||
int rowCount = stmt.executeUpdate();
|
||||
stmt.close();
|
||||
if (rowCount != 1) throw new SQLException("Could not update server status.");
|
||||
System.out.println("Updated server status for " + status.name() + " @ " + status.address());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package nl.andrewlalis.aos_server.settings;
|
||||
|
||||
public class RegistrySettings {
|
||||
private boolean discoverable;
|
||||
private String registryUri;
|
||||
private String name;
|
||||
private String address;
|
||||
private String description;
|
||||
private String location;
|
||||
|
||||
public boolean isDiscoverable() {
|
||||
return discoverable;
|
||||
}
|
||||
|
||||
public String getRegistryUri() {
|
||||
return registryUri;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,8 @@ public class ServerSettings {
|
|||
private int port;
|
||||
private int maxPlayers;
|
||||
private float ticksPerSecond;
|
||||
|
||||
private RegistrySettings registrySettings;
|
||||
private PlayerSettings playerSettings;
|
||||
private TeamSettings teamSettings;
|
||||
private List<GunSettings> gunSettings;
|
||||
|
|
|
@ -2,6 +2,16 @@ port: 8035
|
|||
max-players: 32
|
||||
ticks-per-second: 120
|
||||
|
||||
# Information for the public server registry.
|
||||
registry-data:
|
||||
discoverable: true
|
||||
registry-uri: "http://localhost:8567"
|
||||
name: "Testing Server"
|
||||
address: "localhost:8035"
|
||||
description: "A simple testing server for development."
|
||||
location: "Earth"
|
||||
|
||||
|
||||
# Settings that control player behavior.
|
||||
player-settings:
|
||||
speed: 10
|
||||
|
|
Loading…
Reference in New Issue