From 2fd3bb4d3accf27e793f6399766c609dd4beb64f Mon Sep 17 00:00:00 2001 From: Lizzy Date: Thu, 30 May 2019 13:36:25 +0100 Subject: [PATCH 1/4] Fixed "Dev jar" link in read-me OC forums hasn't had the "pages" module on it since I took ownership in late 2016 and therefore this link is invalid --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b34deaecf..49567662b 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ In the case you wish to use Eclipse rather than IntelliJ IDEA, the process is mo [api]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/java/li/cil/oc/api [code conventions]: https://ocdoc.cil.li/lua_conventions -[dev-jar]: https://oc.cil.li/index.php?/page/latest.php?repo=OpenComputers-dev-MC1.7.10&type=dev +[dev-jar]: https://ci.cil.li/view/OpenComputers/job/OpenComputers-MC1.7.10/ [forums]: https://oc.cil.li/ [irc]: http://webchat.esper.net/?channels=#oc [issues]: https://github.com/MightyPirates/OpenComputers/issues?state=open @@ -110,4 +110,4 @@ In the case you wish to use Eclipse rather than IntelliJ IDEA, the process is mo [wiki]: https://ocdoc.cil.li/ [integration]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration [ingame manual]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/doc -[idea_1.7.10]: https://ocdoc.cil.li/tutorial:debug_1.7.10 \ No newline at end of file +[idea_1.7.10]: https://ocdoc.cil.li/tutorial:debug_1.7.10 From 3868f997987b534ea4269392653582506667cdcb Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Sat, 6 Apr 2019 20:25:42 +0300 Subject: [PATCH 2/4] https://github.com/MightyPirates/OpenComputers/issues/2928 AE2 Cells don't have extra information they should --- .../oc/integration/appeng/ConverterCellInventory.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java b/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java index 594a5cd47..413685308 100644 --- a/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java +++ b/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java @@ -3,6 +3,10 @@ package li.cil.oc.integration.appeng; import appeng.api.AEApi; import appeng.api.storage.ICellInventory; import appeng.api.storage.ICellInventoryHandler; +import appeng.api.implementations.items.IStorageCell; +import appeng.api.storage.IMEInventoryHandler; +import appeng.api.storage.StorageChannel; +import net.minecraft.item.ItemStack; import li.cil.oc.api.driver.Converter; import java.util.Map; @@ -31,6 +35,11 @@ public final class ConverterCellInventory implements Converter { output.put("name", cell.getItemStack().getDisplayName()); } else if (value instanceof ICellInventoryHandler) { convert(((ICellInventoryHandler) value).getCellInv(), output); + } else if ((value instanceof ItemStack) && (((ItemStack)value).getItem() instanceof IStorageCell)) { + IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory((ItemStack) value, null, StorageChannel.ITEMS); + if (inventory instanceof ICellInventoryHandler) + convert(((ICellInventoryHandler) inventory).getCellInv(), output); } + } } From 986d4345d8972522fbe0a299f59273366b8173fb Mon Sep 17 00:00:00 2001 From: payonel Date: Tue, 4 Jun 2019 13:18:52 -0700 Subject: [PATCH 3/4] read ch from next byte closes #3085 --- .../assets/opencomputers/loot/network/data/lib/network.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/opencomputers/loot/network/data/lib/network.lua b/src/main/resources/assets/opencomputers/loot/network/data/lib/network.lua index 1e94e5b78..65de0b0fb 100644 --- a/src/main/resources/assets/opencomputers/loot/network/data/lib/network.lua +++ b/src/main/resources/assets/opencomputers/loot/network/data/lib/network.lua @@ -159,7 +159,7 @@ function internal.tcp.handle(origin, data) end elseif data:sub(2,2) == "A" then local remote = data:byte(3)*256 + data:byte(4) - local ch = data:byte(3)*256 + data:byte(4) + local ch = data:byte(5)*256 + data:byte(6) if internal.tcp.channels[ch] and internal.tcp.channels[ch].waiting then internal.tcp.channels[ch].waiting = nil internal.tcp.channels[ch].open = true From 0de0bf2ca0bc1f555c04d165ed967a27294eab45 Mon Sep 17 00:00:00 2001 From: payonel Date: Wed, 5 Jun 2019 21:29:00 -0700 Subject: [PATCH 4/4] provide configuration option to set max signal queue size closes #3084 --- src/main/resources/application.conf | 9 +++++++++ src/main/scala/li/cil/oc/Settings.scala | 4 +++- src/main/scala/li/cil/oc/server/machine/Machine.scala | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 247c47f49..ed82cf87a 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -268,6 +268,15 @@ opencomputers { # IN PARTICULAR, DO NOT REPORT ISSUES AFTER MESSING WITH THIS! maxTotalRam: 67108864 } + + # The maximum depth a machine will queue signals before dropping them + # A machine state should be pulling signals via computer.pullSignal + # As the machine receives signals they are queued for pulling, and + # this maximum defines the max queue size. All signals recieved when + # the queue is full are discarded. Note that clipboard text creates + # a signal for each line of text. Thus client are limited to pasting + # text of this many lines. The default (and minimum) is 256 + maxSignalQueueSize: 256 } # Robot related settings, what they may do and general balancing. diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index acf150673..bf72e01b8 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -338,7 +338,6 @@ class Settings(val config: Config) { val maxScreenWidth = config.getInt("misc.maxScreenWidth") max 1 val maxScreenHeight = config.getInt("misc.maxScreenHeight") max 1 val inputUsername = config.getBoolean("misc.inputUsername") - val maxClipboard = config.getInt("misc.maxClipboard") max 0 val maxNetworkPacketSize = config.getInt("misc.maxNetworkPacketSize") max 0 // Need at least 4 for nanomachine protocol. Because I can! val maxNetworkPacketParts = config.getInt("misc.maxNetworkPacketParts") max 4 @@ -465,6 +464,9 @@ class Settings(val config: Config) { val registerLuaJArchitecture = config.getBoolean("debug.registerLuaJArchitecture") val disableLocaleChanging = config.getBoolean("debug.disableLocaleChanging") + + // >= 1.7.4 + val maxSignalQueueSize: Int = (if (config.hasPath("computer.maxSignalQueueSize")) config.getInt("computer.maxSignalQueueSize") else 256) min 256 } object Settings { diff --git a/src/main/scala/li/cil/oc/server/machine/Machine.scala b/src/main/scala/li/cil/oc/server/machine/Machine.scala index 3b536e317..cef8f7f12 100644 --- a/src/main/scala/li/cil/oc/server/machine/Machine.scala +++ b/src/main/scala/li/cil/oc/server/machine/Machine.scala @@ -102,6 +102,8 @@ class Machine(val host: MachineHost) extends prefab.ManagedEnvironment with mach private var cost = Settings.get.computerCost * Settings.get.tickFrequency + private val maxSignalQueueSize = Settings.get.maxSignalQueueSize + // ----------------------------------------------------------------------- // override def onHostChanged(): Unit = { @@ -311,7 +313,7 @@ class Machine(val host: MachineHost) extends prefab.ManagedEnvironment with mach state.synchronized(state.top match { case Machine.State.Stopped | Machine.State.Stopping => return false case _ => signals.synchronized { - if (signals.size >= 256) return false + if (signals.size >= maxSignalQueueSize) return false else if (args == null) { signals.enqueue(new Machine.Signal(name, Array.empty)) }