summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/ProtectionAreas/ProtectionAreas.lua
blob: 603b7a87fdb67d3c4b085b09a833453e3d2e2a31 (plain) (blame)
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

-- ProtectionAreas.lua
-- Defines the main plugin entrypoint





--- Prefix for all messages logged to the server console
PluginPrefix = "ProtectionAreas: ";





--- Called by MCS when the plugin loads
-- Returns true if initialization successful, false otherwise
function Initialize(a_Plugin)
	a_Plugin:SetName("ProtectionAreas");
	a_Plugin:SetVersion(1);
	
	if (not(InitializeStorage())) then
		LOGWARNING(PluginPrefix .. "failed to initialize Storage, plugin is disabled");
		return false;
	end
	InitializeHooks(a_Plugin);
	InitializeCommandHandlers();
	
	-- TODO: We might be reloading, so there may be players already present in the server
	-- Reload areas for all present players
	
	return true;
end