Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advtrains_luaautomation_sync
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minetest
advtrains_luaautomation_sync
Commits
7e7094e8
Commit
7e7094e8
authored
Oct 20, 2021
by
Peter Nerlich
Browse files
Options
Downloads
Patches
Plain Diff
update patch for release-2.3.1
parent
e3813942
No related branches found
No related tags found
No related merge requests found
Pipeline
#47427
passed
Oct 20, 2021
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
advtrains
+1
-1
1 addition, 1 deletion
advtrains
sync.patch
+34
-32
34 additions, 32 deletions
sync.patch
with
35 additions
and
33 deletions
advtrains
@
e5060860
Subproject commit
6202c1cb009d24342a8f59a5500178c41d746489
Subproject commit
e506086011ee24a30d3085c6933e8e38f2abd325
This diff is collapsed.
Click to expand it.
sync.patch
+
34
−
32
View file @
7e7094e8
diff -ruN advtrains/advtrains_luaautomation/chatcmds.lua patched/chatcmds.lua
--- advtrains/advtrains_luaautomation/chatcmds.lua 2021-10-
12 19:04:17.221486017
+0200
+++ patched/chatcmds.lua 2021-10-2
0 23:46:54.111016528
+0200
@@ -
4
,6 +
4
,1
2
@@
--
position helper.
--
punching a node will result in that position being saved and inserted into a text field on the top of init form.
local punchpos={}
--- advtrains/advtrains_luaautomation/chatcmds.lua 2021-10-
21 00:03:24.427178402
+0200
+++ patched/chatcmds.lua 2021-10-2
1 00:10:03.105604464
+0200
@@ -
1
,6 +
1
,1
3
@@
--
chatcmds.lua
--
Registers commands to modify the init and step code for LuaAutomation
+local http
+
+local function setup_http(_http)
+ http = _http
+end
+table.insert(atlatc.setup_http, setup_http)
minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
local pname=player:get_player_name()
@@ -22,6 +28,30 @@
.."button[4,0;2,1;save;Save] button[6,0;2,1;del;Delete Env.] field[8.1,0.5;2,1;punchpos;Last punched position;"..pp.."]"
.."textarea[0.2,1;10,10;code;Environment initialization code;"..minetest.formspec_escape(code).."]"
.."label[0,9.8;"..err.."]"
+
local function get_init_form(env, pname)
local err = env.init_err or ""
local code = env.init_code or ""
@@ -13,6 +20,31 @@
.."button[7.5,0.2;2.5,1;del;Delete Env.]"
.."textarea[0.3,1.5;"..atlatc.CODE_FORM_SIZE..";code;Environment initialization code;"..minetest.formspec_escape(code).."]"
.."label[0.0,9.7;"..err.."]"
+
+ local msg = "Sync"
+ if env.sync_err then
+ msg = msg..", failed"
...
...
@@ -45,7 +47,7 @@ diff -ruN advtrains/advtrains_luaautomation/chatcmds.lua patched/chatcmds.lua
return form
end
@@ -
62
,6 +
92
,44 @@
@@ -
119
,6 +
151
,44 @@
return
end
...
...
@@ -90,7 +92,7 @@ diff -ruN advtrains/advtrains_luaautomation/chatcmds.lua patched/chatcmds.lua
envname=string.match(formname, "^atlatc_envsetup_(.+)$")
if not envname then return end
@@ -
8
1,4 +
149
,7 @@
@@ -1
38
,4 +
208
,7 @@
env:run_initcode()
minetest.show_formspec(pname, formname, get_init_form(env, pname))
end
...
...
@@ -99,8 +101,8 @@ diff -ruN advtrains/advtrains_luaautomation/chatcmds.lua patched/chatcmds.lua
+ end
end)
diff -ruN advtrains/advtrains_luaautomation/environment.lua patched/environment.lua
--- advtrains/advtrains_luaautomation/environment.lua 2021-10-
12 19:04:17.221486017
+0200
+++ patched/environment.lua 2021-10-2
0 23:46:54.111016528
+0200
--- advtrains/advtrains_luaautomation/environment.lua 2021-10-
21 00:03:24.427178402
+0200
+++ patched/environment.lua 2021-10-2
1 00:08:02.436078685
+0200
@@ -1,6 +1,13 @@
-------------
-- lua sandboxed environment
...
...
@@ -118,18 +120,18 @@ diff -ruN advtrains/advtrains_luaautomation/environment.lua patched/environment.
@@ -34,11 +41,12 @@
self.fdata={}
self.init_code=data.init_code or ""
self.s
tep_code=data.step_code
or
""
self.s
ubscribers=data.subscribers
or
{}
+ self.sync_url=data.sync_url or ""
end,
save = function(self)
-- throw any function values out of the sdata table
self.sdata = atlatc.remove_invalid_data(self.sdata)
- return {sdata = self.sdata, init_code=self.init_code, s
tep_code=self.step_code
}
+ return {sdata = self.sdata, init_code=self.init_code, s
tep_code=self.step_code
, sync_url=self.sync_url}
- return {sdata = self.sdata, init_code=self.init_code, s
ubscribers=self.subscribers
}
+ return {sdata = self.sdata, init_code=self.init_code, s
ubscribers=self.subscribers
, sync_url=self.sync_url}
end,
}
@@ -32
6
,6 +33
4
,32 @@
@@ -32
9
,6 +33
7
,32 @@
end
end
end
...
...
@@ -160,10 +162,10 @@ diff -ruN advtrains/advtrains_luaautomation/environment.lua patched/environment.
+ end
+end
--
- class interface
@@ -3
5
6,7 +
39
0,11 @@
env:run_
step
code()
--
log to environment subscribers. severity can be "error", "warning" or "info" (used by internal print)
function env_proto:log(severity, ...)
@@ -3
6
6,7 +
40
0,11 @@
env:run_
init
code()
end
end
-
...
...
@@ -176,9 +178,9 @@ diff -ruN advtrains/advtrains_luaautomation/environment.lua patched/environment.
diff -ruN advtrains/advtrains_luaautomation/init.lua patched/init.lua
--- advtrains/advtrains_luaautomation/init.lua 2021-10-2
0 23:44:07.351635846
+0200
+++ patched/init.lua 2021-10-2
0 23:49:32.240431167
+0200
@@ -
12
,7 +
12
,7 @@
--- advtrains/advtrains_luaautomation/init.lua 2021-10-2
1 00:03:24.427178402
+0200
+++ patched/init.lua 2021-10-2
1 00:03:47.687085998
+0200
@@ -
8
,7 +
8
,7 @@
--Privilege
--Only trusted players should be enabled to build stuff which can break the server.
...
...
@@ -187,7 +189,7 @@ diff -ruN advtrains/advtrains_luaautomation/init.lua patched/init.lua
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
@@ -2
3
,9 +2
3
,9 @@
@@ -2
2
,9 +2
2
,9 @@
end
end
...
...
@@ -199,7 +201,7 @@ diff -ruN advtrains/advtrains_luaautomation/init.lua patched/init.lua
end
dofile(mp.."/environment.lua")
dofile(mp.."/interrupt.lua")
@@ -9
9
,6 +9
9
,17 @@
@@ -9
8
,6 +9
8
,17 @@
return save_tbl
end
...
...
@@ -219,7 +221,7 @@ diff -ruN advtrains/advtrains_luaautomation/init.lua patched/init.lua
local timer, step_int=0, 2
diff -ruN advtrains/advtrains_luaautomation/operation_panel.lua patched/operation_panel.lua
--- advtrains/advtrains_luaautomation/operation_panel.lua 2021-10-12 18:52:03.743798735 +0200
+++ patched/operation_panel.lua 2021-10-2
0 23:46:54.11101652
8 +0200
+++ patched/operation_panel.lua 2021-10-2
1 00:03:47.68708599
8 +0200
@@ -4,7 +4,7 @@
end
...
...
@@ -231,7 +233,7 @@ diff -ruN advtrains/advtrains_luaautomation/operation_panel.lua patched/operatio
description = "LuaAutomation operation panel",
diff -ruN advtrains/advtrains_luaautomation/pcnaming.lua patched/pcnaming.lua
--- advtrains/advtrains_luaautomation/pcnaming.lua 2021-10-12 18:52:03.743798735 +0200
+++ patched/pcnaming.lua 2021-10-2
0 23:46:54.11101652
8 +0200
+++ patched/pcnaming.lua 2021-10-2
1 00:03:47.68708599
8 +0200
@@ -22,7 +22,7 @@
error("Invalid position supplied to " .. (func_name or "???")..": " .. dump(pos))
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment