FreedomCore SOAP Console


For many of those, who are trying to work with the SOAP on TrinityCore, i’ve made that library. Here is a README description of what this library can do:

Creating SOAP account

In order to be able to use library, you have to create a dedicated SOAP account first.
To do so, execute the following command in your worldserver console
accont create 2#1 accountPassword

[ol][li]2#1 - account ID, can be anything, but i suggest to use the next available id for the account[/li]
[li]accountPassword - a secure password for your SOAP account[/li]
After it is done, we need to grant privileges to the account, this can be done by using the following command
account set gmlevel 2#1 3 -1

Initializing connection to the SOAP service

After SOAP account is created, we can proceed to the connection initialization for the library
$console = new \FreedomCore\TrinityCore\Console\Client(‘2#1’, ‘accountPassword’);
That is it. Now you can use the library!

Available Methods

Current implementation of the console client has the following ‘endpoints’:

[ol][li]account() - Allows you to perform various operations on specific account[/li]
[li]bnet() - Allows you to manage related settings[/li]
[li]character() - Allows you to perform various operations on specific settings[/li]
[li]gm() - Allows you to ‘talk’ to GMs[/li]
[li]guild() - Allows you to manage different guild specific settings[/li]
[li]lfg() - Provides information about the LFG system[/li]
[li]reset() - Allows you to reset different aspects of the character (or, all characters on the server)[/li]
[li]server() - Allows you to manage different server related settings[/li]
[li]send() - Allows you to send in-game mail[/li]

Client Options

[ul][li]setAddress - Set Server Address[/li]$console->setAddress(string $serverAddress);

[li][B]getAddress[/B] - Get Server Address[/li]$console->getAddress();

[li][B]setPort[/B] - Set Server Port[/li]$console->setPort(int $serverPort);

[li][B]getPort[/B] - Get Server Port[/li]$console->getPort();

[li][B]getVersion[/B] - Get Client Version[/li]$console->getVersion();

[li][B]createConnection[/B] - Initialize Connection To The Server (needs to be invoked if address/port has been changed)[/li]$console->createConnection();

[li][B]getClient[/B] - Get Client Instance[/li]$console->getClient();



[ul][li]create() - Create new account[/li]$result = $console->account()->create(string $account, string $password);

[li][B]delete()[/B] - Delete specified account[/li]$result = $console->account()->delete(string $account);

[li][B]password()[/B] - Set new password for the account[/li]$result = $console->account()->password(string $oldPassword, string $newPassword, string $repeatPassword);

[li][B]setAddon()[/B] - Set expansion version for specified account[/li]$result = $console->account()->setAddon(string $account, int $addon);

[li][B]setGmLevel()[/B] - Set Game Mater Level For Account[/li]$result = $console->account()->setGmLevel(string $account, int $level, int $realm = -1);

[li][B]setSecRegmail()[/B] - Sets the regmail for specified account[/li]$result = $console->account()->setSecRegmail(string $account, string $regMail, string $repeatRegMail);

[li][B]setSecEmail()[/B] - Set the email for specified account[/li]$result = $console->account()->setSecEmail(string $account, string $email, string $repeatEmail);

[li][B]setPassword()[/B] - Set password for account.[/li]$result = $console->account()->setPassword(string $oldPassword, string $newPassword, string $repeatPassword);



[ul][li]create - Create new account[/li]$result = $console->bnet()->create(string $email, string $password);

[li][B]gameAccountCreate[/B] - Create game account for specified account[/li]$result = $console->bnet()->gameAccountCreate(string $email);

[li][B]link[/B] - Link existing game account with account[/li]$result = $console->bnet()->link(string $email, string $login);

[li][B]unlink[/B] - Unlink existing account from specified account[/li]$result = $console->bnet()->unlink(string $account, string $password);

[li][B]listGameAccounts[/B] - List game account on specified account[/li]$result = $console->bnet()->listGameAccounts(string $email);

[li][B]setPassword[/B] - Set new password for specified account[/li]$result = $console->bnet()->setPassword(string $email, string $password, string $repeatPassword);



[ul][li]unstuck - Teleport specified player to specified location[/li]$result = $console->character()->unstuck(string $playerName, string $location = ‘graveyard’);

[li][B]unmute[/B] - Restore messaging functionality for specified character[/li]$result = $console->character()->unmute(string $playerName);

[li][B]unban[/B] - Unban character by name[/li]$result = $console->character()->unban(string $playerName, $function = 'character');

[li][B]ban[/B] - Ban specified character[/li]$result = $console->character()->ban(string $playerName, $function = 'character');

[li][B]mute[/B] - Disable characters messaging functionality[/li]$result = $console->character()->mute(string $playerName, int $minutes, $reason = 'No reason given!');

[li][B]kick[/B] - Kick player from game world[/li]$result = $console->character()->kick(string $playerName, string $reason = 'No reason given!');

[li][B]customize[/B] - Send "customise character" request on next login[/li]$result = $console->character()->customize(string $playerName);

[li][B]changeFaction[/B] - Send "change faction" request on next login[/li]$result = $console->character()->changeFaction(string $playerName);

[li][B]changeRace[/B] - Send "change race" request on next login[/li]$result = $console->character()->changeRace(string $playerName);

[li][B]erase[/B] - Completely delete character[/li]$result = $console->character()->erase(string $playerName);

[li][B]level[/B] - Increase/Decrease character level by the provided value[/li]$result = $console->character()->level(string $playerName, int $level = 1);

[li][B]rename[/B] - Send "change name" request on next login. IF $newName is provided, name will be forcefully changed[/li]$result = $console->character()->rename(string $oldName, string $newName = '');

[li][B]reputation[/B] - Show reputation information for selected character. Player MUST be online[/li]$result = $console->character()->reputation(string $playerName);

[li][B]titles[/B] - Show titles known by character. Player MUST be online[/li]$result = $console->character()->titles(string $playerName);

[li][B]deletedDelete[/B] - Delete characters which contain specified string in their name[/li]$result = $console->character()->deletedDelete(string $playerName);

[li][B]deletedList[/B] - Show deleted characters with specified string in their names[/li]$result = $console->character()->deletedList(string $playerName);

[li][B]deletedRestore[/B] - Restore deleted characters with specified string in their names[/li]$result = $console->character()->deletedRestore(string $playerName);

[li][B]deletedOld[/B] - Delete characters which was deleted more than $days ago[/li]$result = $console->character()->deletedOld(string $playerName, int $days);



[ul][li]announce - Send announcement to all Game Masters[/li]$result = $console->gm()->announce(string $announcement);

[li][B]nameAnnounce[/B] - Send announcement to all Game Masters (as console)[/li]$result = $console->gm()->nameAnnounce(string $announcement);

[li][B]notify[/B] - Send notification ot all Game Masters[/li]$result = $console->gm()->notify(string $notification);



[ul][li]create - Create new guild. Player MUST be online[/li]$result = $console->guild()->create(string $leaderName, string $guildName);

[li][B]delete[/B] - Delete specified guild[/li]$result = $console->guild()->delete(string $guildName);

[li][B]invite[/B] - Invite Specified Player To Specified Guild[/li]$result = $console->guild()->invite(string $playerName, string $guildName);

[li][B]rename[/B] - Rename Guild[/li]$result = $console->guild()->rename(string $oldName, string $newName);

[li][B]info[/B] - Get Information About Specified Guild[/li]$result = $console->guild()->info(string $guildName);



[ul][li]queue - Show information about current LFG queues[/li]$result = $console->lfg()->queue();

[li][B]clean[/B] - Cleans current queue, only for DEBUG[/li]$result = $console->lfg()->clean();

[li][B]options[/B] - Shows current LFG options. IF value is set, updates existing value.[/li]$result = $console->lfg()->options($value = '');



[ul][li]achievements - Reset achievements for specified player[/li]$result = $console->reset()->achievements(string $playerName);

[li][B]honor[/B] - Reset honor for specified player[/li]$result = $console->reset()->honor(string $playerName);

[li][B]level[/B] - Reset level for specified player[/li]$result = $console->reset()->level(string $playerName);

[li][B]spells[/B] - Reset spells for specified player[/li]$result = $console->reset()->spells(string $playerName);

[li][B]stats[/B] - Reset stats for specified player[/li]$result = $console->reset()->stats(string $playerName);

[li][B]talents[/B] - Reset talents for specified player[/li]$result = $console->reset()->talents(string $playerName);

[li][B]all[/B] - Reset $type (talents/spells) for ALL players[/li]$result = $console->reset()->all(string $type);



[ul][li]items - Send Items To The Player[/li]$console->send()->items(string $playerName, string $mailSubject, string $mailText, Items $items);

[li][B]mail[/B] - Send mail to the player[/li]$console->send()->mail(string $playerName, string $mailSubject, string $mailText);

[li][B]message[/B] - Send message to the player which will appear in the middle of the screen[/li]$console->send()->message(string $playerName, string $message);

[li][B]money[/B] - Send money to the player[/li]$console->send()->money(string $playerName, string $mailSubject, string $mailText, int $amount);



[ul][li]corpses - Trigger corpses expire check in world[/li]$result = $console->server()->corpses();

[li][B]exit[/B] - Terminate server NOW. Exit code 0[/li]$result = $console->server()->exit();

[li][B]info[/B] - Display server version and the number of connected players[/li]$result = $console->server()->info();

[li][B]motd[/B] - Show message of the day[/li]$result = $console->server()->motd();

[li][B]plimit[/B] - Without the argument passed, it will display current limit for players. With argument greater that 0, it will set the new limit for max players. 'reset' parameter may be used to set the value from config.[/li]$result = $console->server()->plimit($parameter = '');

[li][B]setDiffTime[/B] - Set Diff Time For Sever[/li]$result = $console->server()->setDiffTime(int $diffTime);

[li][B]setLogLevel[/B] - Set Log Level For Server[/li]$result = $console->server()->setLogLevel(string $facility, string $name, int $logLevel);

[li][B]setMotd[/B] - Set new message of the day[/li]$result = $console->server()->setMotd(string $motd);

[li][B]setClosed[/B] - Sets whether the world accepts new client connections[/li]$result = $console->server()->setClosed(bool $isClosed);

[li][B]shutdown[/B] - Shutdown server[/li]$result = $console->server()->shutdown(int $timer, bool $force = false, int $code = 0);

[li][B]shutdownCancel[/B] - Cancel the restart/shutdown timer if any[/li]$result = $console->server()->shutdownCancel();

[li][B]saveAll[/B] - Save all players.[/li]$result = $console->server()->saveAll();

[li][B]notify[/B] - Display a message to all online players[/li]$result = $console->server()->notify(string $message);

[li][B]announce[/B] - Send announcement[/li]$result = $console->server()->announce(string $message);