From 88388fffebcdec435c1b08116aab82437f7ce970 Mon Sep 17 00:00:00 2001 From: Buj <42136194+5GameMaker@users.noreply.github.com> Date: Wed, 5 Feb 2025 01:44:58 +0700 Subject: [PATCH] Bring back language in trace, except it actually works now (#10420) * Re-added 'language' in trace info (it actually works now) * Updated c locale --------- Co-authored-by: buj --- core/assets/bundles/bundle_ru.properties | 2 +- core/src/mindustry/core/NetServer.java | 2 +- core/src/mindustry/io/TypeIO.java | 3 ++- core/src/mindustry/net/Administration.java | 5 +++-- core/src/mindustry/ui/dialogs/TraceDialog.java | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index eaab89ae0e..beeb1ac206 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -257,7 +257,7 @@ trace = Отслеживать игрока trace.playername = Имя игрока: [accent]{0} trace.ip = IP: [accent]{0} trace.id = ID: [accent]{0} -trace.language = Language: [accent]{0} +trace.language = Язык: [accent]{0} trace.mobile = Мобильный клиент: [accent]{0} trace.modclient = Пользовательский клиент: [accent]{0} trace.times.joined = Присоединялся раз: [accent]{0} diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 1222eae1e6..b882706e83 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -815,7 +815,7 @@ public class NetServer implements ApplicationListener{ } case trace -> { PlayerInfo stats = netServer.admins.getInfo(other.uuid()); - TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.con.modclient, other.con.mobile, stats.timesJoined, stats.timesKicked, stats.ips.toArray(String.class), stats.names.toArray(String.class)); + TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.locale, other.con.modclient, other.con.mobile, stats.timesJoined, stats.timesKicked, stats.ips.toArray(String.class), stats.names.toArray(String.class)); if(player.con != null){ Call.traceInfo(player.con, other, info); }else{ diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index 5be1d54403..70f28cae9d 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -955,6 +955,7 @@ public class TypeIO{ public static void writeTraceInfo(Writes write, TraceInfo trace){ writeString(write, trace.ip); writeString(write, trace.uuid); + writeString(write, trace.locale); write.b(trace.modded ? (byte)1 : 0); write.b(trace.mobile ? (byte)1 : 0); write.i(trace.timesJoined); @@ -965,7 +966,7 @@ public class TypeIO{ } public static TraceInfo readTraceInfo(Reads read){ - return new TraceInfo(readString(read), readString(read), read.b() == 1, read.b() == 1, read.i(), read.i(), readStrings(read), readStrings(read)); + return new TraceInfo(readString(read), readString(read), readString(read), read.b() == 1, read.b() == 1, read.i(), read.i(), readStrings(read), readStrings(read)); } public static void writeStrings(Writes write, String[] strings, int maxLen){ diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index da453afaa5..0f64b9850a 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -628,14 +628,15 @@ public class Administration{ } public static class TraceInfo{ - public String ip, uuid; + public String ip, uuid, locale; public boolean modded, mobile; public int timesJoined, timesKicked; public String[] ips, names; - public TraceInfo(String ip, String uuid, boolean modded, boolean mobile, int timesJoined, int timesKicked, String[] ips, String[] names){ + public TraceInfo(String ip, String uuid, String locale, boolean modded, boolean mobile, int timesJoined, int timesKicked, String[] ips, String[] names){ this.ip = ip; this.uuid = uuid; + this.locale = locale; this.modded = modded; this.mobile = mobile; this.timesJoined = timesJoined; diff --git a/core/src/mindustry/ui/dialogs/TraceDialog.java b/core/src/mindustry/ui/dialogs/TraceDialog.java index a758e22fb3..402df45189 100644 --- a/core/src/mindustry/ui/dialogs/TraceDialog.java +++ b/core/src/mindustry/ui/dialogs/TraceDialog.java @@ -34,6 +34,8 @@ public class TraceDialog extends BaseDialog{ c.add(Core.bundle.format("trace.playername", player.name)).row(); c.button(Icon.copySmall, style, () -> copy(info.ip)).size(s).padRight(4f); c.add(Core.bundle.format("trace.ip", info.ip)).row(); + c.button(Icon.copySmall, style, () -> copy(info.locale)).size(s).padRight(4f); + c.add(Core.bundle.format("trace.language", info.locale)).row(); c.button(Icon.copySmall, style, () -> copy(info.uuid)).size(s).padRight(4f); c.add(Core.bundle.format("trace.id", info.uuid)).row(); }).row();