Hello Guys,
I'm going to show you how to add a 'Reload Script Engine Command' in the Aspire Console.
Note: This will only work on your OWN compiled server. This won't work on a repack.
At first open your trunk solution. Now you can see on the left side the explorer.
Now go to 'hearthstone-world' -> 'launcher' -> 'console' and open 'ConsoleListener.cpp'.
Then search for this lines:
Code:
void HandleConsoleInput(BaseConsole * pConsole, const char * szInput)
{
static ConsoleCommand Commands[] = {
Below this lins you can see all other commands for the console.
Now simply add this line under the
Code:
static ConsoleCommand Commands[] = {
line:
Code:
{ &HandleScriptReloadCommand, "scriptreload","none", "PUT A TEXT HERE." },
Explanation:
'HandleScriptReloadCommand' is the name of our command.
'scriptreload' is the command which you type in the console.
'none' would be the syntax but we don't need some.
'PUT A TEXT HERE.' here you can put the text which will be shown when you type '?' or 'help' in the console.
Now we told the core to do something when we type "scriptreload" in the console. But we have to define what should be done when we type "scriptreload" in.
Just open 'ConsoleCommands.h' and add this
Code:
bool HandleScriptReloadCommand(BaseConsole * pConsole, int argc, const char * argv[]);
between
Code:
#ifndef _CONSOLECOMMANDS_H
#define _CONSOLECOMMANDS_H
and
Now open 'ConsoleCommands.cpp' and add this
Code:
bool HandleScriptReloadCommand(BaseConsole * pConsole, int argc, const char * argv[])
{
sScriptMgr.UnloadScripts();
sScriptMgr.LoadScripts();
return true;
}
at the end of the file.
That should be all.
Proof:
becomes to:
Please do not copy this guide.. if you want to post it in another forum PM me and post credits!
Greetz Asha
PS: My english is not that good I'm sorry.
EDIT: Pictures added!
EDIT: Proof added!