mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 19:56:17 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers into master-MC1.7.10
Conflicts: src/main/scala/li/cil/oc/util/LuaStateFactory.scala
This commit is contained in:
commit
e4e161552d
@ -247,6 +247,18 @@ opencomputers {
|
|||||||
# capitalization, which is commonly the case on Windows, for example.
|
# capitalization, which is commonly the case on Windows, for example.
|
||||||
# This only takes effect when bufferChanges is set to true.
|
# This only takes effect when bufferChanges is set to true.
|
||||||
forceCaseInsensitiveFS: false
|
forceCaseInsensitiveFS: false
|
||||||
|
|
||||||
|
# Logs the full error when a native library fails to load. This is
|
||||||
|
# disabled by default to avoid spamming the log, since libraries are
|
||||||
|
# iterated until one works, so it's very likely for some to fail. Use
|
||||||
|
# this in case all libraries fail to load even though you'd expect one
|
||||||
|
# to work.
|
||||||
|
logFullNativeLibLoadErrors: false
|
||||||
|
|
||||||
|
# Force loading one specific library, to avoid trying to load any
|
||||||
|
# others. Use this if you get warnings in the log or are told to do
|
||||||
|
# so for debugging purposes ;-)
|
||||||
|
forceNativeLibWithName: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +143,8 @@ do
|
|||||||
computer.pushSignal("init") -- so libs know components are initialized.
|
computer.pushSignal("init") -- so libs know components are initialized.
|
||||||
|
|
||||||
status("Starting shell...")
|
status("Starting shell...")
|
||||||
|
require("term").clear()
|
||||||
|
os.sleep(0.1) -- Allow init processing.
|
||||||
end
|
end
|
||||||
|
|
||||||
local function motd()
|
local function motd()
|
||||||
@ -161,7 +163,6 @@ local function motd()
|
|||||||
end
|
end
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
require("term").clear()
|
|
||||||
motd()
|
motd()
|
||||||
local result, reason = os.execute(os.getenv("SHELL"))
|
local result, reason = os.execute(os.getenv("SHELL"))
|
||||||
if not result then
|
if not result then
|
||||||
@ -170,4 +171,5 @@ while true do
|
|||||||
os.sleep(0.5)
|
os.sleep(0.5)
|
||||||
require("event").pull("key")
|
require("event").pull("key")
|
||||||
end
|
end
|
||||||
|
require("term").clear()
|
||||||
end
|
end
|
||||||
|
@ -75,6 +75,8 @@ class Settings(config: Config) {
|
|||||||
val allowPersistence = !config.getBoolean("computer.debug.disablePersistence")
|
val allowPersistence = !config.getBoolean("computer.debug.disablePersistence")
|
||||||
val limitMemory = !config.getBoolean("computer.debug.disableMemoryLimit")
|
val limitMemory = !config.getBoolean("computer.debug.disableMemoryLimit")
|
||||||
val forceCaseInsensitive = config.getBoolean("computer.debug.forceCaseInsensitiveFS")
|
val forceCaseInsensitive = config.getBoolean("computer.debug.forceCaseInsensitiveFS")
|
||||||
|
val logFullLibLoadErrors = config.getBoolean("computer.debug.logFullNativeLibLoadErrors")
|
||||||
|
val forceNativeLib = config.getString("computer.debug.forceNativeLibWithName")
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
// robot
|
// robot
|
||||||
|
@ -3,6 +3,7 @@ package li.cil.oc.util
|
|||||||
import java.io.{File, FileInputStream, FileOutputStream}
|
import java.io.{File, FileInputStream, FileOutputStream}
|
||||||
import java.nio.channels.Channels
|
import java.nio.channels.Channels
|
||||||
|
|
||||||
|
import com.google.common.base.Strings
|
||||||
import com.naef.jnlua
|
import com.naef.jnlua
|
||||||
import com.naef.jnlua.LuaState
|
import com.naef.jnlua.LuaState
|
||||||
import com.naef.jnlua.NativeSupport.Loader
|
import com.naef.jnlua.NativeSupport.Loader
|
||||||
@ -92,7 +93,7 @@ object LuaStateFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to find a working lib.
|
// Try to find a working lib.
|
||||||
for (library <- libNames if !haveNativeLibrary) {
|
for (library <- libNames if !haveNativeLibrary && (Strings.isNullOrEmpty(Settings.get.forceNativeLib) || library == Settings.get.forceNativeLib)) {
|
||||||
OpenComputers.log.trace(s"Trying native library '$library'...")
|
OpenComputers.log.trace(s"Trying native library '$library'...")
|
||||||
val libraryUrl = classOf[Machine].getResource(libPath + library)
|
val libraryUrl = classOf[Machine].getResource(libPath + library)
|
||||||
if (libraryUrl != null) {
|
if (libraryUrl != null) {
|
||||||
@ -178,8 +179,13 @@ object LuaStateFactory {
|
|||||||
haveNativeLibrary = true
|
haveNativeLibrary = true
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
case _: Throwable =>
|
case t: Throwable =>
|
||||||
OpenComputers.log.trace(s"Could not load native library '${file.getName}'.")
|
if (Settings.get.logFullLibLoadErrors) {
|
||||||
|
OpenComputers.log.info(s"Could not load native library '${file.getName}'.", t)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OpenComputers.log.trace(s"Could not load native library '${file.getName}'.")
|
||||||
|
}
|
||||||
file.delete()
|
file.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user