Class UASECO
Documentation of UASECO
Core Class of UASECO with many useful Methods.
Methods
allowAbility
Checks if the given player is allowed to perform this ability, e.g. /help.
Description
void = allowAbility ( Class Player object $player, string $ability )
Parameters
-
$playerClass Player object
-
$abilityChat ability to check the rights for, e.g.
helpof the chat command/help.
Example
$result = $aseco->allowAbility($player, $chat_command);
Return Values
true
allowAdminAbility
Checks if an admin is allowed to perform this ability, e.g. /admin help.
Description
boolean = allowAdminAbility ( string $ability )
Parameters
-
$abilityChat ability to check the rights for, e.g.
helpof the chat command/admin help.
Example
$result = $aseco->allowAdminAbility('help');
Return Values
true
allowOperatorAbility
Checks if an operator is allowed to perform this ability, e.g. /admin help.
Description
boolean = allowOperatorAbility ( string $ability )
Parameters
-
$abilityChat ability to check the rights for, e.g.
helpof the chat command/admin help.
Example
$result = $aseco->allowOperatorAbility('help');
Return Values
false
isAnyAdmin
Checks if the given player is in any admin tier with, optionally, an authorized IP.
Description
boolean = isAnyAdmin ( Class Player object $player )
Parameters
-
$playerClass Player object
Example
$result = $aseco->isAnyAdmin($player);
Return Values
false
isAnyAdminByLogin
Checks if the given player login is in any admin tier.
Description
boolean = isAnyAdminByLogin ( string $login )
Parameters
-
$loginThe
loginfrom a Class Player object
Example
$result = $aseco->isAnyAdminByLogin($player->login);
Return Values
false
isAdmin
Checks if the given player is in admin list with, optionally, an authorized IP.
Description
boolean = isAdmin ( Class Player object $player )
Parameters
-
$playerClass Player object
Example
$result = $aseco->isAdmin($player);
Return Values
false
isAdminByLogin
Checks if the given player login is in admin list.
Description
boolean = isAdminByLogin ( string $login )
Parameters
-
$loginThe
loginfrom a Class Player object
Example
$result = $aseco->isAdminByLogin($player->login);
Return Values
false
isMasterAdmin
Checks if the given player is in masteradmin list with, optionally, an authorized IP.
Description
boolean = isMasterAdmin ( Class Player object $player )
Parameters
-
$playerClass Player object
Example
$result = $aseco->isMasterAdmin($player);
Return Values
false
isMasterAdminByLogin
Checks if the given player login is in masteradmin list.
Description
boolean = isMasterAdminByLogin ( string $login )
Parameters
-
$loginThe
loginfrom a Class Player object
Example
$result = $aseco->isMasterAdminByLogin($player->login);
Return Values
false
isOperator
Checks if the given player is in operator list with, optionally, an authorized IP.
Description
boolean = isOperator ( Class Player object $player )
Parameters
-
$playerClass Player object
Example
$result = $aseco->isOperator($player);
Return Values
false
isOperatorByLogin
Checks if the given player login is in operator list.
Description
boolean = isOperatorByLogin ( string $login )
Parameters
-
$loginThe
loginfrom a Class Player object
Example
$result = $aseco->isOperatorByLogin($player->login);
Return Values
false
isLANLogin
Check login string for LAN postfix (pre/post v2.11.21).
Description
boolean = isLANLogin ( string $login )
Parameters
-
$loginThe
loginfrom a Class Player object
Example
$result = $aseco->isLANLogin($player->login);
Return Values
true
readLists
Read Admin/Operator/Ability lists and apply them on the current instance.
Description
boolean = readLists ( void )
Example
$aseco->readLists();
Return Values
true
writeLists
Write Admin/Operator/Ability lists to save them for future runs.
Description
boolean = writeLists ( void )
Example
$result = $aseco->writeLists();
Return Values
true
readIPs
Read Banned IPs list and apply it on the current instance.
Description
boolean = readIPs ( void )
Example
$result = $aseco->readIPs();
Return Values
true
writeIPs
Write Banned IPs list to save it for future runs.
Description
boolean = writeIPs ( void )
Example
$result = $aseco->writeIPs();
Return Values
true
console_text
Outputs a formatted string without datetime.
Description
void = console_text ( mixed $param [, mixed $param ] )
Parameters
-
$paramCan be one or more string(s) or array(s).
Example
$aseco->console_text('Output No.1', 'Output No.2');
console
Outputs a string to console with datetime prefix.
Description
void = console ( mixed $param [, mixed $param ] )
Parameters
-
$paramCan be one or more string(s) or array(s).
Example
$aseco->console('Output No.1', 'Output No.2');
dump
Wrapper for var_dump() to log into console().
Description
void = dump ( mixed $param [, mixed $param ] )
Parameters
-
$paramCan be one or more string(s) or array(s).
Example
$aseco->dump('Output No.1', 'Output No.2');
versionCheck
Checks two version strings with version_compare().
Description
boolean = versionCheck ( $wanted, $current [, $operator = '>' ] )
Parameters
-
$wantedFirst version number.
-
$currentSecond version number.
-
$operatorIf the third optional operator argument is specified, test for a particular relationship. The possible operators are:
<,lt,<=,le,>,gt,>=,ge,==,=,eq,!=,<>,nerespectively.
Example
$result = $aseco->versionCheck('1.0.0', '1.0.1', '>');
Return Values
true
bool2string
Convert boolean value to text string.
Description
string = bool2string ( boolean $input )
Parameters
-
$inputBoolean value that should be converted to a string, e.g.
true,FALSEornull.
Example
$result = $aseco->bool2string('TrUe');
Return Values
true
string2bool
Convert text string to boolean value.
Description
boolean = string2bool ( string $input )
Parameters
-
$inputString which could be
true,falseornullin any variation, e.g.TrUe,fALsE...
Example
$result = $aseco->string2bool('TrUe');
Return Values
true
bytes2shorthand
Convert bytes into a php.ini memory shorthand string.
Description
string = bytes2shorthand ( int $bytes, string $size_format )
Parameters
-
$bytesBytes to convert
-
$size_formatPossible values are
K(kibibyte),M(mebibyte) orG(gibibyte)
Example
$result = $aseco->bytes2shorthand(1048576, 'M');
Return Values
1M
cleanupLoginList
Remove whitespace and empty entries from a csv string, e.g. 'login1, login2, , login3,' to 'login1,login2,login3'.
Description
string = cleanupLoginList ( $csv )
Parameters
-
$csvA comma seperated list of Class Player object logins
Example
$result = $aseco->cleanupLoginList('login1, login2, , login3,');
Return Values
login1,login2,login3
handleSpecialChars
Converts &, ", ', <, > to HTML entities, removes \n\n, \n and \r and validates the string.
Description
string = handleSpecialChars ( $string )
Parameters
-
$stringString to work with.
Example
$result = $aseco->handleSpecialChars("<hello>You're welcome &\n\ni guess you're looking nice!");
Return Values
<hello>You're welcome &i guess you're looking nice!
encodeEntities
Converts &, ", ', <, > to HTML entities.
Description
string = encodeEntities ( string $input )
Parameters
-
$inputString to work with.
Example
$result = $aseco->encodeEntities("<hello>You're welcome &\n\ni guess you're looking nice!");
Return Values
<hello>You're welcome &\n\ni guess you're looking nice!
decodeEntities
Converts HTML entities into &, ", ', <, >.
Description
string = encodeEntities ( string $input )
Parameters
-
$inputString to work with.
Example
$result = $aseco->encodeEntities("<hello>You're welcome &\n\ni guess you're looking nice!");
Return Values
<hello>You're welcome &\n\ni guess you're looking nice!
slugify
This is a function to slugify (replace non-ASCII characters with ASCII characters) strings in PHP.
It tries to replace some characters to a similar ASCII character, e.g.:
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöùúûüýÿ will be changed to AAAAAEAAAECEEEEIIIIDNOOOOOEUUUUEYssaaaaaeaaaeceeeeiiiidnoooooeuuuueyy
Description
string = slugify ( string $input [, $delimiter = '-' ] )
Parameters
-
$inputThe string to work with.
-
$delimiterA character which will be used for unsupported characters.
Example
$result = $aseco->slugify('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöùúûüýÿ');
Return Values
AAAAAEAAAECEEEEIIIIDNOOOOOEUUUUEYssaaaaaeaaaeceeeeiiiidnoooooeuuuueyy
insertArrayElement
Puts an element at a specific position into an array. Increases original size by one element.
Description
array = insertArrayElement ( &$array, $value, $pos )
Parameters
-
$arrayThat array that should be manipulated.
-
$valueThe value to add to the array at the given
$pos. -
$posThe array position where the
$valueshould be placed.
Example
$new_record_list = $aseco->insertArrayElement($record_list, 125441, 2);
removeArrayElement
Removes an element from a specific position in an array. Decreases original size by one element.
Description
boolean = removeArrayElement ( &$array, $pos )
Parameters
-
$arrayThat array that should be manipulated.
-
$posThe array position which should be removed.
Example
$aseco->removeArrayElement($record_list, 2);
moveArrayElement
Moves an element from one position to the other. All items between are shifted down or up as needed.
Description
boolean = moveArrayElement ( &$array, $from, $to )
Parameters
-
$arrayThat array that should be manipulated.
-
$fromThe array position from which the value should be moved to
$to. -
$toThe array position where the value from
$fromshould be moved to.
Example
$aseco->moveArrayElement($record_list, 2, 10);
fileExistsNoCase
Case-insensitive file_exists replacement function. Returns matching path, otherwise false.
Description
mixed = fileExistsNoCase ( $filepath )
Parameters
-
$filepathFilename with path to check for existence.
Example
if ($nocasepath = $aseco->fileExistsNoCase($localfile)) {
// Do something...
}
stripStyles
Strips all formatting from an input string, suitable for display within the game ($$ escape pairs are preserved) and for logging, removes also $g, $t, $i, $<, $>, $z.
Description
string = stripStyles ( $input [, $for_tm = true ] )
Parameters
-
$inputThe input string to strip formatting from.
-
$for_tmOptional flag to double up
$into$$(default, for TM) or not (for logs, etc.).
Example
$result = $aseco->stripStyles('$af0Brat$s$fffwurst');
Return Values
Bratwurst
stripSizes
Strips only size tags from TM strings, $w$af0Brat$n$fffwurst will become $af0Brat$fffwurst.
Description
string = stripSizes ( $input )
Parameters
-
$inputThe input string to strip sizing from.
Example
$result = $aseco->stripStyles('$w$af0Brat$n$fffwurst');
Return Values
$af0Brat$fffwurst
stripNewlines
Strips newlines from strings.
Description
string = stripNewlines ( $string )
Parameters
-
$stringThe input string to strip newlines from.
Example
$result = $aseco->stripStyles("Bratwurst\nist\nlecker!");
Return Values
Bratwurstistlecker!
stripBOM
Remove BOM-header, see [http://en.wikipedia.org/wiki/Byte_order_mark]
Description
string = stripBOM ( $string )
Parameters
-
$stringThe input string to strip the BOM-header from.
Example
$result = $aseco->stripBOM("\xEF\xBB\xBFBratwurst!");
Return Values
Bratwurst
validateUTF8String
Return valid UTF-8 string, replacing faulty byte values with a given string.
Description
string = validateUTF8String ( $input [, $invalidRepl = '' ] )
Parameters
-
$inputThe input string to work with.
-
$invalidReplCharacter that will be replace unsupported bad multibyte character.
Example
$result = $aseco->validateUTF8String('Höhe, über, Süß');
formatColors
Formats aseco color codes in a string, for example {#server} hello will returned as $ff0 hello.
Description
string = formatColors ( string $message )
Parameters
-
$messageA string for converting e.g. {#server} to $ff0
Example
$message = $aseco->formatColors('Hello {#highlite}dude!');
Return Values
Hello $FFFdude!
formatText
Formats a text, replaces parameters in the text which are marked with {n}.
Description
string = formatText ( string $message [, mixed $str1, mixed $str2, mixed $strN ... ] )
Parameters
-
$messageThe message to convert
-
$str1...$strNOne or more parameter to replace in $message, parameter can be a string or int
Example
$message = $aseco->formatText('{1} {2} sets servername to "{3}"',
'MasterAdmin',
$player->nickname,
'New Cool Server Name'
);
Return Values
MasterAdmin ぎтяα¢кєяѕ|υηפєғ sets servername to "New Cool Server Name"
formatTime
Formats a string from the format ssssttt into the format: hh:mm:ss.ttt, mm:ss.ttt, hh:mm:ss or mm:ss.
Description
string = formatTime ( int $MwTime [, boolean $tsec ] )
Parameters
-
$MwTimeA time from a race from a Player
-
$tsecIf passed and set to false this Method returns
hh:mm:ss(if time has hours), ormm:ss. Default value istrue.
Example
$time_formated = $aseco->formatTime(13336);
Return Values
0:13.336
timeString
DETAILED_DESCRIPTION
Description
string = timeString ( int $time [, $short = false] )
Parameters
-
$timeThe time to work with.
-
$shortIf set to
truethen the output is the short variant. Default value isfalse.
Example
$result = $aseco->timeString(130323);
Return Values
1 day 12 hours 12 minutes 3 seconds
formatNumber
Format a number with grouped thousands.
Description
string = formatNumber ( int $number, int $decimals [, string $dec_point, string $thousands_sep ] )
Parameters
-
$numberThe number being formatted.
-
$decimalsSets the number of decimal points, e.g.
2to get2,147.87or0to get2,147 -
$dec_pointIf passed, sets the separator for the decimal point. Default value is
. -
$thousands_sepIf passed, sets the thousands separator. Default value is
,
Example
$number_formated = $aseco->formatNumber(2147.87, 2);
Return Values
2,147.87
formatFloat
Format a float number.
Description
float = formatFloat ( int $number, int $decimals [, string $dec_point, string $thousands_sep ] )
Parameters
-
$numberThe number being formatted.
-
$decimalsSets the number of decimal points, e.g.
4to get147.8724or0to get147 -
$dec_pointIf passed, sets the separator for the decimal point. Default value is
. -
$thousands_sepIf passed, sets the thousands separator. Default value is empty.
Example
$number_formated = $aseco->formatNumber(2147.87, 2);
Return Values
2,147.87
addManialink
Adds one or more Manialinks to the multiquery and send later together with other Manialinks waiting in the query queue.
Description
void = addManialink ( string $widgets, string $logins, int $timeout, boolean $hideclick )
Parameters
-
$widgetsA XML Manialink
-
$loginsIf passed, send the given Manialink to a single Login or or a comma-seperated list of Logins. Default value is
false(send to all connected Players). -
$timeoutIf passed, set a timeout for the Manialink after that the game client removes the Manialink from the Viewport. Default value is
0. -
$hideclickIf passed
true, then the game client removes the Manialink as soon the Player clicks on it. Default value isfalse.
Example
$widget = '<manialink id="08154711"><quad posn="0 0 0" sizen="10 2" bgcolor="FFFF"></manialink>';
$logins = array('leia_organa', 'darth_vader', 'han_solo', 'luke_skywalker');
$timeout = 10;
$hideclick = true;
$aseco->addManialink($widget, $logins, $timeout, $hideclick);
sendManialink
Sends one or more Manialinks immediately to the given $logins, or all Players.
Description
void = sendManialink ( string $widgets, string $logins, int $timeout, boolean $hideclick )
Parameters
-
$widgetsA XML Manialink
-
$loginsIf passed, send the given Manialink to a single Login or a comma-seperated list of Logins. Default value is
false(send to all connected Players). -
$timeoutIf passed, set a timeout for the Manialink after that the game client removes the Manialink from the Viewport. Default value is
0. -
$hideclickIf passed
true, then the game client removes the Manialink as soon the Player clicks on it. Default value isfalse.
Example
$widget = '<manialink id="08154711"><quad posn="0 0 0" sizen="10 2" bgcolor="FFFF"></manialink>';
$logins = array('leia_organa', 'darth_vader', 'han_solo', 'luke_skywalker');
$timeout = 10;
$hideclick = true;
$aseco->sendManialink($widget, $logins, $timeout, $hideclick);
sendChatMessage
Sends a chat message to the given $logins, or all Players.
Deprecated, use Class Message for locale support instead!
Description
void = sendChatMessage ( string $message, string $logins )
This Method performs a $aseco->formatColors() on the given $message, so you does not need to call this by yourself.
Also all entities like < > & ' " are converted back to normal for chat.
Parameters
-
$messageA message to send to the given Player
-
$loginsIf passed, send the given message to a single Login or a comma-seperated list of Logins. Default value is
false(send to all connected Players).
Example
$message = 'Hello {#highlite}dude!';
$logins = array('leia_organa', 'darth_vader', 'han_solo', 'luke_skywalker');
$aseco->sendChatMessage($message, $logins);
generateManialinkId
Generates a unique ManialinkId
Description
string = generateManialinkId ( void )
Example
$hideclick = $aseco->generateManialinkId();
Return Values
FgaoxbzMehVlnslkmyjpJioLczzHnha7
releaseEvent
Executes the functions which were registered for specified events.
Description
void = releaseEvent ( $event_type, $callback_param )
Parameters
-
$event_typeOn of the default events or a custom.
-
$callback_paramParameter to bypass to the plugins which have registered to be called when this event occurs.
Example
$aseco->releaseEvent('onKarmaChange', $karma_array);
releaseChatCommand
Release a chat command from a plugin.
Description
void = releaseChatCommand ( $command, $login )
Parameters
-
$commandChat command which should be released, e.g.
/help. -
$loginA player login from a Class Player object.
Example
$aseco->releaseChatCommand('/help', $player->login);
getPlugin
Returns a Class Plugin object of the given classname.
Description
Class Plugin object = getPlugin ( $classname )
Parameters
-
$classnameClassname of the plugin to receive the Class Plugin object.
Example
$plugin = $aseco->getPlugin('PluginAutotime');
Class UASECO
Documentation of UASECO
Core Class of UASECO with many useful Methods.
Properties
| Members | Description |
|---|---|
$aseco->client |
Class GbxRemote (includes/core/XmlRpc/GbxRemote.php) |
$aseco->parser |
Class XmlParser object |
$aseco->checkpoints |
Class Checkpoint object |
$aseco->continent |
Class Continent object |
$aseco->country |
Class Country object |
$aseco->db |
Class Database object |
$aseco->locales |
Class Message object |
$aseco->webrequest |
Class WebRequest object |
$aseco->windows |
Class WindowList object, which handles the actions for Class Window |
$aseco->server |
Class Server object |
$aseco->server->maps |
Class MapList object |
$aseco->server->players |
Class PlayerList object |
$aseco->server->rankings |
Class RankingList object |
$aseco->server->mutelist |
|
$aseco->debug |
Holds the boolean status for logging debugging informations |
$aseco->registered_events |
Holds a list of registered events and the callbacks of the listening Plugins |
$aseco->registered_chatcmds |
Holds a list of registered chat commands and the callbacks of the Plugins |
$aseco->chat_colors |
Holds the list of config/UASECO.xml at <colors> |
$aseco->logfile |
array which holds the $aseco->logfile['handle'] and $aseco->logfile['file'] of the current logfile. |
$aseco->plugins |
Holds a list of active Plugins |
$aseco->settings |
Holds the whole settings of config/UASECO.xml, config/access.xml, config/bannedips.xml... |
$aseco->titles |
|
$aseco->masteradmin_list |
|
$aseco->admin_list |
|
$aseco->admin_abilities |
|
$aseco->operator_list |
|
$aseco->operator_abilities |
|
$aseco->banned_ips |
|
$aseco->startup_phase |
Holds the status of the startup phase, if false UASECO has finished startup successfully |
$aseco->shutdown_phase |
|
$aseco->warmup_phase |
Holds the status of the warm-up phase, if false warm-up is finished or there was no warm-up |
$aseco->restarting |
Holds the status of the map is restarting or not |
$aseco->changing_to_gamemode |
If not false then this contains the upcoming name of the Gamemode |
$aseco->current_status |
Dedicated Server status changes |
$aseco->uptime |
Holds the UASECO start-up time |
$aseco->environments |
Array of environments (e.g. 'Canyon', 'Stadium', 'Valley' and 'Lagoon') |
Class UASECO
Documentation of UASECO
Core Class of UASECO with many useful Methods.
Constants
| Constants | Example data |
|---|---|
UASECO_NAME |
UASECO |
UASECO_VERSION |
1.0.0 |
UASECO_BUILD |
2020-07-19 |
UASECO_BRANCH |
MANIAPLANET |
UASECO_WEBSITE |
http://www.UASECO.org/ |
OPERATING_SYSTEM |
WINDOWS or POSIX |
DEDICATED_SERVER_BUILD |
2017-04-13_23_00 |
DEDICATED_SERVER_BUILD_POSIX |
2017-04-13_23_00 |
DEDICATED_SERVER_BUILD_WINDOWS |
2017-04-13_23_00 |
XMLRPC_API_VERSION |
2013-04-16 |
MODESCRIPT_API_VERSION |
2.5.0 |
MIN_PHP_VERSION |
7.2.0 |
MIN_MYSQL_VERSION |
5.1.0 |
MIN_MARIADB_VERSION |
5.5.20 |
CRLF |
PHP_EOL |
LF |
\n |
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
Windows is a registered trademark of Microsoft Corporation.

