Merge branch 'master-MC1.7.10' into master-MC1.10

This commit is contained in:
payonel 2019-06-05 21:34:46 -07:00
commit 174e55aba5
6 changed files with 27 additions and 5 deletions

View File

@ -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
[idea_1.7.10]: https://ocdoc.cil.li/tutorial:debug_1.7.10

View File

@ -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.

View File

@ -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

View File

@ -340,7 +340,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
@ -467,6 +466,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 {

View File

@ -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);
}
}
}

View File

@ -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))
}