1
0

Fix infinite loop

This commit is contained in:
choelzl 2020-11-10 17:19:45 +01:00
parent b14fdc00c9
commit 29a348eb8a
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
2 changed files with 6 additions and 4 deletions

View File

@ -29,12 +29,12 @@ public class NetHandlerFD extends NetEventHandlerAbstract {
@Override
public void beat() {
hosts.forEach(h-> alive.computeIfPresent(h.getId(),(k, v) -> {
if(v == -1) return 1;
if(v == -1) return 0;
if(v > NetManager.FD_MAX_TRIES)
crashNextAsync(NetEvent.Message(h, Message.EMPTY()));
else
sendNextSync(NetEvent.MessageHRTB(h));
return v;
return v+1;
}));
}

View File

@ -37,11 +37,13 @@ public abstract class ParamDetector {
System.out.println("Starting Process with WindowWidth of "+windowWidth+" (~ x"+windowWidthMult+").");
NetManager.WINDOW_WIDTH = windowWidth;
NetManager.INTERNAL_WAIT = 500;
//We might want to PingPong To set Custom Timing Limitations....
NetManager.FD_MAX_TRIES = 3;
NetManager.FD_MAX_TRIES = 10;
NetManager.FD_WAIT = 1000;
NetManager.SL_MAX_TRIES = 8;
NetManager.INTERNAL_WAIT = 500;
NetManager.SL_WAIT = NetManager.INTERNAL_WAIT;
}
}