From 8564c1e54b7dc8a674b2758351863cb278c07590 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sat, 8 Oct 2022 21:00:58 +0200 Subject: [PATCH 1/3] Add all but 3 of the missing dutch translations --- .../assets/computercraft/lang/nl_nl.json | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/computercraft/lang/nl_nl.json b/src/main/resources/assets/computercraft/lang/nl_nl.json index 40a14c9df..6bafd41c2 100644 --- a/src/main/resources/assets/computercraft/lang/nl_nl.json +++ b/src/main/resources/assets/computercraft/lang/nl_nl.json @@ -48,6 +48,7 @@ "commands.computercraft.dump.synopsis": "Geef de status van computers weer.", "commands.computercraft.dump.desc": "Geef de status van alle computers of specifieke informatie over \\u00e9\\u00e9n computer weer. Je kunt een instance-id (bijv. 123), computer-id (bijv. #123) of computer-label (bijv. \\\"@Mijn Computer\\\") opgeven.", "commands.computercraft.dump.action": "Geef meer informatie over deze computer weer", + "commands.computercraft.dump.open_path": "Toon de bestanden van deze computer", "commands.computercraft.shutdown.synopsis": "Sluit computers af op afstand.", "commands.computercraft.shutdown.desc": "Sluit alle genoemde computers af, of geen enkele wanneer niet gespecificeerd. Je kunt een instance-id (bijv. 123), computer-id (bijv. #123) of computer-label (bijv. \\\"@Mijn Computer\\\") opgeven.", "commands.computercraft.shutdown.done": "%s/%s computers afgesloten", @@ -109,5 +110,23 @@ "tracking_field.computercraft.coroutines_dead.name": "Coroutines verwijderd", "gui.computercraft.tooltip.copy": "Kopiƫren naar klembord", "gui.computercraft.tooltip.computer_id": "Computer ID: %s", - "gui.computercraft.tooltip.disk_id": "Diskette ID: %s" + "gui.computercraft.tooltip.disk_id": "Diskette ID: %s", + "gui.computercraft.tooltip.turn_on": "Zet deze computer aan", + "gui.computercraft.tooltip.turn_off": "Zet deze computer uit", + "gui.computercraft.tooltip.terminate": "Stop het huidige programma", + "gui.computercraft.upload.success": "Upload Geslaagd", + "gui.computercraft.upload.success.msg": "%d files geuploaded.", + "gui.computercraft.upload.failed": "Upload Mislukt", + "gui.computercraft.upload.failed.out_of_space": "Niet genoeg ruimte op deze computer om deze bestanden op te slaan.", + "gui.computercraft.upload.failed.computer_off": "Je moet de computer aanzetten alvorens je bestanden upload.", + "gui.computercraft.upload.failed.too_much": "Je bestanden zijn te groot om te uploaden.", + "gui.computercraft.upload.failed.name_too_long": "De namen van je bestanden zijn te lang om te uploaden.", + "gui.computercraft.upload.failed.too_many_files": "Je kan niet zoveel files tegelijk uploaden.", + "gui.computercraft.upload.failed.overwrite_dir": "De map %s kon niet worden geupload, er bestaat al een map met deze naam.", + "gui.computercraft.upload.failed.generic": "Uploaden van bestanden mislukt (%s)", + "gui.computercraft.upload.failed.corrupted": "De bestanden zijn beschadigd tijdens de upload. Probeer het opnieuw.", + "gui.computercraft.upload.overwrite": "Bestanden zullen worden overschreven.", + "gui.computercraft.upload.overwrite.detail": "De volgende bestanden zullen tijdens de upload worden overschreven. Doorgaan?%s", + "gui.computercraft.upload.overwrite_button": "Overschrijven", + "gui.computercraft.pocket_computer_overlay": "Zakcomputer open. Druk op ESC om te sluiten." } From 12b8a0393f84d464531567a7798116bd91ece0e8 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 9 Oct 2022 11:17:55 +0100 Subject: [PATCH 2/3] Dump Cobalt's internal state on timeouts Closes #1180 --- build.gradle | 2 +- .../core/computer/ComputerExecutor.java | 9 +++++++++ .../core/computer/ComputerThread.java | 12 ++++++++---- .../computercraft/core/lua/CobaltLuaMachine.java | 14 ++++++++++++++ .../dan200/computercraft/core/lua/ILuaMachine.java | 9 +++++++++ .../core/computer/FakeComputerManager.java | 5 +++++ 6 files changed, 46 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index a680abdb1..0e546ecc9 100644 --- a/build.gradle +++ b/build.gradle @@ -141,7 +141,7 @@ dependencies { extraModsCompileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-1.16.5:7.1.0.313") extraModsCompileOnly fg.deobf("commoble.morered:morered-1.16.5:2.1.1.0") - shade 'org.squiddev:Cobalt:0.5.5' + shade 'org.squiddev:Cobalt:0.5.7' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.0' diff --git a/src/main/java/dan200/computercraft/core/computer/ComputerExecutor.java b/src/main/java/dan200/computercraft/core/computer/ComputerExecutor.java index c6a3a7a34..331fa096a 100644 --- a/src/main/java/dan200/computercraft/core/computer/ComputerExecutor.java +++ b/src/main/java/dan200/computercraft/core/computer/ComputerExecutor.java @@ -625,6 +625,15 @@ final class ComputerExecutor } } + void printState( StringBuilder out ) + { + out.append( "Enqueued command: " ).append( command ).append( '\n' ); + out.append( "Enqueued events: " ).append( eventQueue.size() ).append( '\n' ); + + ILuaMachine machine = this.machine; + if( machine != null ) machine.printExecutionState( out ); + } + private void displayFailure( String message, String extra ) { Terminal terminal = computer.getTerminal(); diff --git a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java index d557fabe5..d4dedcfb2 100644 --- a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java +++ b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java @@ -575,18 +575,22 @@ public final class ComputerThread StringBuilder builder = new StringBuilder() .append( "Terminating computer #" ).append( executor.getComputer().getID() ) .append( " due to timeout (running for " ).append( time * 1e-9 ) - .append( " seconds). This is NOT a bug, but may mean a computer is misbehaving. " ) + .append( " seconds). This is NOT a bug, but may mean a computer is misbehaving.\n" ) + .append( "Thread " ) .append( owner.getName() ) .append( " is currently " ) - .append( owner.getState() ); + .append( owner.getState() ) + .append( '\n' ); Object blocking = LockSupport.getBlocker( owner ); - if( blocking != null ) builder.append( "\n on " ).append( blocking ); + if( blocking != null ) builder.append( " on " ).append( blocking ).append( '\n' ); for( StackTraceElement element : owner.getStackTrace() ) { - builder.append( "\n at " ).append( element ); + builder.append( " at " ).append( element ).append( '\n' ); } + executor.printState( builder ); + ComputerCraft.log.warn( builder.toString() ); } } diff --git a/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java b/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java index a22f27f62..dca82196b 100644 --- a/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/CobaltLuaMachine.java @@ -214,6 +214,20 @@ public class CobaltLuaMachine implements ILuaMachine } } + @Override + public void printExecutionState( StringBuilder out ) + { + LuaState state = this.state; + if( state == null ) + { + out.append( "CobaltLuaMachine is terminated\n" ); + } + else + { + state.printExecutionState( out ); + } + } + @Override public void close() { diff --git a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java index 1b981696a..2cfa48f3b 100644 --- a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java @@ -61,6 +61,15 @@ public interface ILuaMachine */ MachineResult handleEvent( @Nullable String eventName, @Nullable Object[] arguments ); + /** + * Print some information about the internal execution state. + *

+ * This function is purely intended for debugging, its output should not be relied on in any way. + * + * @param out The buffer to write to. + */ + void printExecutionState( StringBuilder out ); + /** * Close the Lua machine, aborting any running functions and deleting the internal state. */ diff --git a/src/test/java/dan200/computercraft/core/computer/FakeComputerManager.java b/src/test/java/dan200/computercraft/core/computer/FakeComputerManager.java index ccbf101ba..4636e4054 100644 --- a/src/test/java/dan200/computercraft/core/computer/FakeComputerManager.java +++ b/src/test/java/dan200/computercraft/core/computer/FakeComputerManager.java @@ -211,6 +211,11 @@ public class FakeComputerManager } } + @Override + public void printExecutionState( StringBuilder out ) + { + } + @Override public void close() { From a9b74dc97971c074dbce90a1135777f7faa44275 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 9 Oct 2022 11:22:24 +0100 Subject: [PATCH 3/3] Make IRC links https --- README.md | 2 +- doc/guides/speaker_audio.md | 2 +- doc/index.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f05ab4cf3..df1ea4140 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ the generated documentation [can be browsed online](https://tweaked.cc/javadoc/) [ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge" [forum]: https://forums.computercraft.cc/ [GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions -[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet" +[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet" diff --git a/doc/guides/speaker_audio.md b/doc/guides/speaker_audio.md index 25d772dd2..6fb3e87f0 100644 --- a/doc/guides/speaker_audio.md +++ b/doc/guides/speaker_audio.md @@ -201,4 +201,4 @@ This is, I'm afraid, left as an exercise to the reader. [Ring Buffer]: https://en.wikipedia.org/wiki/Circular_buffer "Circular buffer - Wikipedia" [Sine Wave]: https://en.wikipedia.org/wiki/Sine_wave "Sine wave - Wikipedia" [GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions -[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet" +[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet" diff --git a/doc/index.md b/doc/index.md index 697fc9421..07ec525e3 100644 --- a/doc/index.md +++ b/doc/index.md @@ -51,4 +51,4 @@ CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please [ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge" [lua]: https://www.lua.org/ "Lua's main website" [GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions -[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet" +[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"