Closed int-ua closed 4 years ago
AsyncErr: ServerThread::run Lua: Runtime error from mod 'ontime_clocks' in callback LuaABM::trigger():
...9/.minetest/mods/display_modpack/display_api/display.lua:173: attempt to index local 'ov' (a nil value)
stack traceback:
...9/.minetest/mods/display_modpack/display_api/display.lua:173: in function <...9/.minetest/mods/display_modpack/display_api/display.lua:160>
Should facedir_values[0]
at https://github.com/pyrollo/display_modpack/blob/master/display_api/display.lua#L122 be facedir_values[1]
maybe?
certainly not lua (index 0)
facedir_values[0]
is defined in this case, so that’s not the reason it returns nil.
My local server now crashes on login and I'm ready to test your suggestions. Testing 1 first... still nil.
Change suggested by a92, didn't work:
diff --git a/display_api/display.lua b/display_api/display.lua
index 2fed40f..42a49aa 100644
--- a/display_api/display.lua
+++ b/display_api/display.lua
@@ -116,7 +116,7 @@ local function get_orientation_values(node)
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
return wallmounted_values[node.param2 % 8]
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
- return facedir_values[node.param2 % 32]
+ return facedir_values[node.param2 % 24]
else
-- No orientation or unknown orientation type
return facedir_values[0]
https://github.com/pyrollo/display_modpack/blob/master/display_api/display.lua#L72
~Seems like this should use ipairs
not pairs
Same for #L76~
pairs works on lists too, at least those I've tried.
Seems like this should use
ipairs
notpairs
Same for #L76
didn't work. Please cross out suggestions that didn't work
diff --git a/display_api/display.lua b/display_api/display.lua
index 2fed40f..27ab79c 100644
--- a/display_api/display.lua
+++ b/display_api/display.lua
@@ -69,11 +69,11 @@ local function compute_values(r)
restricted=(r.x==0 and r.z==0) }
end
-for i, r in pairs(facedir_rotations) do
+for i, r in ipairs(facedir_rotations) do
facedir_values[i] = compute_values(r)
end
-for i, r in pairs(wallmounted_rotations) do
+for i, r in ipairs(wallmounted_rotations) do
wallmounted_values[i] = compute_values(r)
end
paramtype2
is "wallmounted"
and
wallmounted_values[node.param2 % 8]
is nil
With wallmounted_values[node.param2 % 6]
(suggested by a92) it loaded but clock display is broken this way.
Making a PR with this temporary workaround:
diff --git a/display_api/display.lua b/display_api/display.lua
index 2fed40f..dd0b3fc 100644
--- a/display_api/display.lua
+++ b/display_api/display.lua
@@ -114,6 +114,9 @@ local function get_orientation_values(node)
if ndef then
local paramtype2 = ndef.paramtype2
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
+ if (wallmounted_values[node.param2 % 8] == nil) then
+ return facedir_values[0]
+ end
return wallmounted_values[node.param2 % 8]
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
return facedir_values[node.param2 % 32]
wait, coil already created https://github.com/pyrollo/display_modpack/pull/37/files
So do those PRs fix the crashing on login on your local server @int-ua?
If so maybe the display_modpack
should be forked temporarily (or use your fork?), so the fix can be applied to the server sooner?
Yes, I was able to login with my patch, didn't add coil changes though. I'm waiting for it be forked, yes. Can you do that and force server code update?
@int-ua does coil's fork also work? https://github.com/coil0/display_modpack/tree/pandorabox I can update it now if it does.
EDIT: going to update to coil's fork now anyway...
Didn't mean to close this yet...
Ok, just restarted the server, @int-ua try logging in to see if it's fixed.
Crashing fixed, thank you.
i thought something was wrong when i saw the unread count on my mailbox this morning... Impressive detective work without the logfiles... :open_mouth:
I opened an issue (#384) for that but i'm not sure yet how to publish the logs without some kind of shell acces...
i'm not sure yet how to publish the logs without some kind of shell acces...
Don't, it would take the fun away :p There would be a possibility of the watchdog to copy last x lines of log to a static page. (on start) But I fear that could open another pandoras box. We wouldn't want DMs to appear in public logs.
I was rotating a green digital clock with a sonic screwdriver next to a running water tile and a travelnet nearby when the server crashed and it is now crashing each time I try to login.