Added more debugging info to server
This commit is contained in:
@@ -177,7 +177,7 @@ public class KryoServer implements ServerProvider {
|
|||||||
connections.clear();
|
connections.clear();
|
||||||
lastconnection = 0;
|
lastconnection = 0;
|
||||||
|
|
||||||
Thread thread = new Thread(() ->{
|
Thread thread = new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
server.close();
|
server.close();
|
||||||
try {
|
try {
|
||||||
@@ -260,17 +260,19 @@ public class KryoServer implements ServerProvider {
|
|||||||
public void sendTo(int id, Object object, SendMode mode) {
|
public void sendTo(int id, Object object, SendMode mode) {
|
||||||
NetConnection conn = getByID(id);
|
NetConnection conn = getByID(id);
|
||||||
if(conn == null){
|
if(conn == null){
|
||||||
|
Log.info("Failed to find connection with ID {0}!", id);
|
||||||
Log.err("KRYONET CONNECTIONS:");
|
Log.err("KRYONET CONNECTIONS:");
|
||||||
for(Connection c : server.getConnections()){
|
for(Connection c : server.getConnections()){
|
||||||
NetConnection k = getByKryoID(c.getID());
|
NetConnection k = getByKryoID(c.getID());
|
||||||
Log.err(" - Kryonet connection / ID {0} / IP {1} / NetConnection ID {2}",
|
Log.err(" - Kryonet connection / ID {0} / IP {1} / NetConnection ID {2}",
|
||||||
c.getID(), c.getRemoteAddressTCP().getHostName(), k == null ? "NOT FOUND" : k.id);
|
c.getID(), c.getRemoteAddressTCP().getAddress().getHostAddress(), k == null ? "NOT FOUND" : k.id);
|
||||||
}
|
}
|
||||||
Log.err("NET CONNECTIONS:");
|
Log.err("NET CONNECTIONS:");
|
||||||
for(NetConnection c : connections){
|
for(NetConnection c : connections){
|
||||||
Log.err(" - NetConnection / ID {0} / IP {1}", c.id, c.address);
|
Log.err(" - NetConnection / ID {0} / IP {1}", c.id, c.address);
|
||||||
}
|
}
|
||||||
System.exit(1); //TODO remove
|
//TODO remove
|
||||||
|
Timers.runTask(0.1f, () -> System.exit(-1));
|
||||||
throw new RuntimeException("Unable to find connection with ID " + id + "!");
|
throw new RuntimeException("Unable to find connection with ID " + id + "!");
|
||||||
}
|
}
|
||||||
conn.send(object, mode);
|
conn.send(object, mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user