-
Notifications
You must be signed in to change notification settings - Fork 2
/
BRCustomHandlers.lua
59 lines (49 loc) · 2.17 KB
/
BRCustomHandlers.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
customEventHooks.registerHandler("OnServerPostInit", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
testBR.OnServerPostInit()
end
end)
customEventHooks.registerHandler("OnPlayerFinishLogin", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
--testBR.VerifyPlayerData(pid)
-- check if player count is high enough to start automatic process
if brConfig.automaticMatchmaking and not lobbyLogic.matchProposalInProgress and not matchLogic.matchInProgress then
lobbyLogic.StartMatchProposal()
end
playerLogic.PlayerInit(pid, true)
end
end)
customEventHooks.registerHandler("OnPlayerDisconnect", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
if matchLogic.IsPlayerInMatch(pid) then
matchLogic.RemovePlayerFromPlayerList(pid)
matchLogic.CheckVictoryConditions()
end
end
end)
customEventHooks.registerHandler("OnPlayerDeath", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
playerLogic.ProcessDeath(pid)
end
end)
--[[ lol why is this here again? Was it for removing containers and NPCS/creatures?
customEventHooks.registerHandler("OnCellLoad", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
--testBR.OnCellLoad(pid)
end
end)
]]
customEventHooks.registerHandler("OnPlayerCellChange", function(eventStatus, pid)
if eventStatus.validCustomHandlers then --check if some other script made this event obsolete
playerLogic.ProcessCellChange(pid)
end
end)
customEventHooks.registerHandler("OnPlayerEndCharGen", function(eventstatus, pid)
if Players[pid] ~= nil then
--tes3mp.LogMessage(2, "++++ Newly created: " .. tostring(pid))
playerLogic.EndCharGen(pid)
if brConfig.automaticMatchmaking and not lobbyLogic.matchProposalInProgress and not matchLogic.matchInProgress then
lobbyLogic.StartMatchProposal()
end
end
end)