Add Proxy and Unv Process Console Commands

This commit is contained in:
AconiteX
2021-05-31 23:49:10 -04:00
parent 3a35f18d24
commit 7eadf64a81
2 changed files with 22 additions and 0 deletions

View File

@@ -475,6 +475,7 @@ static const CommandParser::CmdInfo cmds[] =
{"reloadSwgTcgAccountFeatureId", 1, "<oid>", "Retrieve the SWG TCG account feature Ids for the specified character"},
{"unloadBuildingContents", 1, "<oid>", "Unload the contents of a player-placed authoritative demand-loaded building"},
{"isOnSolidFloor", 1, "<oid>", "Checks to see if the specified object is \"on solid floor\""},
{"proxyToAllGameServers", 1, "<oid>", "Creates a Proxy of the given object on all Game Servers."},
{"", 0, "", ""} // this must be last
};
@@ -4204,6 +4205,21 @@ bool ConsoleCommandParserObject::performParsing2(const NetworkId & userId, const
// ----------------------------------------------------------------------
else if (isAbbrev(argv[0], "proxyToAllGameServers"))
{
NetworkId const oid(Unicode::wideToNarrow(argv[1]));
auto * const object = dynamic_cast<ServerObject *>(NetworkIdManager::getObjectById(oid));
GameServer &gs = GameServer::getInstance();
if(object) {
gs.createProxyOnAllServers(object);
result += getErrorMessage(argv[0], ERR_SUCCESS);
} else {
result += getErrorMessage(argv[0], ERR_FAIL);
}
}
// ----------------------------------------------------------------------
else
{
result += getErrorMessage(argv[0], ERR_NO_HANDLER);

View File

@@ -195,6 +195,7 @@ static const CommandParser::CmdInfo cmds[] =
{"getCommoditiesAuctionLocationPriorityQueue", 1, "<count>", "Gets the top <count> items in the auction location priority queue"},
{"getCommoditiesItemTypeMap", 1, "<game object type>", "For the specified game object type, gets the list of item type"},
{"setCompletedTutorial", 1, "<oid>", "Mark the account belonging to the specified character (character does not have to be logged in) as having completed the tutorial, so that the skip tutorial option will be available during character creation for that account"},
{"getUniverseProcess", 0, "", "Returns the Game Server Universe Process ID"},
#ifdef _DEBUG
{"setExtraDelayPerFrameMs", 1, "<ms>", "Do an intentional sleep each frame, to emulate long loop time"},
{"serverinfo", 0, "", "Serverinformation"},
@@ -3449,6 +3450,11 @@ bool ConsoleCommandParserServer::performParsing2(const NetworkId & userId, const
result += Unicode::narrowToWide(FormattedString<512>().sprintf("There is no character on this galaxy with id (%s)\n", oid.getValueString().c_str()));
}
}
else if (isAbbrev(argv[0], "getUniverseProcess"))
{
result += Unicode::narrowToWide(FormattedString<512>().sprintf("Universe Process ID is: %d\n", ServerUniverse::getInstance().getUniverseProcess()));
result += getErrorMessage(argv[0], ERR_SUCCESS);
}
#ifdef _DEBUG
else if (isAbbrev(argv[0], "setExtraDelayPerFrameMs"))
{