-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.lua
60 lines (44 loc) · 2.33 KB
/
main.lua
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
-- Battle Royale game mode by testman
-- v0.7
-- for TES3MP 0.7.0-alpha
-- TODO: find a decent name
testBR = {}
testBR.scriptName = "TES3MP-Battle-Royale"
-- used for match IDs and for RNG seed
time = require("time")
-- used for generation of random numbers
math.randomseed(os.time())
-- import essay - https://www.barnorama.com/wp-content/uploads/2012/09/0113.jpg
-- load order of these is important
DataManager = require("custom/tes3mp-battle-royale/dependencies/DataManager/main")
PlayerLobby = require("custom/tes3mp-battle-royale/dependencies/PlayerLobby/main")
ContainerFramework = require("custom/tes3mp-battle-royale/dependencies/ContainerFramework/main")
DropFramework = require("custom/tes3mp-battle-royale/dependencies/DropFramework/main")
FullLoot = require("custom/tes3mp-battle-royale/dependencies/FullLoot/main")
brConfig = require("custom/tes3mp-battle-royale/BRConfig")
brDebug = require("custom/tes3mp-battle-royale/BRDebug")
matchLogic = require("custom/tes3mp-battle-royale/game_logic/matchLogic")
playerLogic = require("custom/tes3mp-battle-royale/game_logic/playerLogic")
mapLogic = require("custom/tes3mp-battle-royale/game_logic/mapLogic")
lobbyLogic = require("custom/tes3mp-battle-royale/game_logic/lobbyLogic")
brCustomHandlers = require("custom/tes3mp-battle-royale/BRCustomHandlers")
brCustomValidators = require("custom/tes3mp-battle-royale/BRCustomValidators")
brCustomCommands = require("custom/tes3mp-battle-royale/BRCustomCommands")
-- ========================= MAIN =========================
-- check the config for what type of matchmaking process is used and starts the process if needed
testBR.OnServerPostInit = function()
-- if debug is above level 1 then write it in log
brDebug.Log(1, "Running server in debug mode. DebugLevel: " .. tostring(brConfig.debugLevel))
debug.DeleteExteriorCellData()
-- make DataManager file names more readable
DataManager.configPrefix = "custom/config_"
DataManager.dataPrefix = "custom/data_"
-- set config files from dependencies to reflect values from main config file
PlayerLobby.config.cell = brConfig.lobbyCell
PlayerLobby.config.pos = brConfig.lobbyCoordinates
DataManager.saveData(PlayerLobby.scriptName,PlayerLobby.config)
if brConfig.automaticMatchmaking then
lobbyLogic.StartMatchProposal()
end
end
return testBR