Merge branch 'master' of https://github.com/Anuken/Mindustry into markers-update

This commit is contained in:
ApsZoldat
2023-12-07 18:26:55 +03:00
42 changed files with 78 additions and 51 deletions

View File

@@ -1,6 +1,5 @@
package mindustry.net;
import arc.*;
import arc.struct.*;
import arc.util.*;
import mindustry.entities.units.*;
@@ -82,17 +81,16 @@ public abstract class NetConnection{
Call.kick(this, reason);
}
if(uuid.startsWith("steam:")){
//run with a 2-frame delay so there is time to send the kick packet, steam handles this weirdly
Core.app.post(() -> Core.app.post(this::close));
}else{
close();
}
kickDisconnect();
netServer.admins.save();
kicked = true;
}
protected void kickDisconnect(){
close();
}
public boolean isConnected(){
return true;
}

View File

@@ -250,9 +250,10 @@ public class JoinDialog extends BaseDialog{
buildServer(host, server.content, false);
}
void buildServer(Host host, Table content, boolean inner){
void buildServer(Host host, Table content, boolean local){
content.top().left();
String versionString = getVersionString(host);
boolean isBanned = local && Vars.steam && host.description != null && host.description.equals("[banned]");
String versionString = getVersionString(host) + (isBanned ? "[red] [banned]" : "");
float twidth = targetWidth() - 40f;
@@ -260,7 +261,7 @@ public class JoinDialog extends BaseDialog{
Color color = Pal.gray;
if(inner){
if(local){
content.table(Tex.whiteui, t -> {
t.left();
t.setColor(color);
@@ -274,7 +275,7 @@ public class JoinDialog extends BaseDialog{
t.setColor(color);
t.left();
if(!host.description.isEmpty()){
if(!host.description.isEmpty() && !isBanned){
//limit newlines.
int count = 0;
StringBuilder result = new StringBuilder(host.description.length());