You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.2 KiB
61 lines
2.2 KiB
/** |
|
* This is the AcediaAdmin feature, whose main purpose is to register commands |
|
* from its package. |
|
* Copyright 2021 Anton Tarasenko |
|
*------------------------------------------------------------------------------ |
|
* This file is part of Acedia. |
|
* |
|
* Acedia is free software: you can redistribute it and/or modify |
|
* it under the terms of the GNU General Public License as published by |
|
* the Free Software Foundation, version 3 of the License, or |
|
* (at your option) any later version. |
|
* |
|
* Acedia is distributed in the hope that it will be useful, |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
* GNU General Public License for more details. |
|
* |
|
* You should have received a copy of the GNU General Public License |
|
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. |
|
*/ |
|
class AcediaAdmin_Feature extends Feature; |
|
|
|
var LoggerAPI.Definition errNoCommandsFeature; |
|
|
|
protected function OnEnabled() |
|
{ |
|
local Commands_Feature commandsFeature; |
|
commandsFeature = |
|
Commands_Feature(class'Commands_Feature'.static.GetInstance()); |
|
if (commandsFeature == none) |
|
{ |
|
_.logger.Auto(errNoCommandsFeature); |
|
return; |
|
} |
|
commandsFeature.RegisterCommand(class'ACommandDosh'); |
|
commandsFeature.RegisterCommand(class'ACommandGive'); |
|
commandsFeature.RegisterCommand(class'ACommandNick'); |
|
commandsFeature.RegisterCommand(class'ACommandTrader'); |
|
commandsFeature.RegisterCommand(class'ACommandDB'); |
|
} |
|
|
|
protected function OnDisabled() |
|
{ |
|
local Commands_Feature commandsFeature; |
|
commandsFeature = |
|
Commands_Feature(class'Commands_Feature'.static.GetInstance()); |
|
if (commandsFeature != none) |
|
{ |
|
commandsFeature.RemoveCommand(class'ACommandDosh'); |
|
commandsFeature.RemoveCommand(class'ACommandGive'); |
|
commandsFeature.RemoveCommand(class'ACommandNick'); |
|
commandsFeature.RemoveCommand(class'ACommandTrader'); |
|
commandsFeature.RemoveCommand(class'ACommandDB'); |
|
} |
|
} |
|
|
|
defaultproperties |
|
{ |
|
configClass = class'AcediaAdmin' |
|
errNoCommandsFeature = (l=LOG_Error,m="`Commands_Feature` is not detected, \"AcediaAdmin\" will not be able to provide its functionality.") |
|
} |