|
|
@ -54,19 +54,19 @@ protected function BuildData(CommandDataBuilder builder) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function Executed( |
|
|
|
protected function Executed( |
|
|
|
CallData result, |
|
|
|
CallData arguments, |
|
|
|
EPlayer callerPlayer) |
|
|
|
EPlayer callerPlayer) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Text givenName; |
|
|
|
local Text givenName; |
|
|
|
local array<FormattingErrorsReport.FormattedStringError> errors; |
|
|
|
local array<FormattingErrorsReport.FormattedStringError> errors; |
|
|
|
|
|
|
|
|
|
|
|
givenName = result.parameters.GetText(P("nick")); |
|
|
|
givenName = arguments.parameters.GetText(P("nick")); |
|
|
|
// `newName`'s reference persists between different command calls and |
|
|
|
// `newName`'s reference persists between different command calls and |
|
|
|
// only deallocated when we need this variable for the next execution. |
|
|
|
// only deallocated when we need this variable for the next execution. |
|
|
|
// "Leaking" a single `Text` like that is insignificant. |
|
|
|
// "Leaking" a single `Text` like that is insignificant. |
|
|
|
_.memory.Free(newName); |
|
|
|
_.memory.Free(newName); |
|
|
|
newName = _.text.Empty(); |
|
|
|
newName = _.text.Empty(); |
|
|
|
if (result.options.HasKey(P("plain"))) { |
|
|
|
if (arguments.options.HasKey(P("plain"))) { |
|
|
|
newName = givenName.MutableCopy(); |
|
|
|
newName = givenName.MutableCopy(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -75,10 +75,10 @@ protected function Executed( |
|
|
|
.ParseFormatted(givenName, newName, true); |
|
|
|
.ParseFormatted(givenName, newName, true); |
|
|
|
} |
|
|
|
} |
|
|
|
foundErrors = false; |
|
|
|
foundErrors = false; |
|
|
|
if (result.options.HasKey(P("color"))) |
|
|
|
if (arguments.options.HasKey(P("color"))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foundErrors = !TryChangeDefaultColor( |
|
|
|
foundErrors = !TryChangeDefaultColor( |
|
|
|
result.options.GetTextBy(P("/color/default_color"))); |
|
|
|
arguments.options.GetTextBy(P("/color/default_color"))); |
|
|
|
} |
|
|
|
} |
|
|
|
foundErrors = foundErrors || (errors.length > 0); |
|
|
|
foundErrors = foundErrors || (errors.length > 0); |
|
|
|
class'FormattingReportTool'.static.Report(callerConsole, errors); |
|
|
|
class'FormattingReportTool'.static.Report(callerConsole, errors); |
|
|
@ -87,12 +87,12 @@ protected function Executed( |
|
|
|
|
|
|
|
|
|
|
|
protected function ExecutedFor( |
|
|
|
protected function ExecutedFor( |
|
|
|
EPlayer target, |
|
|
|
EPlayer target, |
|
|
|
CallData result, |
|
|
|
CallData arguments, |
|
|
|
EPlayer instigator) |
|
|
|
EPlayer instigator) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Text alteredVersion; |
|
|
|
local Text alteredVersion; |
|
|
|
|
|
|
|
|
|
|
|
if (!foundErrors || result.options.HasKey(P("fix"))) |
|
|
|
if (!foundErrors || arguments.options.HasKey(P("fix"))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
announcer.Setup(target, instigator, othersConsole); |
|
|
|
announcer.Setup(target, instigator, othersConsole); |
|
|
|
target.SetName(newName); |
|
|
|
target.SetName(newName); |
|
|
|