mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-31 01:44:22 +07:00
Less error message spam in debug mode
This commit is contained in:
parent
4b78e65d7f
commit
c07061e94f
@ -42,7 +42,12 @@ public class ArcNetProvider implements NetProvider{
|
||||
public ArcNetProvider(){
|
||||
ArcNet.errorHandler = e -> {
|
||||
if(Log.level == LogLevel.debug){
|
||||
Log.debug(Strings.getStackTrace(e));
|
||||
var finalCause = Strings.getFinalCause(e);
|
||||
|
||||
//"connection is closed" is a pointless annoying error that should not be logged
|
||||
if(!"Connection is closed.".equals(finalCause.getMessage())){
|
||||
Log.debug(Strings.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -361,10 +366,12 @@ public class ArcNetProvider implements NetProvider{
|
||||
@Override
|
||||
public void send(Object object, boolean reliable){
|
||||
try{
|
||||
if(reliable){
|
||||
connection.sendTCP(object);
|
||||
}else{
|
||||
connection.sendUDP(object);
|
||||
if(connection.isConnected()){
|
||||
if(reliable){
|
||||
connection.sendTCP(object);
|
||||
}else{
|
||||
connection.sendUDP(object);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
Log.err(e);
|
||||
|
Loading…
Reference in New Issue
Block a user