mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-09 15:25:56 -04:00
Merge branch 'master-MC1.7.10' into master-MC1.10
This commit is contained in:
commit
174e55aba5
@ -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
|
[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
|
[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/
|
[forums]: https://oc.cil.li/
|
||||||
[irc]: http://webchat.esper.net/?channels=#oc
|
[irc]: http://webchat.esper.net/?channels=#oc
|
||||||
[issues]: https://github.com/MightyPirates/OpenComputers/issues?state=open
|
[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/
|
[wiki]: https://ocdoc.cil.li/
|
||||||
[integration]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration
|
[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
|
[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
|
||||||
|
@ -268,6 +268,15 @@ opencomputers {
|
|||||||
# IN PARTICULAR, DO NOT REPORT ISSUES AFTER MESSING WITH THIS!
|
# IN PARTICULAR, DO NOT REPORT ISSUES AFTER MESSING WITH THIS!
|
||||||
maxTotalRam: 67108864
|
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.
|
# Robot related settings, what they may do and general balancing.
|
||||||
|
@ -159,7 +159,7 @@ function internal.tcp.handle(origin, data)
|
|||||||
end
|
end
|
||||||
elseif data:sub(2,2) == "A" then
|
elseif data:sub(2,2) == "A" then
|
||||||
local remote = data:byte(3)*256 + data:byte(4)
|
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
|
if internal.tcp.channels[ch] and internal.tcp.channels[ch].waiting then
|
||||||
internal.tcp.channels[ch].waiting = nil
|
internal.tcp.channels[ch].waiting = nil
|
||||||
internal.tcp.channels[ch].open = true
|
internal.tcp.channels[ch].open = true
|
||||||
|
@ -340,7 +340,6 @@ class Settings(val config: Config) {
|
|||||||
val maxScreenWidth = config.getInt("misc.maxScreenWidth") max 1
|
val maxScreenWidth = config.getInt("misc.maxScreenWidth") max 1
|
||||||
val maxScreenHeight = config.getInt("misc.maxScreenHeight") max 1
|
val maxScreenHeight = config.getInt("misc.maxScreenHeight") max 1
|
||||||
val inputUsername = config.getBoolean("misc.inputUsername")
|
val inputUsername = config.getBoolean("misc.inputUsername")
|
||||||
val maxClipboard = config.getInt("misc.maxClipboard") max 0
|
|
||||||
val maxNetworkPacketSize = config.getInt("misc.maxNetworkPacketSize") max 0
|
val maxNetworkPacketSize = config.getInt("misc.maxNetworkPacketSize") max 0
|
||||||
// Need at least 4 for nanomachine protocol. Because I can!
|
// Need at least 4 for nanomachine protocol. Because I can!
|
||||||
val maxNetworkPacketParts = config.getInt("misc.maxNetworkPacketParts") max 4
|
val maxNetworkPacketParts = config.getInt("misc.maxNetworkPacketParts") max 4
|
||||||
@ -467,6 +466,9 @@ class Settings(val config: Config) {
|
|||||||
|
|
||||||
val registerLuaJArchitecture = config.getBoolean("debug.registerLuaJArchitecture")
|
val registerLuaJArchitecture = config.getBoolean("debug.registerLuaJArchitecture")
|
||||||
val disableLocaleChanging = config.getBoolean("debug.disableLocaleChanging")
|
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 {
|
object Settings {
|
||||||
|
@ -3,6 +3,10 @@ package li.cil.oc.integration.appeng;
|
|||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.storage.ICellInventory;
|
import appeng.api.storage.ICellInventory;
|
||||||
import appeng.api.storage.ICellInventoryHandler;
|
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 li.cil.oc.api.driver.Converter;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -31,6 +35,11 @@ public final class ConverterCellInventory implements Converter {
|
|||||||
output.put("name", cell.getItemStack().getDisplayName());
|
output.put("name", cell.getItemStack().getDisplayName());
|
||||||
} else if (value instanceof ICellInventoryHandler) {
|
} else if (value instanceof ICellInventoryHandler) {
|
||||||
convert(((ICellInventoryHandler) value).getCellInv(), output);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,8 @@ class Machine(val host: MachineHost) extends prefab.ManagedEnvironment with mach
|
|||||||
|
|
||||||
private var cost = Settings.get.computerCost * Settings.get.tickFrequency
|
private var cost = Settings.get.computerCost * Settings.get.tickFrequency
|
||||||
|
|
||||||
|
private val maxSignalQueueSize = Settings.get.maxSignalQueueSize
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
override def onHostChanged(): Unit = {
|
override def onHostChanged(): Unit = {
|
||||||
@ -311,7 +313,7 @@ class Machine(val host: MachineHost) extends prefab.ManagedEnvironment with mach
|
|||||||
state.synchronized(state.top match {
|
state.synchronized(state.top match {
|
||||||
case Machine.State.Stopped | Machine.State.Stopping => return false
|
case Machine.State.Stopped | Machine.State.Stopping => return false
|
||||||
case _ => signals.synchronized {
|
case _ => signals.synchronized {
|
||||||
if (signals.size >= 256) return false
|
if (signals.size >= maxSignalQueueSize) return false
|
||||||
else if (args == null) {
|
else if (args == null) {
|
||||||
signals.enqueue(new Machine.Signal(name, Array.empty))
|
signals.enqueue(new Machine.Signal(name, Array.empty))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user