/usr/share/games/netpanzer/scripts/initialize.lua is in netpanzer-data 0.8.4.debian.1-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | --LOGGER:log("Script initialization");
--LOGGER:log("Video Config: " .. config.video.width .. " x " .. config.video.height)
--LOGGER:log("Fullscreen: " .. tostring(config.video.fullscreen))
function pairs(t)
local mt = getmetatable(t)
local iter = mt and mt.__next or next
return iter, t, nil
end
game = { tasks = {} };
game.addTask = function(name, task)
-- if name ~= nil then
game.tasks[name] = task;
-- else
-- table.insert(game.tasks, task);
-- end
end;
game.hasTask = function(name)
return game.tasks[name] ~= nil;
end;
function dump_table(result, t, extra)
local lin = extra or ""
if type(t) ~= 'table' then
--LOGGER:log("ERROR dumping table: it is not a table")
return
end
for key,value in pairs(t) do
local keytext
local valuetext
if type(key) == 'number' then
if extra then
keytext = "[" .. key .. "]"
end
else
if extra then
keytext = "." .. key
else
keytext = key;
end
end
if type(value) == 'table' then
if keytext then
dump_table(result, value, (lin or "") .. keytext)
end
elseif type(value) == 'string' then
valuetext = '"' .. string.gsub(value,'"','\\"') .. '"'
elseif type(value) ~= 'function' then
valuetext = tostring(value)
end
if keytext and valuetext then
table.insert(result, lin .. keytext .. " = " .. valuetext)
end
end
end
gconcat = table.concat;
config.dump = function(table)
result = {}
dump_table(result, table)
return gconcat(result,"\n");
end
count_time = 0;
function scriptLoop()
for i, func in pairs(game.tasks) do
if func() then game.tasks[i] = nil end
end
end
--LOGGER:log("Dumping conf:\n" .. config.dump(config))
|