diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index fd0114c4d9..bda86b5b88 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -155,12 +155,12 @@ public class EntityProcess extends BaseProcessor{ Log.debug("&gGenerating interface for " + component.name()); for(TypeName tn : inter.superinterfaces){ - Log.debug("&g> &lbextends {0}", simpleName(tn.toString())); + Log.debug("&g> &lbextends @", simpleName(tn.toString())); } //log methods generated for(MethodSpec spec : inter.methodSpecs){ - Log.debug("&g> > &c{0} {1}({2})", simpleName(spec.returnType.toString()), spec.name, Array.with(spec.parameters).toString(", ", p -> simpleName(p.type.toString()) + " " + p.name)); + Log.debug("&g> > &c@ @(@)", simpleName(spec.returnType.toString()), spec.name, Array.with(spec.parameters).toString(", ", p -> simpleName(p.type.toString()) + " " + p.name)); } Log.debug(""); diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java index 0442976654..37d7175fb9 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -121,7 +121,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform if(!finished){ drawLoading(); if(assets.update(1000 / loadingFPS)){ - Log.info("Total time to load: {0}", Time.timeSinceMillis(beginTime)); + Log.info("Total time to load: @", Time.timeSinceMillis(beginTime)); for(ApplicationListener listener : modules){ listener.init(); } diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index 7b6c1069ca..fe5a9aa2c1 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -88,9 +88,9 @@ public class ContentLoader{ Log.debug("--- CONTENT INFO ---"); for(int k = 0; k < contentMap.length; k++){ - Log.debug("[{0}]: loaded {1}", ContentType.values()[k].name(), contentMap[k].size); + Log.debug("[@]: loaded @", ContentType.values()[k].name(), contentMap[k].size); } - Log.debug("Total content loaded: {0}", Array.with(ContentType.values()).mapInt(c -> contentMap[c.ordinal()].size).sum()); + Log.debug("Total content loaded: @", Array.with(ContentType.values()).mapInt(c -> contentMap[c.ordinal()].size).sum()); Log.debug("-------------------"); } diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 459f761abc..e222a3d091 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -53,7 +53,7 @@ public class NetClient implements ApplicationListener{ public NetClient(){ net.handleClient(Connect.class, packet -> { - Log.info("Connecting to server: {0}", packet.addressTCP); + Log.info("Connecting to server: @", packet.addressTCP); player.admin(false); @@ -115,7 +115,7 @@ public class NetClient implements ApplicationListener{ }); net.handleClient(WorldStream.class, data -> { - Log.info("Recieved world data: {0} bytes.", data.stream.available()); + Log.info("Recieved world data: @ bytes.", data.stream.available()); NetworkIO.loadWorld(new InflaterInputStream(data.stream)); finishConnecting(); @@ -171,14 +171,14 @@ public class NetClient implements ApplicationListener{ } //server console logging - Log.info("&y{0}: &lb{1}", player.name(), message); + Log.info("&y@: &lb@", player.name(), message); //invoke event for all clients but also locally //this is required so other clients get the correct name even if they don't know who's sending it yet Call.sendMessage(message, colorizeName(player.id(), player.name()), player); }else{ //log command to console but with brackets - Log.info("<&y{0}: &lm{1}&lg>", player.name(), message); + Log.info("<&y@: &lm@&lg>", player.name(), message); //a command was sent, now get the output if(response.type != ResponseType.valid){ @@ -401,7 +401,7 @@ public class NetClient implements ApplicationListener{ int pos = input.readInt(); Tile tile = world.tile(pos); if(tile == null || tile.entity == null){ - Log.warn("Missing entity at {0}. Skipping block snapshot.", tile); + Log.warn("Missing entity at @. Skipping block snapshot.", tile); break; } tile.entity.readAll(Reads.get(input), tile.entity.version()); diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 12d12532d8..1f558a1965 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -159,7 +159,7 @@ public class NetServer implements ApplicationListener{ info.id = packet.uuid; admins.save(); Call.onInfoMessage(con, "You are not whitelisted here."); - Log.info("&lcDo &lywhitelist-add {0}&lc to whitelist the player &lb'{1}'", packet.uuid, packet.name); + Log.info("&lcDo &lywhitelist-add @&lc to whitelist the player &lb'@'", packet.uuid, packet.name); con.kick(KickReason.whitelist); return; } @@ -243,11 +243,11 @@ public class NetServer implements ApplicationListener{ try{ RemoteReadServer.readPacket(packet.reader(), packet.type, con.player); }catch(ValidateException e){ - Log.debug("Validation failed for '{0}': {1}", e.player, e.getMessage()); + Log.debug("Validation failed for '@': @", e.player, e.getMessage()); }catch(RuntimeException e){ if(e.getCause() instanceof ValidateException){ ValidateException v = (ValidateException)e.getCause(); - Log.debug("Validation failed for '{0}': {1}", v.player, v.getMessage()); + Log.debug("Validation failed for '@': @", v.player, v.getMessage()); }else{ throw e; } @@ -280,7 +280,7 @@ public class NetServer implements ApplicationListener{ } StringBuilder result = new StringBuilder(); - result.append(Strings.format("[orange]-- Commands Page[lightgray] {0}[gray]/[lightgray]{1}[orange] --\n\n", (page+1), pages)); + result.append(Strings.format("[orange]-- Commands Page[lightgray] @[gray]/[lightgray]@[orange] --\n\n", (page+1), pages)); for(int i = commandsPerPage * page; i < Math.min(commandsPerPage * (page + 1), clientCommands.getCommandList().size); i++){ Command command = clientCommands.getCommandList().get(i); @@ -312,7 +312,7 @@ public class NetServer implements ApplicationListener{ this.map = map; this.task = Timer.schedule(() -> { if(!checkPass()){ - Call.sendMessage(Strings.format("[lightgray]Vote failed. Not enough votes to kick[orange] {0}[lightgray].", target.name())); + Call.sendMessage(Strings.format("[lightgray]Vote failed. Not enough votes to kick[orange] @[lightgray].", target.name())); map[0] = null; task.cancel(); } @@ -323,13 +323,13 @@ public class NetServer implements ApplicationListener{ votes += d; voted.addAll(player.uuid(), admins.getInfo(player.uuid()).lastIP); - Call.sendMessage(Strings.format("[orange]{0}[lightgray] has voted on kicking[orange] {1}[].[accent] ({2}/{3})\n[lightgray]Type[orange] /vote [] to agree.", + Call.sendMessage(Strings.format("[orange]@[lightgray] has voted on kicking[orange] @[].[accent] (@/@)\n[lightgray]Type[orange] /vote [] to agree.", player.name(), target.name(), votes, votesRequired())); } boolean checkPass(){ if(votes >= votesRequired()){ - Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] {0}[orange] will be banned from the server for {1} minutes.", target.name(), (kickDuration/60))); + Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] @[orange] will be banned from the server for @ minutes.", target.name(), (kickDuration/60))); target.getInfo().lastKicked = Time.millis() + kickDuration*1000; Groups.player.each(p -> p.uuid().equals(target.uuid()), p -> p.kick(KickReason.vote)); map[0] = null; @@ -468,7 +468,7 @@ public class NetServer implements ApplicationListener{ data.stream = new ByteArrayInputStream(stream.toByteArray()); player.con().sendStream(data); - Log.debug("Packed {0} compressed bytes of world data.", stream.size()); + Log.debug("Packed @ compressed bytes of world data.", stream.size()); } public static void onDisconnect(Playerc player, String reason){ @@ -485,7 +485,7 @@ public class NetServer implements ApplicationListener{ Call.onPlayerDisconnect(player.id()); } - if(Config.showConnectMessages.bool()) Log.info("&lm[{1}] &lc{0} has disconnected. &lg&fi({2})", player.name(), player.uuid(), reason); + if(Config.showConnectMessages.bool()) Log.info("&lm[@] &lc@ has disconnected. &lg&fi(@)", player.uuid(), player.name(), reason); } player.remove(); @@ -607,13 +607,13 @@ public class NetServer implements ApplicationListener{ public static void onAdminRequest(Playerc player, Playerc other, AdminAction action){ if(!player.admin()){ - Log.warn("ACCESS DENIED: Player {0} / {1} attempted to perform admin action without proper security access.", + Log.warn("ACCESS DENIED: Player @ / @ attempted to perform admin action without proper security access.", player.name(), player.con().address); return; } if(other == null || ((other.admin() && !player.isLocal()) && other != player)){ - Log.warn("{0} attempted to perform admin action on nonexistant or admin player.", player.name()); + Log.warn("@ attempted to perform admin action on nonexistant or admin player.", player.name()); return; } @@ -624,10 +624,10 @@ public class NetServer implements ApplicationListener{ }else if(action == AdminAction.ban){ netServer.admins.banPlayerIP(other.con().address); other.kick(KickReason.banned); - Log.info("&lc{0} has banned {1}.", player.name(), other.name()); + Log.info("&lc@ has banned @.", player.name(), other.name()); }else if(action == AdminAction.kick){ other.kick(KickReason.kick); - Log.info("&lc{0} has kicked {1}.", player.name(), other.name()); + Log.info("&lc@ has kicked @.", player.name(), other.name()); }else if(action == AdminAction.trace){ TraceInfo info = new TraceInfo(other.con().address, other.uuid(), other.con().modclient, other.con().mobile); if(player.con() != null){ @@ -635,7 +635,7 @@ public class NetServer implements ApplicationListener{ }else{ NetClient.onTraceInfo(other, info); } - Log.info("&lc{0} has requested trace info of {1}.", player.name(), other.name()); + Log.info("&lc@ has requested trace info of @.", player.name(), other.name()); } } @@ -647,7 +647,7 @@ public class NetServer implements ApplicationListener{ player.con().hasConnected = true; if(Config.showConnectMessages.bool()){ Call.sendMessage("[accent]" + player.name() + "[accent] has connected."); - Log.info("&lm[{1}] &y{0} has connected. ", player.name(), player.uuid()); + Log.info("&lm[@] &y@ has connected. ", player.uuid(), player.name()); } if(!Config.motd.string().equalsIgnoreCase("off")){ @@ -692,7 +692,7 @@ public class NetServer implements ApplicationListener{ public void openServer(){ try{ net.host(Config.port.num()); - info("&lcOpened a server on port {0}.", Config.port.num()); + info("&lcOpened a server on port @.", Config.port.num()); }catch(BindException e){ Log.err("Unable to host: Port already in use! Make sure no other servers are running on the same port in your network."); state.set(State.menu); diff --git a/core/src/mindustry/game/Tutorial.java b/core/src/mindustry/game/Tutorial.java index 882a9bfc48..65634986fd 100644 --- a/core/src/mindustry/game/Tutorial.java +++ b/core/src/mindustry/game/Tutorial.java @@ -105,7 +105,7 @@ public class Tutorial{ public enum TutorialStage{ intro( - line -> Strings.format(line, item(Items.copper), mineCopper), + line -> Core.bundle.format(line, item(Items.copper), mineCopper), () -> item(Items.copper) >= mineCopper ), drill(() -> placed(Blocks.mechanicalDrill, 1)){ diff --git a/core/src/mindustry/graphics/FloorRenderer.java b/core/src/mindustry/graphics/FloorRenderer.java index d3786107a7..223d8d7d13 100644 --- a/core/src/mindustry/graphics/FloorRenderer.java +++ b/core/src/mindustry/graphics/FloorRenderer.java @@ -241,7 +241,7 @@ public class FloorRenderer implements Disposable{ } } - Log.debug("Time to cache: {0}", Time.elapsed()); + Log.debug("Time to cache: @", Time.elapsed()); } @Override diff --git a/core/src/mindustry/graphics/MenuRenderer.java b/core/src/mindustry/graphics/MenuRenderer.java index 206c57e63b..32af36e457 100644 --- a/core/src/mindustry/graphics/MenuRenderer.java +++ b/core/src/mindustry/graphics/MenuRenderer.java @@ -36,7 +36,7 @@ public class MenuRenderer implements Disposable{ Time.mark(); generate(); cache(); - Log.info("Time to generate menu: {0}", Time.elapsed()); + Log.info("Time to generate menu: @", Time.elapsed()); } private void generate(){ diff --git a/core/src/mindustry/maps/Maps.java b/core/src/mindustry/maps/Maps.java index ea12df404e..48ff34d979 100644 --- a/core/src/mindustry/maps/Maps.java +++ b/core/src/mindustry/maps/Maps.java @@ -134,7 +134,7 @@ public class Maps{ loadMap(file, true); } }catch(Exception e){ - Log.err("Failed to load custom map file '{0}'!", file); + Log.err("Failed to load custom map file '@'!", file); Log.err(e); } } @@ -146,7 +146,7 @@ public class Maps{ map.workshop = true; map.tags.put("steamid", file.parent().name()); }catch(Exception e){ - Log.err("Failed to load workshop map file '{0}'!", file); + Log.err("Failed to load workshop map file '@'!", file); Log.err(e); } } @@ -157,7 +157,7 @@ public class Maps{ Map map = loadMap(file, false); map.mod = mod; }catch(Exception e){ - Log.err("Failed to load mod map file '{0}'!", file); + Log.err("Failed to load mod map file '@'!", file); Log.err(e); } }); diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 91272c9e6f..9c91f0fb24 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -561,7 +561,7 @@ public class ContentParser{ FieldMetadata metadata = fields.get(child.name().replace(" ", "_")); if(metadata == null){ if(ignoreUnknownFields){ - Log.warn("{0}: Ignoring unknown field: " + child.name + " (" + type.getName() + ")", object); + Log.warn("@: Ignoring unknown field: " + child.name + " (" + type.getName() + ")", object); continue; }else{ SerializationException ex = new SerializationException("Field not found: " + child.name + " (" + type.getName() + ")"); diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 4455c969dd..847957dec7 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -107,11 +107,11 @@ public class Mods implements Loadable{ Array overrides = mod.root.child("sprites-override").findAll(f -> f.extension().equals("png")); packSprites(sprites, mod, true); packSprites(overrides, mod, false); - Log.debug("Packed {0} images for mod '{1}'.", sprites.size + overrides.size, mod.meta.name); + Log.debug("Packed @ images for mod '@'.", sprites.size + overrides.size, mod.meta.name); totalSprites += sprites.size + overrides.size; }); - Log.debug("Time to pack textures: {0}", Time.elapsed()); + Log.debug("Time to pack textures: @", Time.elapsed()); } private void loadIcons(){ @@ -136,7 +136,7 @@ public class Mods implements Loadable{ pixmap.dispose(); }catch(IOException e){ Core.app.post(() -> { - Log.err("Error packing images for mod: {0}", mod.meta.name); + Log.err("Error packing images for mod: @", mod.meta.name); e.printStackTrace(); if(!headless) ui.showException(e); }); @@ -182,12 +182,12 @@ public class Mods implements Loadable{ Core.atlas = packer.flush(filter, new TextureAtlas()); Core.atlas.setErrorRegion("error"); - Log.debug("Total pages: {0}", Core.atlas.getTextures().size); + Log.debug("Total pages: @", Core.atlas.getTextures().size); } packer.dispose(); packer = null; - Log.debug("Time to update textures: {0}", Time.elapsed()); + Log.debug("Time to update textures: @", Time.elapsed()); } private PageType getPage(AtlasRegion region){ @@ -246,15 +246,15 @@ public class Mods implements Loadable{ for(Fi file : modDirectory.list()){ if(!file.extension().equals("jar") && !file.extension().equals("zip") && !(file.isDirectory() && (file.child("mod.json").exists() || file.child("mod.hjson").exists()))) continue; - Log.debug("[Mods] Loading mod {0}", file); + Log.debug("[Mods] Loading mod @", file); try{ LoadedMod mod = loadMod(file); mods.add(mod); }catch(Throwable e){ if(e instanceof ClassNotFoundException && e.getMessage().contains("mindustry.plugin.Plugin")){ - Log.info("Plugin {0} is outdated and needs to be ported to 6.0! Update its main class to inherit from 'mindustry.mod.Plugin'."); + Log.info("Plugin @ is outdated and needs to be ported to 6.0! Update its main class to inherit from 'mindustry.mod.Plugin'."); }else{ - Log.err("Failed to load mod file {0}. Skipping.", file); + Log.err("Failed to load mod file @. Skipping.", file); Log.err(e); } } @@ -267,7 +267,7 @@ public class Mods implements Loadable{ mods.add(mod); mod.addSteamID(file.name()); }catch(Throwable e){ - Log.err("Failed to load mod workshop file {0}. Skipping.", file); + Log.err("Failed to load mod workshop file @. Skipping.", file); Log.err(e); } } @@ -481,13 +481,13 @@ public class Mods implements Loadable{ scripts.run(mod, main); }catch(Throwable e){ Core.app.post(() -> { - Log.err("Error loading main script {0} for mod {1}.", main.name(), mod.meta.name); + Log.err("Error loading main script @ for mod @.", main.name(), mod.meta.name); e.printStackTrace(); }); } }else{ Core.app.post(() -> { - Log.err("No main.js found for mod {0}.", mod.meta.name); + Log.err("No main.js found for mod @.", mod.meta.name); }); } } @@ -496,7 +496,7 @@ public class Mods implements Loadable{ content.setCurrentMod(null); } - Log.debug("Time to initialize modded scripts: {0}", Time.elapsed()); + Log.debug("Time to initialize modded scripts: @", Time.elapsed()); } /** Creates all the content found in mod files. */ @@ -544,7 +544,7 @@ public class Mods implements Loadable{ try{ //this binds the content but does not load it entirely Content loaded = parser.parse(l.mod, l.file.nameWithoutExtension(), l.file.readString("UTF-8"), l.file, l.type); - Log.debug("[{0}] Loaded '{1}'.", l.mod.meta.name, (loaded instanceof UnlockableContent ? ((UnlockableContent)loaded).localizedName : loaded)); + Log.debug("[@] Loaded '@'.", l.mod.meta.name, (loaded instanceof UnlockableContent ? ((UnlockableContent)loaded).localizedName : loaded)); }catch(Throwable e){ if(current != content.getLastAdded() && content.getLastAdded() != null){ parser.markError(content.getLastAdded(), l.mod, l.file, e); @@ -624,7 +624,7 @@ public class Mods implements Loadable{ Fi metaf = zip.child("mod.json").exists() ? zip.child("mod.json") : zip.child("mod.hjson").exists() ? zip.child("mod.hjson") : zip.child("plugin.json"); if(!metaf.exists()){ - Log.warn("Mod {0} doesn't have a 'mod.json'/'mod.hjson'/'plugin.json' file, skipping.", sourceFile); + Log.warn("Mod @ doesn't have a 'mod.json'/'mod.hjson'/'plugin.json' file, skipping.", sourceFile); throw new IllegalArgumentException("No mod.json found."); } diff --git a/core/src/mindustry/mod/Scripts.java b/core/src/mindustry/mod/Scripts.java index af474da6a0..da714ec3f5 100644 --- a/core/src/mindustry/mod/Scripts.java +++ b/core/src/mindustry/mod/Scripts.java @@ -41,7 +41,7 @@ public class Scripts implements Disposable{ if(!run(Core.files.internal("scripts/global.js").readString(), "global.js")){ errored = true; } - Log.debug("Time to load script engine: {0}", Time.elapsed()); + Log.debug("Time to load script engine: @", Time.elapsed()); } public boolean hasErrored(){ @@ -73,7 +73,7 @@ public class Scripts implements Disposable{ } public void log(LogLevel level, String source, String message){ - Log.log(level, "[{0}]: {1}", source, message); + Log.log(level, "[@]: @", source, message); } public void run(LoadedMod mod, Fi file){ diff --git a/core/src/mindustry/net/ArcNetProvider.java b/core/src/mindustry/net/ArcNetProvider.java index 0d458621b0..67a106f9d7 100644 --- a/core/src/mindustry/net/ArcNetProvider.java +++ b/core/src/mindustry/net/ArcNetProvider.java @@ -85,7 +85,7 @@ public class ArcNetProvider implements NetProvider{ Connect c = new Connect(); c.addressTCP = ip; - Log.debug("&bRecieved connection: {0}", c.addressTCP); + Log.debug("&bRecieved connection: @", c.addressTCP); connections.add(kn); Core.app.post(() -> net.handleServerReceived(kn, c)); diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index 39c80e2370..1a13bc815a 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -113,7 +113,7 @@ public class BeControl{ dialog.show(); }, () -> checkUpdates = false); }else{ - Log.info("&lcA new update is available: &lyBleeding Edge build {0}", updateBuild); + Log.info("&lcA new update is available: &lyBleeding Edge build @", updateBuild); if(Config.autoUpdate.bool()){ Log.info("&lcAuto-downloading next version..."); @@ -123,7 +123,7 @@ public class BeControl{ Fi dest = source.sibling("server-be-" + updateBuild + ".jar"); download(updateUrl, dest, - len -> Core.app.post(() -> Log.info("&ly| Size: {0} MB.", Strings.fixed((float)len / 1024 / 1024, 2))), + len -> Core.app.post(() -> Log.info("&ly| Size: @ MB.", Strings.fixed((float)len / 1024 / 1024, 2))), progress -> {}, () -> false, () -> Core.app.post(() -> { diff --git a/core/src/mindustry/net/Net.java b/core/src/mindustry/net/Net.java index 84d5a7b2d1..00ff718b5f 100644 --- a/core/src/mindustry/net/Net.java +++ b/core/src/mindustry/net/Net.java @@ -252,7 +252,7 @@ public class Net{ Pools.free(object); } }else{ - Log.err("Unhandled packet type: '{0}'!", object); + Log.err("Unhandled packet type: '@'!", object); } } @@ -266,7 +266,7 @@ public class Net{ serverListeners.get(object.getClass()).get(connection, object); Pools.free(object); }else{ - Log.err("Unhandled packet type: '{0}'!", object.getClass()); + Log.err("Unhandled packet type: '@'!", object.getClass()); } } diff --git a/core/src/mindustry/net/NetConnection.java b/core/src/mindustry/net/NetConnection.java index 36555b4ac7..cd18e558ee 100644 --- a/core/src/mindustry/net/NetConnection.java +++ b/core/src/mindustry/net/NetConnection.java @@ -35,7 +35,7 @@ public abstract class NetConnection{ /** Kick with a special, localized reason. Use this if possible. */ public void kick(KickReason reason){ - Log.info("Kicking connection {0}; Reason: {1}", address, reason.name()); + Log.info("Kicking connection @; Reason: @", address, reason.name()); if((reason == KickReason.kick || reason == KickReason.banned || reason == KickReason.vote)){ PlayerInfo info = netServer.admins.getInfo(uuid); @@ -57,7 +57,7 @@ public abstract class NetConnection{ /** Kick with an arbitrary reason, and a kick duration in milliseconds. */ public void kick(String reason, int kickDuration){ - Log.info("Kicking connection {0}; Reason: {1}", address, reason.replace("\n", " ")); + Log.info("Kicking connection @; Reason: @", address, reason.replace("\n", " ")); PlayerInfo info = netServer.admins.getInfo(uuid); info.timesKicked++; diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 899b6a4a7d..c61fb4ebcb 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -433,7 +433,7 @@ public class JoinDialog extends FloatingDialog{ try{ defaultServers.clear(); val.asArray().each(child -> defaultServers.add(child.getString("address", ""))); - Log.info("Fetched {0} global servers.", defaultServers.size); + Log.info("Fetched @ global servers.", defaultServers.size); }catch(Throwable ignored){} }); }catch(Throwable ignored){} diff --git a/core/src/mindustry/ui/dialogs/LanguageDialog.java b/core/src/mindustry/ui/dialogs/LanguageDialog.java index 849c25d2ee..801b14443d 100644 --- a/core/src/mindustry/ui/dialogs/LanguageDialog.java +++ b/core/src/mindustry/ui/dialogs/LanguageDialog.java @@ -40,7 +40,7 @@ public class LanguageDialog extends FloatingDialog{ if(getLocale().equals(loc)) return; Core.settings.put("locale", loc.toString()); Core.settings.save(); - Log.info("Setting locale: {0}", loc.toString()); + Log.info("Setting locale: @", loc.toString()); ui.showInfo("$language.restart"); }); langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 50f).row(); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index dba79cb9c9..4e2c23972d 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -291,7 +291,7 @@ public class Block extends UnlockableContent{ } public void setStats(){ - stats.add(BlockStat.size, "{0}x{0}", size); + stats.add(BlockStat.size, "@x@", size, size); stats.add(BlockStat.health, health, StatUnit.none); if(isBuildable()){ stats.add(BlockStat.buildTime, buildCost / 60, StatUnit.seconds); diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index 03f6b497c3..6e3f50a59a 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -150,7 +150,7 @@ public class DesktopLauncher extends ClientLauncher{ long id = Long.parseLong(args[1]); ui.join.connect("steam:" + id, port); }catch(Exception e){ - Log.err("Failed to parse steam lobby ID: {0}", e.getMessage()); + Log.err("Failed to parse steam lobby ID: @", e.getMessage()); e.printStackTrace(); } } diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index 1b3170280c..00ba48b970 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -67,7 +67,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, Connect c = new Connect(); c.addressTCP = "steam:" + from.getAccountID(); - Log.info("&bRecieved STEAM connection: {0}", c.addressTCP); + Log.info("&bRecieved STEAM connection: @", c.addressTCP); steamConnections.put(from.getAccountID(), con); connections.add(con); @@ -173,7 +173,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, provider.hostServer(port); smat.createLobby(Core.settings.getBool("publichost") ? LobbyType.Public : LobbyType.FriendsOnly, Core.settings.getInt("playerlimit")); - Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> Log.info("Server: {0}\nClient: {1}\nActive: {2}", net.server(), net.client(), net.active())))); + Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> Log.info("Server: @\nClient: @\nActive: @", net.server(), net.client(), net.active())))); } public void updateLobby(){ @@ -226,12 +226,12 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onLobbyInvite(SteamID steamIDUser, SteamID steamIDLobby, long gameID){ - Log.info("onLobbyInvite {0} {1} {2}", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID); + Log.info("onLobbyInvite @ @ @", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID); } @Override public void onLobbyEnter(SteamID steamIDLobby, int chatPermissions, boolean blocked, ChatRoomEnterResponse response){ - Log.info("enter lobby {0} {1}", steamIDLobby.getAccountID(), response); + Log.info("enter lobby @ @", steamIDLobby.getAccountID(), response); if(response != ChatRoomEnterResponse.Success){ ui.loadfrag.hide(); @@ -245,7 +245,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, currentLobby = steamIDLobby; currentServer = smat.getLobbyOwner(steamIDLobby); - Log.info("Connect to owner {0}: {1}", currentServer.getAccountID(), friends.getFriendPersonaName(currentServer)); + Log.info("Connect to owner @: @", currentServer.getAccountID(), friends.getFriendPersonaName(currentServer)); if(joinCallback != null){ joinCallback.run(); @@ -258,7 +258,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, net.setClientConnected(); net.handleClientReceived(con); - Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> Log.info("Server: {0}\nClient: {1}\nActive: {2}", net.server(), net.client(), net.active())))); + Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> Log.info("Server: @\nClient: @\nActive: @", net.server(), net.client(), net.active())))); } @Override @@ -268,7 +268,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onLobbyChatUpdate(SteamID lobby, SteamID who, SteamID changer, ChatMemberStateChange change){ - Log.info("lobby {0}: {1} caused {2}'s change: {3}", lobby.getAccountID(), who.getAccountID(), changer.getAccountID(), change); + Log.info("lobby @: @ caused @'s change: @", lobby.getAccountID(), who.getAccountID(), changer.getAccountID(), change); if(change == ChatMemberStateChange.Disconnected || change == ChatMemberStateChange.Left){ if(net.client()){ //host left, leave as well @@ -295,7 +295,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onLobbyMatchList(int matches){ - Log.info("found {0} matches {1}", matches, lobbyDoneCallback); + Log.info("found @ matches @", matches, lobbyDoneCallback); if(lobbyDoneCallback != null){ Array hosts = new Array<>(); @@ -329,17 +329,17 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onLobbyKicked(SteamID steamID, SteamID steamID1, boolean b){ - Log.info("Kicked: {0} {1} {2}", steamID, steamID1, b); + Log.info("Kicked: @ @ @", steamID, steamID1, b); } @Override public void onLobbyCreated(SteamResult result, SteamID steamID){ if(!net.server()){ - Log.info("Lobby created on server: {0}, ignoring.", steamID); + Log.info("Lobby created on server: @, ignoring.", steamID); return; } - Log.info("Lobby {1} created? {0}", result, steamID.getAccountID()); + Log.info("Lobby @ created? @", result, steamID.getAccountID()); if(result == SteamResult.OK){ currentLobby = steamID; @@ -367,17 +367,17 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onP2PSessionConnectFail(SteamID steamIDRemote, P2PSessionError sessionError){ if(net.server()){ - Log.info("{0} has disconnected: {1}", steamIDRemote.getAccountID(), sessionError); + Log.info("@ has disconnected: @", steamIDRemote.getAccountID(), sessionError); disconnectSteamUser(steamIDRemote); }else if(steamIDRemote.equals(currentServer)){ - Log.info("Disconnected! {1}: {0}", steamIDRemote.getAccountID(), sessionError); + Log.info("Disconnected! @: @", steamIDRemote.getAccountID(), sessionError); net.handleClientReceived(new Disconnect()); } } @Override public void onP2PSessionRequest(SteamID steamIDRemote){ - Log.info("Connection request: {0}", steamIDRemote.getAccountID()); + Log.info("Connection request: @", steamIDRemote.getAccountID()); if(net.server()){ Log.info("Am server, accepting request from " + steamIDRemote.getAccountID()); snet.acceptP2PSessionWithUser(steamIDRemote); @@ -401,7 +401,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onGameLobbyJoinRequested(SteamID lobby, SteamID steamIDFriend){ - Log.info("onGameLobbyJoinRequested {0} {1}", lobby, steamIDFriend); + Log.info("onGameLobbyJoinRequested @ @", lobby, steamIDFriend); smat.joinLobby(lobby); } @@ -417,7 +417,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onGameRichPresenceJoinRequested(SteamID steamID, String connect){ - Log.info("onGameRichPresenceJoinRequested {0} {1}", steamID, connect); + Log.info("onGameRichPresenceJoinRequested @ @", steamID, connect); } @Override @@ -432,7 +432,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, public SteamConnection(SteamID sid){ super(sid.getAccountID() + ""); this.sid = sid; - Log.info("Create STEAM client {0}", sid.getAccountID()); + Log.info("Create STEAM client @", sid.getAccountID()); } @Override diff --git a/desktop/src/mindustry/desktop/steam/SStats.java b/desktop/src/mindustry/desktop/steam/SStats.java index a36678f913..fdf22986cc 100644 --- a/desktop/src/mindustry/desktop/steam/SStats.java +++ b/desktop/src/mindustry/desktop/steam/SStats.java @@ -283,7 +283,7 @@ public class SStats implements SteamUserStatsCallback{ registerEvents(); if(result != SteamResult.OK){ - Log.err("Failed to recieve steam stats: {0}", result); + Log.err("Failed to recieve steam stats: @", result); }else{ Log.info("Recieved steam stats."); } @@ -291,7 +291,7 @@ public class SStats implements SteamUserStatsCallback{ @Override public void onUserStatsStored(long gameID, SteamResult result){ - Log.info("Stored stats: {0}", result); + Log.info("Stored stats: @", result); if(result == SteamResult.OK){ updated = true; diff --git a/desktop/src/mindustry/desktop/steam/SWorkshop.java b/desktop/src/mindustry/desktop/steam/SWorkshop.java index ddfd2f8b88..898e4ca1cc 100644 --- a/desktop/src/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/mindustry/desktop/steam/SWorkshop.java @@ -46,7 +46,7 @@ public class SWorkshop implements SteamUGCCallback{ } workshopFiles.each((type, list) -> { - Log.info("Fetched content ({0}): {1}", type.getSimpleName(), list.size); + Log.info("Fetched content (@): @", type.getSimpleName(), list.size); }); } @@ -150,7 +150,7 @@ public class SWorkshop implements SteamUGCCallback{ } void update(Publishable p, SteamPublishedFileID id, String changelog){ - Log.info("Calling update({0}) {1}", p.steamTitle(), id.handle()); + Log.info("Calling update(@) @", p.steamTitle(), id.handle()); String sid = id.handle() + ""; updateItem(id, h -> { @@ -204,7 +204,7 @@ public class SWorkshop implements SteamUGCCallback{ void updateItem(SteamPublishedFileID publishedFileID, Cons tagger, Runnable updated){ try{ SteamUGCUpdateHandle h = ugc.startItemUpdate(SVars.steamID, publishedFileID); - Log.info("begin updateItem({0})", publishedFileID.handle()); + Log.info("begin updateItem(@)", publishedFileID.handle()); tagger.get(h); Log.info("Tagged."); @@ -240,7 +240,7 @@ public class SWorkshop implements SteamUGCCallback{ if(detailHandlers.containsKey(query)){ Log.info("Query being handled..."); if(numResultsReturned > 0){ - Log.info("{0} q results", numResultsReturned); + Log.info("@ q results", numResultsReturned); Array details = new Array<>(); for(int i = 0; i < numResultsReturned; i++){ details.add(new SteamUGCDetails()); @@ -262,7 +262,7 @@ public class SWorkshop implements SteamUGCCallback{ public void onSubscribeItem(SteamPublishedFileID publishedFileID, SteamResult result){ ItemInstallInfo info = new ItemInstallInfo(); ugc.getItemInstallInfo(publishedFileID, info); - Log.info("Item subscribed from {0}", info.getFolder()); + Log.info("Item subscribed from @", info.getFolder()); SAchievement.downloadMapWorkshop.complete(); } @@ -270,7 +270,7 @@ public class SWorkshop implements SteamUGCCallback{ public void onUnsubscribeItem(SteamPublishedFileID publishedFileID, SteamResult result){ ItemInstallInfo info = new ItemInstallInfo(); ugc.getItemInstallInfo(publishedFileID, info); - Log.info("Item unsubscribed from {0}", info.getFolder()); + Log.info("Item unsubscribed from @", info.getFolder()); } @Override @@ -293,7 +293,7 @@ public class SWorkshop implements SteamUGCCallback{ @Override public void onSubmitItemUpdate(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result){ ui.loadfrag.hide(); - Log.info("onsubmititemupdate {0} {1} {2}", publishedFileID.handle(), needsToAcceptWLA, result); + Log.info("onsubmititemupdate @ @ @", publishedFileID.handle(), needsToAcceptWLA, result); if(result == SteamResult.OK){ //redirect user to page for further updates SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + publishedFileID.handle()); @@ -314,7 +314,7 @@ public class SWorkshop implements SteamUGCCallback{ SAchievement.downloadMapWorkshop.complete(); ItemInstallInfo info = new ItemInstallInfo(); ugc.getItemInstallInfo(publishedFileID, info); - Log.info("Item downloaded to {0}", info.getFolder()); + Log.info("Item downloaded to @", info.getFolder()); } @Override @@ -351,6 +351,6 @@ public class SWorkshop implements SteamUGCCallback{ public void onDeleteItem(SteamPublishedFileID publishedFileID, SteamResult result){ ItemInstallInfo info = new ItemInstallInfo(); ugc.getItemInstallInfo(publishedFileID, info); - Log.info("Item removed from {0}", info.getFolder()); + Log.info("Item removed from @", info.getFolder()); } } diff --git a/ios/src/mindustry/ios/IOSLauncher.java b/ios/src/mindustry/ios/IOSLauncher.java index 80bbc73b1e..4b43b1c305 100644 --- a/ios/src/mindustry/ios/IOSLauncher.java +++ b/ios/src/mindustry/ios/IOSLauncher.java @@ -154,7 +154,7 @@ public class IOSLauncher extends IOSApplication.Delegate{ pop.setSourceRect(targetRect); pop.setPermittedArrowDirections(UIPopoverArrowDirection.None); } - rootVc.presentViewController(p, true, () -> Log.info("Success! Presented {0}", to)); + rootVc.presentViewController(p, true, () -> Log.info("Success! Presented @", to)); }catch(Throwable t){ ui.showException(t); } diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 3ecec9562c..82683a25ee 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -75,7 +75,7 @@ public class ServerControl implements ApplicationListener{ try{ socketOutput.println(formatColors(text + "&fr", false)); }catch(Throwable e){ - err("Error occurred logging to socket: {0}", e.getClass().getSimpleName()); + err("Error occurred logging to socket: @", e.getClass().getSimpleName()); } } }); @@ -89,19 +89,19 @@ public class ServerControl implements ApplicationListener{ if(args.length > 0){ commands.addAll(Strings.join(" ", args).split(",")); - info("&lmFound {0} command-line arguments to parse.", commands.size); + info("&lmFound @ command-line arguments to parse.", commands.size); } if(!Config.startCommands.string().isEmpty()){ String[] startup = Strings.join(" ", Config.startCommands.string()).split(","); - info("&lmFound {0} startup commands.", startup.length); + info("&lmFound @ startup commands.", startup.length); commands.addAll(startup); } for(String s : commands){ CommandResponse response = handler.handleMessage(s); if(response.type != ResponseType.valid){ - err("Invalid command argument sent: '{0}': {1}", s, response.type.name()); + err("Invalid command argument sent: '@': @", s, response.type.name()); err("Argument usage: &lc , "); } } @@ -128,9 +128,9 @@ public class ServerControl implements ApplicationListener{ Events.on(GameOverEvent.class, event -> { if(inExtraRound) return; if(state.rules.waves){ - info("&lcGame over! Reached wave &ly{0}&lc with &ly{1}&lc players online on map &ly{2}&lc.", state.wave, Groups.player.size(), Strings.capitalize(state.map.name())); + info("&lcGame over! Reached wave &ly@&lc with &ly@&lc players online on map &ly@&lc.", state.wave, Groups.player.size(), Strings.capitalize(state.map.name())); }else{ - info("&lcGame over! Team &ly{0}&lc is victorious with &ly{1}&lc players online on map &ly{2}&lc.", event.winner.name, Groups.player.size(), Strings.capitalize(state.map.name())); + info("&lcGame over! Team &ly@&lc is victorious with &ly@&lc players online on map &ly@&lc.", event.winner.name, Groups.player.size(), Strings.capitalize(state.map.name())); } //set next map to be played @@ -143,7 +143,7 @@ public class ServerControl implements ApplicationListener{ + (map.tags.containsKey("author") && !map.tags.get("author").trim().isEmpty() ? " by[accent] " + map.author() + "[white]" : "") + "." + "\nNew game begins in " + roundExtraTime + " seconds."); - info("Selected next map to be {0}.", map.name()); + info("Selected next map to be @.", map.name()); play(true, () -> world.loadMap(map, map.applyRules(lastMode))); }else{ @@ -168,7 +168,7 @@ public class ServerControl implements ApplicationListener{ }); if(!mods.list().isEmpty()){ - info("&lc{0} mods loaded.", mods.list().size); + info("&lc@ mods loaded.", mods.list().size); } toggleSocket(Config.socketInput.bool()); @@ -185,8 +185,8 @@ public class ServerControl implements ApplicationListener{ }); handler.register("version", "Displays server version info.", arg -> { - info("&lmVersion: &lyMindustry {0}-{1} {2} / build {3}", Version.number, Version.modifier, Version.type, Version.build + (Version.revision == 0 ? "" : "." + Version.revision)); - info("&lmJava Version: &ly{0}", System.getProperty("java.version")); + info("&lmVersion: &lyMindustry @-@ @ / build @", Version.number, Version.modifier, Version.type, Version.build + (Version.revision == 0 ? "" : "." + Version.revision)); + info("&lmJava Version: &ly@", System.getProperty("java.version")); }); handler.register("exit", "Exit the server application.", arg -> { @@ -215,12 +215,12 @@ public class ServerControl implements ApplicationListener{ result = maps.all().find(map -> map.name().equalsIgnoreCase(arg[0].replace('_', ' ')) || map.name().equalsIgnoreCase(arg[0])); if(result == null){ - err("No map with name &y'{0}'&lr found.", arg[0]); + err("No map with name &y'@'&lr found.", arg[0]); return; } }else{ result = maps.getShuffleMode().next(state.map); - info("Randomized next map to be {0}.", result.name()); + info("Randomized next map to be @.", result.name()); } Gamemode preset = Gamemode.survival; @@ -229,7 +229,7 @@ public class ServerControl implements ApplicationListener{ try{ preset = Gamemode.valueOf(arg[1]); }catch(IllegalArgumentException e){ - err("No gamemode '{0}' found.", arg[1]); + err("No gamemode '@' found.", arg[1]); return; } } @@ -255,19 +255,19 @@ public class ServerControl implements ApplicationListener{ if(!maps.all().isEmpty()){ info("Maps:"); for(Map map : maps.all()){ - info(" &ly{0}: &lb&fi{1} / {2}x{3}", map.name(), map.custom ? "Custom" : "Default", map.width, map.height); + info(" &ly@: &lb&fi@ / @x@", map.name(), map.custom ? "Custom" : "Default", map.width, map.height); } }else{ info("No maps found."); } - info("&lyMap directory: &lb&fi{0}", customMapDirectory.file().getAbsoluteFile().toString()); + info("&lyMap directory: &lb&fi@", customMapDirectory.file().getAbsoluteFile().toString()); }); handler.register("reloadmaps", "Reload all maps from disk.", arg -> { int beforeMaps = maps.all().size; maps.reload(); if(maps.all().size > beforeMaps){ - info("&lc{0}&ly new map(s) found and reloaded.", maps.all().size - beforeMaps); + info("&lc@&ly new map(s) found and reloaded.", maps.all().size - beforeMaps); }else{ info("&lyMaps reloaded."); } @@ -278,20 +278,20 @@ public class ServerControl implements ApplicationListener{ info("Status: &rserver closed"); }else{ info("Status:"); - info(" &lyPlaying on map &fi{0}&fb &lb/&ly Wave {1}", Strings.capitalize(state.map.name()), state.wave); + info(" &lyPlaying on map &fi@&fb &lb/&ly Wave @", Strings.capitalize(state.map.name()), state.wave); if(state.rules.waves){ - info("&ly {0} enemies.", state.enemies); + info("&ly @ enemies.", state.enemies); }else{ - info("&ly {0} seconds until next wave.", (int)(state.wavetime / 60)); + info("&ly @ seconds until next wave.", (int)(state.wavetime / 60)); } - info(" &ly{0} FPS, {1} MB used.", Core.graphics.getFramesPerSecond(), Core.app.getJavaHeap() / 1024 / 1024); + info(" &ly@ FPS, @ MB used.", Core.graphics.getFramesPerSecond(), Core.app.getJavaHeap() / 1024 / 1024); if(Groups.player.size() > 0){ - info(" &lyPlayers: {0}", Groups.player.size()); + info(" &lyPlayers: @", Groups.player.size()); for(Playerc p : Groups.player){ - info(" &y{0} / {1}", p.name(), p.uuid()); + info(" &y@ / @", p.name(), p.uuid()); } }else{ info(" &lyNo players connected."); @@ -303,25 +303,25 @@ public class ServerControl implements ApplicationListener{ if(!mods.list().isEmpty()){ info("Mods:"); for(LoadedMod mod : mods.list()){ - info(" &ly{0} &lcv{1}", mod.meta.displayName(), mod.meta.version); + info(" &ly@ &lcv@", mod.meta.displayName(), mod.meta.version); } }else{ info("No mods found."); } - info("&lyMod directory: &lb&fi{0}", modDirectory.file().getAbsoluteFile().toString()); + info("&lyMod directory: &lb&fi@", modDirectory.file().getAbsoluteFile().toString()); }); handler.register("mod", "", "Display information about a loaded plugin.", arg -> { LoadedMod mod = mods.list().find(p -> p.meta.name.equalsIgnoreCase(arg[0])); if(mod != null){ - info("Name: &ly{0}", mod.meta.displayName()); - info("Internal Name: &ly{0}", mod.name); - info("Version: &ly{0}", mod.meta.version); - info("Author: &ly{0}", mod.meta.author); - info("Path: &ly{0}", mod.file.path()); - info("Description: &ly{0}", mod.meta.description); + info("Name: &ly@", mod.meta.displayName()); + info("Internal Name: &ly@", mod.name); + info("Version: &ly@", mod.meta.version); + info("Author: &ly@", mod.meta.author); + info("Path: &ly@", mod.file.path()); + info("Description: &ly@", mod.meta.description); }else{ - info("No mod with name &ly'{0}'&lg found."); + info("No mod with name &ly'@'&lg found."); } }); @@ -337,7 +337,7 @@ public class ServerControl implements ApplicationListener{ Call.sendMessage("[scarlet][[Server]:[] " + arg[0]); - info("&lyServer: &lb{0}", arg[0]); + info("&lyServer: &lb@", arg[0]); }); handler.register("rules", "[remove/add] [name] [value...]", "List, remove or add global rules. These will apply regardless of map.", arg -> { @@ -345,7 +345,7 @@ public class ServerControl implements ApplicationListener{ JsonValue base = JsonIO.json().fromJson(null, rules); if(arg.length == 0){ - Log.info("&lyRules:\n{0}", JsonIO.print(rules)); + Log.info("&lyRules:\n@", JsonIO.print(rules)); }else if(arg.length == 1){ Log.err("Invalid usage. Specify which rule to remove or add."); }else{ @@ -357,7 +357,7 @@ public class ServerControl implements ApplicationListener{ boolean remove = arg[0].equals("remove"); if(remove){ if(base.has(arg[1])){ - Log.info("Rule &lc'{0}'&lg removed.", arg[1]); + Log.info("Rule &lc'@'&lg removed.", arg[1]); base.remove(arg[1]); }else{ Log.err("Rule not defined, so not removed."); @@ -381,9 +381,9 @@ public class ServerControl implements ApplicationListener{ base.remove(value.name); } base.addChild(arg[1], value); - Log.info("Changed rule: &ly{0}", value.toString().replace("\n", " ")); + Log.info("Changed rule: &ly@", value.toString().replace("\n", " ")); }catch(Throwable e){ - Log.err("Error parsing rule JSON: {0}", e.getMessage()); + Log.err("Error parsing rule JSON: @", e.getMessage()); } } @@ -422,7 +422,7 @@ public class ServerControl implements ApplicationListener{ handler.register("playerlimit", "[off/somenumber]", "Set the server player limit.", arg -> { if(arg.length == 0){ - info("Player limit is currently &lc{0}.", netServer.admins.getPlayerLimit() == 0 ? "off" : netServer.admins.getPlayerLimit()); + info("Player limit is currently &lc@.", netServer.admins.getPlayerLimit() == 0 ? "off" : netServer.admins.getPlayerLimit()); return; } if(arg[0].equals("off")){ @@ -434,7 +434,7 @@ public class ServerControl implements ApplicationListener{ if(Strings.canParsePostiveInt(arg[0]) && Strings.parseInt(arg[0]) > 0){ int lim = Strings.parseInt(arg[0]); netServer.admins.setPlayerLimit(lim); - info("Player limit is now &lc{0}.", lim); + info("Player limit is now &lc@.", lim); }else{ err("Limit must be a number above 0."); } @@ -444,8 +444,8 @@ public class ServerControl implements ApplicationListener{ if(arg.length == 0){ info("&lyAll config values:"); for(Config c : Config.all){ - Log.info("&ly| &lc{0}:&lm {1}", c.name(), c.get()); - Log.info("&ly| | {0}", c.description); + Log.info("&ly| &lc@:&lm @", c.name(), c.get()); + Log.info("&ly| | @", c.description); Log.info("&ly|"); } return; @@ -454,7 +454,7 @@ public class ServerControl implements ApplicationListener{ try{ Config c = Config.valueOf(arg[0]); if(arg.length == 1){ - Log.info("&lc'{0}'&lg is currently &lc{1}.", c.name(), c.get()); + Log.info("&lc'@'&lg is currently &lc@.", c.name(), c.get()); }else{ if(c.isBool()){ c.set(arg[1].equals("on") || arg[1].equals("true")); @@ -462,23 +462,23 @@ public class ServerControl implements ApplicationListener{ try{ c.set(Integer.parseInt(arg[1])); }catch(NumberFormatException e){ - Log.err("Not a valid number: {0}", arg[1]); + Log.err("Not a valid number: @", arg[1]); return; } }else if(c.isString()){ c.set(arg[1]); } - Log.info("&lc{0}&lg set to &lc{1}.", c.name(), c.get()); + Log.info("&lc@&lg set to &lc@.", c.name(), c.get()); } }catch(IllegalArgumentException e){ - err("Unknown config: '{0}'. Run the command with no arguments to get a list of valid configs.", arg[0]); + err("Unknown config: '@'. Run the command with no arguments to get a list of valid configs.", arg[0]); } }); handler.register("subnet-ban", "[add/remove] [address]", "Ban a subnet. This simply rejects all connections with IPs starting with some string.", arg -> { if(arg.length == 0){ - Log.info("Subnets banned: &lc{0}", netServer.admins.getSubnetBans().isEmpty() ? "" : ""); + Log.info("Subnets banned: &lc@", netServer.admins.getSubnetBans().isEmpty() ? "" : ""); for(String subnet : netServer.admins.getSubnetBans()){ Log.info("&ly " + subnet + ""); } @@ -492,7 +492,7 @@ public class ServerControl implements ApplicationListener{ } netServer.admins.addSubnetBan(arg[1]); - Log.info("Banned &ly{0}&lc**", arg[1]); + Log.info("Banned &ly@&lc**", arg[1]); }else if(arg[0].equals("remove")){ if(!netServer.admins.getSubnetBans().contains(arg[1])){ err("That subnet isn't banned."); @@ -500,7 +500,7 @@ public class ServerControl implements ApplicationListener{ } netServer.admins.removeSubnetBan(arg[1]); - Log.info("Unbanned &ly{0}&lc**", arg[1]); + Log.info("Unbanned &ly@&lc**", arg[1]); }else{ err("Incorrect usage. You must provide add/remove as the second argument."); } @@ -514,7 +514,7 @@ public class ServerControl implements ApplicationListener{ } info("&lyWhitelist:"); - netServer.admins.getWhitelisted().each(p -> Log.info("- &ly{0}", p.lastName)); + netServer.admins.getWhitelisted().each(p -> Log.info("- &ly@", p.lastName)); }); handler.register("whitelist-add", "", "Add a player to the whitelist by ID.", arg -> { @@ -525,7 +525,7 @@ public class ServerControl implements ApplicationListener{ } netServer.admins.whitelist(arg[0]); - info("Player &ly'{0}'&lg has been whitelisted.", info.lastName); + info("Player &ly'@'&lg has been whitelisted.", info.lastName); }); handler.register("whitelist-remove", "", "Remove a player to the whitelist by ID.", arg -> { @@ -536,18 +536,18 @@ public class ServerControl implements ApplicationListener{ } netServer.admins.unwhitelist(arg[0]); - info("Player &ly'{0}'&lg has been un-whitelisted.", info.lastName); + info("Player &ly'@'&lg has been un-whitelisted.", info.lastName); }); handler.register("shuffle", "[none/all/custom/builtin]", "Set map shuffling mode.", arg -> { if(arg.length == 0){ - info("Shuffle mode current set to &ly'{0}'&lg.", maps.getShuffleMode()); + info("Shuffle mode current set to &ly'@'&lg.", maps.getShuffleMode()); }else{ try{ ShuffleMode mode = ShuffleMode.valueOf(arg[0]); Core.settings.putSave("shufflemode", mode.name()); maps.setShuffleMode(mode); - info("Shuffle mode set to &ly'{0}'&lg.", arg[0]); + info("Shuffle mode set to &ly'@'&lg.", arg[0]); }catch(Exception e){ err("Invalid shuffle mode."); } @@ -558,9 +558,9 @@ public class ServerControl implements ApplicationListener{ Map res = maps.all().find(map -> map.name().equalsIgnoreCase(arg[0].replace('_', ' ')) || map.name().equalsIgnoreCase(arg[0])); if(res != null){ nextMapOverride = res; - Log.info("Next map set to &ly'{0}'.", res.name()); + Log.info("Next map set to &ly'@'.", res.name()); }else{ - Log.err("No map '{0}' found.", arg[0]); + Log.err("No map '@' found.", arg[0]); } }); @@ -616,7 +616,7 @@ public class ServerControl implements ApplicationListener{ }else{ info("&lyBanned players [ID]:"); for(PlayerInfo info : bans){ - info(" &ly {0} / Last known name: '{1}'", info.id, info.lastName); + info(" &ly @ / Last known name: '@'", info.id, info.lastName); } } @@ -629,9 +629,9 @@ public class ServerControl implements ApplicationListener{ for(String string : ipbans){ PlayerInfo info = netServer.admins.findByIP(string); if(info != null){ - info(" &lm '{0}' / Last known name: '{1}' / ID: '{2}'", string, info.lastName, info.id); + info(" &lm '@' / Last known name: '@' / ID: '@'", string, info.lastName, info.id); }else{ - info(" &lm '{0}' (No known name or info)", string); + info(" &lm '@' (No known name or info)", string); } } } @@ -650,7 +650,7 @@ public class ServerControl implements ApplicationListener{ if(info != null){ info.lastKicked = 0; - info("Pardoned player: {0}", info.lastName); + info("Pardoned player: @", info.lastName); }else{ err("That ID can't be found."); } @@ -685,7 +685,7 @@ public class ServerControl implements ApplicationListener{ netServer.admins.unAdminPlayer(target.id); } if(playert != null) playert.admin(add); - info("Changed admin status of player: &ly{0}", target.lastName); + info("Changed admin status of player: &ly@", target.lastName); }else{ err("Nobody with that name or ID could be found. If adding an admin by name, make sure they're online; otherwise, use their UUID."); } @@ -699,7 +699,7 @@ public class ServerControl implements ApplicationListener{ }else{ info("&lyAdmins:"); for(PlayerInfo info : admins){ - info(" &lm {0} / ID: '{1}' / IP: '{2}'", info.lastName, info.id, info.lastIP); + info(" &lm @ / ID: '@' / IP: '@'", info.lastName, info.id, info.lastIP); } } }); @@ -708,10 +708,10 @@ public class ServerControl implements ApplicationListener{ if(Groups.player.size() == 0){ info("No players are currently in the server."); }else{ - info("&lyPlayers: {0}", Groups.player.size()); + info("&lyPlayers: @", Groups.player.size()); for(Playerc user : Groups.player){ PlayerInfo userInfo = user.getInfo(); - info(" &lm {0} / ID: '{1}' / IP: '{2}' / Admin: '{3}'", userInfo.lastName, userInfo.id, userInfo.lastIP, userInfo.admin); + info(" &lm @ / ID: '@' / IP: '@' / Admin: '@'", userInfo.lastName, userInfo.id, userInfo.lastIP, userInfo.admin); } } }); @@ -761,7 +761,7 @@ public class ServerControl implements ApplicationListener{ Core.app.post(() -> { SaveIO.save(file); - info("Saved to {0}.", file); + info("Saved to @.", file); }); }); @@ -769,7 +769,7 @@ public class ServerControl implements ApplicationListener{ info("Save files: "); for(Fi file : saveDirectory.list()){ if(file.extension().equals(saveExtension)){ - info("| &ly{0}", file.nameWithoutExtension()); + info("| &ly@", file.nameWithoutExtension()); } } }); @@ -790,16 +790,16 @@ public class ServerControl implements ApplicationListener{ ObjectSet infos = netServer.admins.findByName(arg[0]); if(infos.size > 0){ - info("&lgPlayers found: {0}", infos.size); + info("&lgPlayers found: @", infos.size); int i = 0; for(PlayerInfo info : infos){ - info("&lc[{0}] Trace info for player '{1}' / UUID {2}", i++, info.lastName, info.id); - info(" &lyall names used: {0}", info.names); - info(" &lyIP: {0}", info.lastIP); - info(" &lyall IPs used: {0}", info.ips); - info(" &lytimes joined: {0}", info.timesJoined); - info(" &lytimes kicked: {0}", info.timesKicked); + info("&lc[@] Trace info for player '@' / UUID @", i++, info.lastName, info.id); + info(" &lyall names used: @", info.names); + info(" &lyIP: @", info.lastIP); + info(" &lyall IPs used: @", info.ips); + info(" &lytimes joined: @", info.timesJoined); + info(" &lytimes kicked: @", info.timesKicked); } }else{ info("Nobody with that name could be found."); @@ -811,11 +811,11 @@ public class ServerControl implements ApplicationListener{ ObjectSet infos = netServer.admins.searchNames(arg[0]); if(infos.size > 0){ - info("&lgPlayers found: {0}", infos.size); + info("&lgPlayers found: @", infos.size); int i = 0; for(PlayerInfo info : infos){ - info("- &lc[{0}] &ly'{1}'&lc / &lm{2}", i++, info.lastName, info.id); + info("- &lc[@] &ly'@'&lc / &lm@", i++, info.lastName, info.id); } }else{ info("Nobody with that name could be found."); @@ -826,7 +826,7 @@ public class ServerControl implements ApplicationListener{ int pre = (int)(Core.app.getJavaHeap() / 1024 / 1024); System.gc(); int post = (int)(Core.app.getJavaHeap() / 1024 / 1024); - info("&ly{0}&lg MB collected. Memory usage now at &ly{1}&lg MB.", pre - post, post); + info("&ly@&lg MB collected. Memory usage now at &ly@&lg MB.", pre - post, post); }); mods.eachClass(p -> p.registerServerCommands(handler)); @@ -943,7 +943,7 @@ public class ServerControl implements ApplicationListener{ serverSocket.bind(new InetSocketAddress(Config.socketInputAddress.string(), Config.socketInputPort.num())); while(true){ Socket client = serverSocket.accept(); - info("&lmRecieved command socket connection: &lb{0}", serverSocket.getLocalSocketAddress()); + info("&lmRecieved command socket connection: &lb@", serverSocket.getLocalSocketAddress()); BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); socketOutput = new PrintWriter(client.getOutputStream(), true); String line; @@ -951,7 +951,7 @@ public class ServerControl implements ApplicationListener{ String result = line; Core.app.post(() -> handleCommandString(result)); } - info("&lmLost command socket connection: &lb{0}", serverSocket.getLocalSocketAddress()); + info("&lmLost command socket connection: &lb@", serverSocket.getLocalSocketAddress()); socketOutput = null; } }catch(BindException b){ diff --git a/server/src/mindustry/server/ServerLauncher.java b/server/src/mindustry/server/ServerLauncher.java index 25edc7224b..d1c3d24c52 100644 --- a/server/src/mindustry/server/ServerLauncher.java +++ b/server/src/mindustry/server/ServerLauncher.java @@ -64,9 +64,9 @@ public class ServerLauncher implements ApplicationListener{ Log.err("Error occurred loading mod content:"); for(LoadedMod mod : mods.list()){ if(mod.hasContentErrors()){ - Log.err("| &ly[{0}]", mod.name); + Log.err("| &ly[@]", mod.name); for(Content cont : mod.erroredContent){ - Log.err("| | &y{0}: &c{1}", cont.minfo.sourceFile.name(), Strings.getSimpleMessage(cont.minfo.baseError).replace("\n", " ")); + Log.err("| | &y@: &c@", cont.minfo.sourceFile.name(), Strings.getSimpleMessage(cont.minfo.baseError).replace("\n", " ")); } } } diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 65253ada62..1252fe9e43 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -326,7 +326,7 @@ public class ApplicationTests{ indexer.eachBlock(Team.sharded, x * tilesize, y * tilesize, range, t -> true, assigner); } - Log.info("Time for basic indexing: {0}", Time.elapsed()); + Log.info("Time for basic indexing: @", Time.elapsed()); r.setSeed(0); diff --git a/tools/src/mindustry/tools/BundleLauncher.java b/tools/src/mindustry/tools/BundleLauncher.java index ab44a77ff7..a52ea5fb31 100644 --- a/tools/src/mindustry/tools/BundleLauncher.java +++ b/tools/src/mindustry/tools/BundleLauncher.java @@ -17,7 +17,7 @@ public class BundleLauncher{ Fi.get(".").walk(child -> { if(child.name().equals("bundle.properties") || child.toString().contains("output")) return; - Log.info("Parsing bundle: {0}", child); + Log.info("Parsing bundle: @", child); OrderedMap other = new OrderedMap<>(); PropertiesUtils.load(other, child.reader(2048, "UTF-8")); @@ -26,10 +26,10 @@ public class BundleLauncher{ for(String key : other.orderedKeys()){ if(!base.containsKey(key)){ removals.add(key); - Log.info("&lr- Removing unused key '{0}'...", key); + Log.info("&lr- Removing unused key '@'...", key); } } - Log.info("&lr{0} keys removed.", removals.size); + Log.info("&lr@ keys removed.", removals.size); for(String s : removals){ other.remove(s); } @@ -40,15 +40,15 @@ public class BundleLauncher{ if(!other.containsKey(key) || other.get(key).trim().isEmpty()){ other.put(key, base.get(key)); added++; - Log.info("&lc- Adding missing key '{0}'...", key); + Log.info("&lc- Adding missing key '@'...", key); } } Func2 processor = (key, value) -> (key + " = " + value).replace("\\", "\\\\").replace("\n", "\\n") + "\n" + (newlines.contains(key) ? "\n" : ""); Fi output = child.sibling("output/" + child.name()); - Log.info("&lc{0} keys added.", added); - Log.info("Writing bundle to {0}", output); + Log.info("&lc@ keys added.", added); + Log.info("Writing bundle to @", output); StringBuilder result = new StringBuilder(); //add everything ordered diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 62724a1f98..a7c3b27196 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -165,9 +165,9 @@ public class Generators{ average.a = 1f; colors.draw(block.id, 0, average); }catch(IllegalArgumentException e){ - Log.info("Skipping &ly'{0}'", block.name); + Log.info("Skipping &ly'@'", block.name); }catch(NullPointerException e){ - Log.err("Block &ly'{0}'&lr has an null region!"); + Log.err("Block &ly'@'&lr has an null region!"); } } diff --git a/tools/src/mindustry/tools/ImagePacker.java b/tools/src/mindustry/tools/ImagePacker.java index a986f99595..38754c0935 100644 --- a/tools/src/mindustry/tools/ImagePacker.java +++ b/tools/src/mindustry/tools/ImagePacker.java @@ -96,8 +96,8 @@ public class ImagePacker{ Time.mark(); Generators.generate(); - Log.info("&ly[Generator]&lc Total time to generate: &lg{0}&lcms", Time.elapsed()); - Log.info("&ly[Generator]&lc Total images created: &lg{0}", Image.total()); + Log.info("&ly[Generator]&lc Total time to generate: &lg@&lcms", Time.elapsed()); + Log.info("&ly[Generator]&lc Total images created: &lg@", Image.total()); Image.dispose(); //format: @@ -140,7 +140,7 @@ public class ImagePacker{ static void generate(String name, Runnable run){ Time.mark(); run.run(); - Log.info("&ly[Generator]&lc Time to generate &lm{0}&lc: &lg{1}&lcms", name, Time.elapsed()); + Log.info("&ly[Generator]&lc Time to generate &lm@&lc: &lg@&lcms", name, Time.elapsed()); } static BufferedImage buf(TextureRegion region){ @@ -181,7 +181,7 @@ public class ImagePacker{ static void validate(TextureRegion region){ if(((GenRegion)region).invalid){ - ImagePacker.err("Region does not exist: {0}", ((GenRegion)region).name); + ImagePacker.err("Region does not exist: @", ((GenRegion)region).name); } } } diff --git a/tools/src/mindustry/tools/SectorDataGenerator.java b/tools/src/mindustry/tools/SectorDataGenerator.java index d76a24752c..59b6126ed6 100644 --- a/tools/src/mindustry/tools/SectorDataGenerator.java +++ b/tools/src/mindustry/tools/SectorDataGenerator.java @@ -95,12 +95,12 @@ public class SectorDataGenerator{ } if(waterFloors / totalFloors >= 0.6f){ - Log.debug("Sector {0} has {1}/{2} water -> naval", sector.id, waterFloors, totalFloors); + Log.debug("Sector @ has @/@ water -> naval", sector.id, waterFloors, totalFloors); } //naval sector guaranteed if(nearTiles > 4){ - Log.debug("Sector {0} has {1} water tiles at {2} {3} -> naval", sector.id, nearTiles, cx, cy); + Log.debug("Sector @ has @ water tiles at @ @ -> naval", sector.id, nearTiles, cx, cy); waterFloors = totalFloors; } @@ -125,7 +125,7 @@ public class SectorDataGenerator{ } if(count[0]++ % 10 == 0){ - Log.info("&lyDone with sector &lm{0}/{1}", count[0], planet.sectors.size); + Log.info("&lyDone with sector &lm@/@", count[0], planet.sectors.size); } return data;