From 2493cf8f73e075f4044de16a3f539ea159ce4950 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 30 Jan 2012 23:59:20 -0800 Subject: [PATCH] Some fixes for pfConsole. --- .../Plasma/FeatureLib/pfConsole/pfConsole.cpp | 3 ++- .../pfConsole/pfConsoleCommands.cpp | 22 +++++++++++-------- .../pfConsole/pfConsoleCommandsNet.cpp | 11 ++++++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index c51b06d8..02860cba 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -45,6 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pfPython/cyPythonInterface.h" + #include "HeadSpin.h" #include "pfConsole.h" #include "pfConsoleCore/pfConsoleEngine.h" @@ -62,7 +64,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plgDispatch.h" #include "plPipeline.h" -#include "pfPython/cyPythonInterface.h" #include "plNetClient/plNetClientMgr.h" #ifndef PLASMA_EXTERNAL_RELEASE diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index cb6990a1..b2060575 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define LIMIT_CONSOLE_COMMANDS 1 #endif +#include "pfPython/cyPythonInterface.h" +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -163,10 +165,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "hsTemplates.h" - -#include "pfPython/cyPythonInterface.h" -#include "pfPython/plPythonSDLModifier.h" - #include "plResMgr/plResManagerHelper.h" #include "plResMgr/plResMgrSettings.h" #include "plResMgr/plLocalization.h" @@ -2466,11 +2464,10 @@ PF_CONSOLE_CMD( App, // groupName "", // paramList "Quit the client app" ) // helpString { - if( plClient::GetInstance() ) - PostMessage(plClient::GetInstance()->GetWindowHandle(), - WM_SYSCOMMAND, - SC_CLOSE, - 0); + if( plClient::GetInstance() ) { + plClientMsg* msg = new plClientMsg(plClientMsg::kQuit); + msg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + } } #ifndef LIMIT_CONSOLE_COMMANDS @@ -2510,8 +2507,12 @@ PF_CONSOLE_CMD(App, "", "Set low priority for this process") { +#if HS_BUILD_FOR_WIN32 SetPriorityClass( GetCurrentProcess(), IDLE_PRIORITY_CLASS ); PrintString( "Set process priority to lowest setting" ); +#else + PrintString("Not implemented on your platform!"); +#endif } @@ -3933,6 +3934,8 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name "string roomNameBase", // Params "Pages in all scene nodes that start with name." ) // Help string { +/* This is really old and hasn't worked since 2002 anyways. */ +#if HS_BUILD_FOR_WIN32 plSynchEnabler ps(false); // disable dirty tracking while paging in std::string pageInNodesStr; @@ -3950,6 +3953,7 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name } pMsg1->AddReceiver( plClient::GetInstance()->GetKey() ); plgDispatch::MsgSend(pMsg1); +#endif } #ifndef LIMIT_CONSOLE_COMMANDS diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp index fe20bba3..56903cb9 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -355,7 +356,8 @@ PF_CONSOLE_CMD( Net, // groupName link.GetAgeInfo()->SetAgeFilename( params[0] ); //link.GetAgeInfo()->SetAgeInstanceName( params[0] ); //link.GetAgeInfo()->SetAgeUserDefinedName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID( params[1] ) ); + plUUID guid(params[1]); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid ); link.SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); plNetLinkingMgr::GetInstance()->LinkToAge( &link ); PrintString("Linking to age..."); @@ -637,7 +639,6 @@ PF_CONSOLE_CMD( Net_DebugObject, // groupName plNetObjectDebugger::GetInstance()->ClearAllDebugObjects(); } -#include "pfPython/plPythonSDLModifier.h" PF_CONSOLE_CMD( Net_DebugObject, // groupName DumpAgeSDLHook, // fxnName "bool dirtyOnly", // paramList @@ -810,7 +811,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); @@ -837,7 +839,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed");