From 7eadf64a81388175e978044483e1b38fba03bfba Mon Sep 17 00:00:00 2001 From: AconiteX <63141077+AconiteX@users.noreply.github.com> Date: Mon, 31 May 2021 23:49:10 -0400 Subject: [PATCH] Add Proxy and Unv Process Console Commands --- .../console/ConsoleCommandParserObject.cpp | 16 ++++++++++++++++ .../console/ConsoleCommandParserServer.cpp | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp index 9ae54ff5..dc2fd5f0 100755 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp @@ -475,6 +475,7 @@ static const CommandParser::CmdInfo cmds[] = {"reloadSwgTcgAccountFeatureId", 1, "", "Retrieve the SWG TCG account feature Ids for the specified character"}, {"unloadBuildingContents", 1, "", "Unload the contents of a player-placed authoritative demand-loaded building"}, {"isOnSolidFloor", 1, "", "Checks to see if the specified object is \"on solid floor\""}, + {"proxyToAllGameServers", 1, "", "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(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); diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp index 63d8fb1d..e0558251 100755 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp @@ -195,6 +195,7 @@ static const CommandParser::CmdInfo cmds[] = {"getCommoditiesAuctionLocationPriorityQueue", 1, "", "Gets the top items in the auction location priority queue"}, {"getCommoditiesItemTypeMap", 1, "", "For the specified game object type, gets the list of item type"}, {"setCompletedTutorial", 1, "", "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, "", "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")) {