|
|
|
@ -73,7 +73,7 @@ var private /*config*/ bool useMutateInput;
|
|
|
|
|
// Default is "!". Empty values are also treated as "!". |
|
|
|
|
var private /*config*/ Text chatCommandPrefix; |
|
|
|
|
|
|
|
|
|
var LoggerAPI.Definition errCommandDuplicate; |
|
|
|
|
var LoggerAPI.Definition errCommandDuplicate, errServerAPIUnavailable; |
|
|
|
|
|
|
|
|
|
protected function OnEnabled() { |
|
|
|
|
registeredCommands = _.collections.EmptyHashTable(); |
|
|
|
@ -95,10 +95,11 @@ protected function OnEnabled() {
|
|
|
|
|
_.chat.OnMessage(self).Disconnect(); |
|
|
|
|
} |
|
|
|
|
if (useMutateInput || emergencyEnabledMutate) { |
|
|
|
|
_server.unreal.mutator.OnMutate(self).connect = HandleMutate; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
_server.unreal.mutator.OnMutate(self).Disconnect(); |
|
|
|
|
if (__server() != none) { |
|
|
|
|
__server().unreal.mutator.OnMutate(self).connect = HandleMutate; |
|
|
|
|
} else { |
|
|
|
|
_.logger.Auto(errServerAPIUnavailable); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -106,8 +107,8 @@ protected function OnDisabled() {
|
|
|
|
|
if (useChatInput) { |
|
|
|
|
_.chat.OnMessage(self).Disconnect(); |
|
|
|
|
} |
|
|
|
|
if (useMutateInput) { |
|
|
|
|
_server.unreal.mutator.OnMutate(self).Disconnect(); |
|
|
|
|
if (useMutateInput && __server() != none) { |
|
|
|
|
__server().unreal.mutator.OnMutate(self).Disconnect(); |
|
|
|
|
} |
|
|
|
|
useChatInput = false; |
|
|
|
|
useMutateInput = false; |
|
|
|
@ -244,7 +245,11 @@ public final static function EmergencyEnable() {
|
|
|
|
|
if (noWayToInputCommands) { |
|
|
|
|
default.emergencyEnabledMutate = true; |
|
|
|
|
feature.emergencyEnabledMutate = true; |
|
|
|
|
__server().unreal.mutator.OnMutate(feature).connect = HandleMutate; |
|
|
|
|
if (__server() != none) { |
|
|
|
|
__server().unreal.mutator.OnMutate(feature).connect = HandleMutate; |
|
|
|
|
} else { |
|
|
|
|
__().logger.Auto(default.errServerAPIUnavailable); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -503,4 +508,5 @@ public final function bool HandleInputWith(Parser parser, EPlayer callerPlayer)
|
|
|
|
|
defaultproperties { |
|
|
|
|
configClass = class'Commands' |
|
|
|
|
errCommandDuplicate = (l=LOG_Error,m="Command `%1` is already registered with name '%2'. Command `%3` with the same name will be ignored.") |
|
|
|
|
errServerAPIUnavailable = (l=LOG_Error,m="Server API is currently unavailable. Input methods through chat and mutate command will not be available.") |
|
|
|
|
} |