2013-05-26 15:20:49 -04:00
|
|
|
|
|
|
|
-- ProtectionAreas.lua
|
|
|
|
-- Defines the main plugin entrypoint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-06 13:10:45 -04:00
|
|
|
--- 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
|
2013-05-26 15:20:49 -04:00
|
|
|
function Initialize(a_Plugin)
|
|
|
|
a_Plugin:SetName("ProtectionAreas");
|
|
|
|
a_Plugin:SetVersion(1);
|
|
|
|
|
2013-06-06 13:10:45 -04:00
|
|
|
if (not(InitializeStorage())) then
|
|
|
|
LOGWARNING(PluginPrefix .. "failed to initialize Storage, plugin is disabled");
|
|
|
|
return false;
|
|
|
|
end
|
2013-05-26 15:20:49 -04:00
|
|
|
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
|