-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBootstrap_DMC.lua
More file actions
70 lines (58 loc) · 2.33 KB
/
Bootstrap_DMC.lua
File metadata and controls
70 lines (58 loc) · 2.33 KB
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
---@type _,br,Daemonic
local _,br,dmc = ...
---@class br
br = br or {}
br.Initialization = br.Initialization or {}
br.Initialization.Startup = function(self)
self.__index = self
br.Logging:Log("BRLite Initialization Starting TOC: " .. br.clientTOC)
local Includefile =dmc.GetExeDirectory() .. "/BRLite/include.json"
local IncludeData = dmc.ReadFile(Includefile)
if not IncludeData then
br.Logging:Log("ERROR: Unable to read include file: " .. Includefile)
return
end
local inclusions = dmc.JsonDecode(IncludeData)
-- Unlocker specific Includes
local unlocker = "UNLOCKER-" .. br.unlocker
if inclusions[unlocker] then
for _, file in pairs(inclusions[unlocker]) do
if not dmc.FileExists(dmc.GetExeDirectory() .. "BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
dmc.RequireFile(dmc.GetExeDirectory() .. "BRLite/" .. file,_G,br,dmc)
end
end
--- EARLY INCLUDES
for _, file in pairs(inclusions["EARLY"]) do
if not dmc.FileExists(dmc.GetExeDirectory() .. "BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
local status,data = dmc.RequireFile(dmc.GetExeDirectory() .. "BRLite/" .. file,_G,br,dmc)
if not status then
br.Logging:Log("ERROR: Include file failed to load: " .. file .. " with error: " .. tostring(data))
return
end
end
--TOC Specific Includes
local toc = "TOC-" .. br.clientTOC
if inclusions[toc] then
for _, file in pairs(inclusions[toc]) do
if not dmc.FileExists(dmc.GetExeDirectory() .. "BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
local status,data = dmc.RequireFile(dmc.GetExeDirectory() .. "BRLite/" .. file,_G,br,dmc)
end
end
--- LATE INCLUDES
for _, file in pairs(inclusions["LATE"]) do
if not dmc.FileExists(dmc.GetExeDirectory() .. "BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
dmc.RequireFile(dmc.GetExeDirectory() .. "BRLite/" .. file,_G,br,dmc)
end
end