• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blockexchange / blockexchange / 13327895927

14 Feb 2025 11:04AM UTC coverage: 50.789% (-0.001%) from 50.79%
13327895927

push

github

BuckarooBanzay
add chatcommand stubs in offline mode

fixes #70

4 of 6 new or added lines in 2 files covered. (66.67%)

966 of 1902 relevant lines covered (50.79%)

1865.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.74
/init.lua
1
local MP = minetest.get_modpath("blockexchange")
1✔
2

3
-- optional http instance
4
local http = minetest.request_http_api and minetest.request_http_api()
1✔
5

6
-- global namespace
7
blockexchange = {
1✔
8
        -- online flag
9
        is_online = http ~= nil,
1✔
10
        mod_storage = minetest.get_mod_storage(),
2✔
11
        api = {},
1✔
12
        api_version_major = 1,
13
        url = minetest.settings:get("blockexchange.url") or "https://blockexchange.minetest.ch",
1✔
14
        min_delay = tonumber(minetest.settings:get("blockexchange.min_delay") or "0.1"),
1✔
15
        pos1 = {}, -- name -> pos
1✔
16
        pos2 = {}, -- name -> pos
1✔
17
        max_size = 1000
×
18
}
1✔
19

20
assert(mtzip.api_version == 1, "mtzip api compatibility")
1✔
21
assert(Promise.api_version == 1, "Promise api compatibility")
1✔
22

23
if not blockexchange.is_online then
1✔
24
        minetest.log("warning", "[blockexchange] the http api is not enabled, functionality is limited to local operations")
×
25
end
26

27
-- http api
28
if blockexchange.is_online then
1✔
29
        loadfile(MP.."/api/info.lua")(http, blockexchange.url)
1✔
30
        loadfile(MP.."/api/schema.lua")(http, blockexchange.url)
1✔
31
        loadfile(MP.."/api/schemapart.lua")(http, blockexchange.url)
1✔
32
        loadfile(MP.."/api/schemamods.lua")(http, blockexchange.url)
1✔
33
        loadfile(MP.."/api/token.lua")(http, blockexchange.url)
1✔
34
        loadfile(MP.."/api/media.lua")(http, blockexchange.url)
1✔
35
end
36

37
-- internal stuff
38
dofile(MP.."/jobcontext.lua")
1✔
39
dofile(MP.."/privs.lua")
1✔
40
dofile(MP.."/markers.lua")
1✔
41
dofile(MP.."/token.lua")
1✔
42
dofile(MP.."/license.lua")
1✔
43
dofile(MP.."/hud.lua")
1✔
44
dofile(MP.."/areas.lua")
1✔
45
dofile(MP.."/autosave.lua")
1✔
46

47
-- utils
48
dofile(MP.."/util/pointed.lua")
1✔
49
dofile(MP.."/util/placer_tool.lua")
1✔
50
dofile(MP.."/util/placer_entity.lua")
1✔
51
dofile(MP.."/util/placer_preview.lua")
1✔
52
dofile(MP.."/util/remove_nodes.lua")
1✔
53
dofile(MP.."/util/player_area.lua")
1✔
54
dofile(MP.."/util/compare_area.lua")
1✔
55
dofile(MP.."/util/cleanup_area.lua")
1✔
56
dofile(MP.."/util/ignored_content_ids.lua")
1✔
57
dofile(MP.."/util/serialize.lua")
1✔
58
dofile(MP.."/util/deserialize.lua")
1✔
59
dofile(MP.."/util/local_files.lua")
1✔
60
dofile(MP.."/util/check_api_compat.lua")
1✔
61
dofile(MP.."/util/get_schema_size.lua")
1✔
62
dofile(MP.."/util/get_mapblock.lua")
1✔
63
dofile(MP.."/util/sort_pos.lua")
1✔
64
dofile(MP.."/util/get_mapblock_bounds_from_mapblock.lua")
1✔
65
dofile(MP.."/util/schemapart_offset.lua")
1✔
66
dofile(MP.."/util/clip_area.lua")
1✔
67
dofile(MP.."/util/is_area_protected.lua")
1✔
68
dofile(MP.."/util/get_base_pos.lua")
1✔
69
dofile(MP.."/util/iterator.lua")
1✔
70
dofile(MP.."/util/log.lua")
1✔
71
dofile(MP.."/util/collect_node_count.lua")
1✔
72
dofile(MP.."/util/check_size.lua")
1✔
73
dofile(MP.."/util/count_schemaparts.lua")
1✔
74
dofile(MP.."/util/unpack_schemapart.lua")
1✔
75
dofile(MP.."/util/place_schemapart.lua")
1✔
76
dofile(MP.."/util/validate_name.lua")
1✔
77
dofile(MP.."/util/is_player_in_area.lua")
1✔
78

79
if blockexchange.is_online then
1✔
80
        -- online commands
81
        dofile(MP.."/commands/info.lua")
1✔
82
        dofile(MP.."/commands/license.lua")
1✔
83
        dofile(MP.."/commands/user.lua")
1✔
84
        dofile(MP.."/commands/placer.lua")
1✔
85
        dofile(MP.."/commands/save.lua")
1✔
86
        dofile(MP.."/commands/save_update.lua")
1✔
87
        dofile(MP.."/commands/autosave.lua")
1✔
88
        dofile(MP.."/commands/media.lua")
1✔
89
        dofile(MP.."/commands/load.lua")
1✔
90
else
NEW
91
        dofile(MP.."/commands/offline_info.lua")
×
92
end
93
-- commands
94
dofile(MP.."/commands/pos.lua")
1✔
95
dofile(MP.."/commands/area.lua")
1✔
96
dofile(MP.."/commands/cancel_chat.lua")
1✔
97
dofile(MP.."/commands/allocate.lua")
1✔
98
dofile(MP.."/commands/load_local.lua")
1✔
99
dofile(MP.."/commands/save_local.lua")
1✔
100
dofile(MP.."/commands/emerge.lua")
1✔
101
dofile(MP.."/commands/protectioncheck.lua")
1✔
102
dofile(MP.."/commands/cleanup.lua")
1✔
103

104
-- compat
105
if minetest.get_modpath("advtrains") then
1✔
106
        dofile(MP.."/compat/advtrains.lua")
×
107
end
108

109
-- testing
110
if minetest.get_modpath("mtt") then
1✔
111
        dofile(MP .. "/mtt/serialize_spec.lua")
1✔
112
        dofile(MP .. "/mtt/token_spec.lua")
1✔
113
        dofile(MP .. "/mtt/areas_spec.lua")
1✔
114
        dofile(MP .. "/mtt/clip_area_spec.lua")
1✔
115
        dofile(MP .. "/mtt/get_base_pos_spec.lua")
1✔
116
        dofile(MP .. "/mtt/iterator_spec.lua")
1✔
117
        dofile(MP .. "/mtt/schemapart_offset_spec.lua")
1✔
118
        dofile(MP .. "/mtt/sort_pos_spec.lua")
1✔
119
        dofile(MP .. "/mtt/validate_name_spec.lua")
1✔
120
        dofile(MP .. "/mtt/load_save.spec.lua")
1✔
121
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc