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 <buj351@outlook.com>
This commit is contained in:
Buj
2025-02-05 01:44:58 +07:00
committed by GitHub
parent aa8e3b4a37
commit 88388fffeb
5 changed files with 9 additions and 5 deletions

View File

@@ -257,7 +257,7 @@ trace = Отслеживать игрока
trace.playername = Имя игрока: [accent]{0} trace.playername = Имя игрока: [accent]{0}
trace.ip = IP: [accent]{0} trace.ip = IP: [accent]{0}
trace.id = ID: [accent]{0} trace.id = ID: [accent]{0}
trace.language = Language: [accent]{0} trace.language = Язык: [accent]{0}
trace.mobile = Мобильный клиент: [accent]{0} trace.mobile = Мобильный клиент: [accent]{0}
trace.modclient = Пользовательский клиент: [accent]{0} trace.modclient = Пользовательский клиент: [accent]{0}
trace.times.joined = Присоединялся раз: [accent]{0} trace.times.joined = Присоединялся раз: [accent]{0}

View File

@@ -815,7 +815,7 @@ public class NetServer implements ApplicationListener{
} }
case trace -> { case trace -> {
PlayerInfo stats = netServer.admins.getInfo(other.uuid()); 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){ if(player.con != null){
Call.traceInfo(player.con, other, info); Call.traceInfo(player.con, other, info);
}else{ }else{

View File

@@ -955,6 +955,7 @@ public class TypeIO{
public static void writeTraceInfo(Writes write, TraceInfo trace){ public static void writeTraceInfo(Writes write, TraceInfo trace){
writeString(write, trace.ip); writeString(write, trace.ip);
writeString(write, trace.uuid); writeString(write, trace.uuid);
writeString(write, trace.locale);
write.b(trace.modded ? (byte)1 : 0); write.b(trace.modded ? (byte)1 : 0);
write.b(trace.mobile ? (byte)1 : 0); write.b(trace.mobile ? (byte)1 : 0);
write.i(trace.timesJoined); write.i(trace.timesJoined);
@@ -965,7 +966,7 @@ public class TypeIO{
} }
public static TraceInfo readTraceInfo(Reads read){ 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){ public static void writeStrings(Writes write, String[] strings, int maxLen){

View File

@@ -628,14 +628,15 @@ public class Administration{
} }
public static class TraceInfo{ public static class TraceInfo{
public String ip, uuid; public String ip, uuid, locale;
public boolean modded, mobile; public boolean modded, mobile;
public int timesJoined, timesKicked; public int timesJoined, timesKicked;
public String[] ips, names; 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.ip = ip;
this.uuid = uuid; this.uuid = uuid;
this.locale = locale;
this.modded = modded; this.modded = modded;
this.mobile = mobile; this.mobile = mobile;
this.timesJoined = timesJoined; this.timesJoined = timesJoined;

View File

@@ -34,6 +34,8 @@ public class TraceDialog extends BaseDialog{
c.add(Core.bundle.format("trace.playername", player.name)).row(); c.add(Core.bundle.format("trace.playername", player.name)).row();
c.button(Icon.copySmall, style, () -> copy(info.ip)).size(s).padRight(4f); c.button(Icon.copySmall, style, () -> copy(info.ip)).size(s).padRight(4f);
c.add(Core.bundle.format("trace.ip", info.ip)).row(); 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.button(Icon.copySmall, style, () -> copy(info.uuid)).size(s).padRight(4f);
c.add(Core.bundle.format("trace.id", info.uuid)).row(); c.add(Core.bundle.format("trace.id", info.uuid)).row();
}).row(); }).row();