From 638740e14e7a1f18447d7fa303a4bffbc5b1fed8 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 20 Jan 2021 22:48:58 -0500 Subject: [PATCH 1/5] Fix `target_link_library()` dependencies for NucleusLib targets. EXCEPT for pnNucleusInc, which has a lot of loops with other Nucleus-level targets. The easiest solution will probably be to remove it as a target and instead treat it as an include directory, somehow. This also fixes some problems with pnUtils leaking its PCH to the rest of the engine. --- Sources/Plasma/Apps/plClient/plClient.cpp | 2 ++ Sources/Plasma/Apps/plClient/winmain.cpp | 1 + .../pfAnimation/plViewFaceModifier.cpp | 1 + .../Plasma/FeatureLib/pfAudio/plListener.cpp | 1 + .../FeatureLib/pfCamera/plCameraBrain.cpp | 1 + .../FeatureLib/pfCamera/plCameraModifier.cpp | 1 + Sources/Plasma/NucleusLib/inc/hsResMgr.h | 4 ++- .../NucleusLib/pnAsyncCore/CMakeLists.txt | 12 +++++++ .../NucleusLib/pnAsyncCoreExe/CMakeLists.txt | 12 +++++++ .../NucleusLib/pnDispatch/CMakeLists.txt | 12 ++++++- .../NucleusLib/pnFactory/CMakeLists.txt | 7 +++- .../NucleusLib/pnInputCore/CMakeLists.txt | 7 ++++ .../NucleusLib/pnKeyedObject/CMakeLists.txt | 13 +++++++- .../pnKeyedObject/hsKeyedObject.cpp | 2 +- .../NucleusLib/pnKeyedObject/plFixedKey.cpp | 2 +- .../NucleusLib/pnMessage/CMakeLists.txt | 12 ++++++- .../Plasma/NucleusLib/pnMessage/plCameraMsg.h | 2 +- .../Plasma/NucleusLib/pnMessage/plClientMsg.h | 4 +-- .../NucleusLib/pnMessage/plCursorChangeMsg.h | 2 +- .../NucleusLib/pnMessage/plFakeOutMsg.h | 2 +- .../Plasma/NucleusLib/pnMessage/plNotifyMsg.h | 1 - .../NucleusLib/pnMessage/plPipeResMakeMsg.h | 2 +- .../NucleusLib/pnMessage/plPlayerPageMsg.h | 2 +- .../pnMessage/plRemoteAvatarInfoMsg.h | 6 +--- .../NucleusLib/pnMessage/plSDLModifierMsg.h | 4 +-- .../pnMessage/plSDLNotificationMsg.h | 2 +- .../NucleusLib/pnMessage/plSatisfiedMsg.h | 2 +- .../NucleusLib/pnMessage/plServerReplyMsg.h | 3 -- .../NucleusLib/pnMessage/plSharedStateMsg.h | 3 -- .../NucleusLib/pnMessage/plSimulationMsg.h | 2 +- .../NucleusLib/pnMessage/plSingleModMsg.h | 4 --- .../NucleusLib/pnModifier/CMakeLists.txt | 13 ++++++++ .../pnModifier/plConditionalObject.cpp | 33 +++++++++++-------- .../pnModifier/plConditionalObject.h | 5 ++- .../NucleusLib/pnModifier/plLogicModBase.h | 1 - .../NucleusLib/pnModifier/plMultiModifier.h | 1 - .../NucleusLib/pnModifier/plSingleModifier.h | 1 - .../NucleusLib/pnNetBase/CMakeLists.txt | 7 ++++ .../Plasma/NucleusLib/pnNetCli/CMakeLists.txt | 11 +++++++ .../NucleusLib/pnNetCommon/CMakeLists.txt | 20 ++++++----- .../pnNetCommon/plSynchedObject.cpp | 1 - .../NucleusLib/pnNetProtocol/CMakeLists.txt | 11 +++++++ .../NucleusLib/pnSceneObject/CMakeLists.txt | 13 +++++++- .../pnSceneObject/plCoordinateInterface.h | 1 - .../NucleusLib/pnSceneObject/plObjInterface.h | 2 -- .../NucleusLib/pnSceneObject/plSceneObject.h | 7 ++-- .../Plasma/NucleusLib/pnTimer/CMakeLists.txt | 10 +++++- .../Plasma/NucleusLib/pnUUID/CMakeLists.txt | 16 +++++---- .../Plasma/NucleusLib/pnUtils/CMakeLists.txt | 10 ++++-- Sources/Plasma/NucleusLib/pnUtils/Pch.h | 7 ---- .../Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp | 2 ++ Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h | 1 - .../Plasma/NucleusLib/pnUtils/pnUtHash.cpp | 1 + Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h | 1 - .../Plasma/NucleusLib/pnUtils/pnUtList.cpp | 1 + Sources/Plasma/NucleusLib/pnUtils/pnUtList.h | 2 -- Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h | 2 +- Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp | 3 +- Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h | 3 -- .../Plasma/NucleusLib/pnUtils/pnUtTime.cpp | 2 ++ Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h | 2 -- .../PubUtilLib/plAnimation/plAGMasterMod.cpp | 1 + .../PubUtilLib/plAudio/plEAXListenerMod.cpp | 3 +- .../PubUtilLib/plAvatar/plArmatureEffects.cpp | 1 + .../PubUtilLib/plAvatar/plSwimRegion.cpp | 2 ++ .../PubUtilLib/plDrawable/plClusterGroup.cpp | 1 + .../plDrawable/plDynaRippleMgrVS.cpp | 1 + .../PubUtilLib/plDrawable/plMorphSequence.cpp | 1 + .../plDrawable/plMorphSequenceSDLMod.cpp | 1 + .../PubUtilLib/plDrawable/plSharedMesh.cpp | 2 ++ .../Plasma/PubUtilLib/plFile/CMakeLists.txt | 6 +++- .../plIntersect/plHardRegionTypes.cpp | 2 ++ .../plIntersect/plSoftVolumeTypes.cpp | 2 ++ .../plMessage/plReplaceGeometryMsg.h | 1 + .../plModifier/plAxisAnimModifier.cpp | 1 + .../plParticleSystem/plParticleEffect.cpp | 1 + .../plParticleSystem/plParticleSystem.cpp | 1 + .../plCubicRenderTargetModifier.cpp | 1 + .../PubUtilLib/plScene/plRelevanceMgr.cpp | 1 + .../PubUtilLib/plScene/plRelevanceRegion.cpp | 1 + .../Plasma/PubUtilLib/plScene/plVisRegion.cpp | 1 + 81 files changed, 248 insertions(+), 104 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index f940b5f286..7bdf34bc01 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -158,6 +158,8 @@ static plDispatchBase* gDisp = nil; static plTimerCallbackManager* gTimerMgr = nil; #ifdef HS_BUILD_FOR_WIN32 +#include "hsWindows.h" +#include extern ITaskbarList3* gTaskbarList; #endif diff --git a/Sources/Plasma/Apps/plClient/winmain.cpp b/Sources/Plasma/Apps/plClient/winmain.cpp index c7daed7802..da360fe95e 100644 --- a/Sources/Plasma/Apps/plClient/winmain.cpp +++ b/Sources/Plasma/Apps/plClient/winmain.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include // ShellExecuteA +#include #include #include diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp index b68ed8c96b..5d00d45f77 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsFastMath.h" #include "plPipeline.h" +#include "pnMessage/plRefMsg.h" #include "plMessage/plRenderMsg.h" #include "plMessage/plListenerMsg.h" #include "plMessage/plAvatarMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp b/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp index 742528fbcf..60ee92bf27 100644 --- a/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp +++ b/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plListener.h" #include "plgDispatch.h" #include "plAudio/plAudioSystem.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plTimeMsg.h" #include "pnMessage/plAudioSysMsg.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp index 4be35a4b20..79fd0d6899 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp @@ -63,6 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plLOSRequestMsg.h" #include "plMessage/plLOSHitMsg.h" #include "plMessage/plAvatarMsg.h" +#include "pnMessage/plRefMsg.h" #include "pnKeyedObject/plKey.h" #include "plInputCore/plInputDevice.h" #include "plInputCore/plInputManager.h" diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp index bd40467ef9..84d8741bfc 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plgDispatch.h" #include "pnSceneObject/plSceneObject.h" #include "pnSceneObject/plCoordinateInterface.h" +#include "pnMessage/plRefMsg.h" #include "plMessage/plInputEventMsg.h" #include "plMessage/plAnimCmdMsg.h" #include "pnMessage/plTimeMsg.h" diff --git a/Sources/Plasma/NucleusLib/inc/hsResMgr.h b/Sources/Plasma/NucleusLib/inc/hsResMgr.h index bea879ce4d..c454dcd9ef 100644 --- a/Sources/Plasma/NucleusLib/inc/hsResMgr.h +++ b/Sources/Plasma/NucleusLib/inc/hsResMgr.h @@ -46,9 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsRefCnt.h" #include "plLoadMask.h" #include "plRefFlags.h" -#include "pnKeyedObject/plKey.h" + +namespace ST { class string; } class hsStream; +class plKey; class plKeyImp; class hsKeyedObject; class plRefMsg; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt index e5daf9d2c3..c7556a6457 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt @@ -16,6 +16,18 @@ set(pnAsyncCore_PRIVATE add_library(pnAsyncCore STATIC ${pnAsyncCore_PRIVATE} ${pnAsyncCore_HEADERS}) target_include_directories(pnAsyncCore PRIVATE "${PLASMA_SOURCE_ROOT}/PubUtilLib") +target_link_libraries( + pnAsyncCore + PUBLIC + CoreLib + pnNetCommon + pnUUID + string_theory + PRIVATE + plStatusLog # :( + pnNetBase + pnUtils +) source_group("Header Files" FILES ${pnAsyncCore_HEADERS}) source_group("Private" FILES ${pnAsyncCore_PRIVATE}) diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt index 2cc1ca4674..2c20a1186e 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt @@ -40,6 +40,18 @@ add_library(pnAsyncCoreExe STATIC ${pnAsyncCoreExe_PRIVATE} ${pnAysncCoreExe_PRIVATE_NT} ${pnAsyncCoreExe_PRIVATE_UNIX} ${pnAsyncCoreExe_PRIVATE_WIN32}) +target_link_libraries( + pnAsyncCoreExe + PUBLIC + CoreLib + pnAsyncCore + pnNetBase + pnUtils +) +if(USE_VLD) + target_link_libraries(pnAsyncCoreExe PRIVATE ${VLD_LIBRARY}) +endif() + source_group("Source Files" FILES ${pnAsyncCoreExe_SOURCES}) source_group("Header Files" FILES ${pnAsyncCoreExe_HEADERS}) source_group("Private" FILES ${pnAsyncCoreExe_PRIVATE}) diff --git a/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt index c4b5721417..9415105b22 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt @@ -10,7 +10,17 @@ set(pnDispatch_HEADERS ) add_library(pnDispatch STATIC ${pnDispatch_SOURCES} ${pnDispatch_HEADERS}) -target_link_libraries(pnDispatch pnNucleusInc) +target_link_libraries( + pnDispatch + PUBLIC + CoreLib + pnFactory + pnKeyedObject + pnNucleusInc + PRIVATE + pnMessage + pnNetCommon +) source_group("Source Files" FILES ${pnDispatch_SOURCES}) source_group("Header Files" FILES ${pnDispatch_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt index f1fb6e7d89..6077024024 100644 --- a/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt @@ -9,7 +9,12 @@ set(pnFactory_HEADERS ) add_library(pnFactory STATIC ${pnFactory_SOURCES} ${pnFactory_HEADERS}) -target_link_libraries(pnFactory CoreLib) +target_link_libraries( + pnFactory + PUBLIC + CoreLib + pnNucleusInc +) source_group("Source Files" FILES ${pnFactory_SOURCES}) source_group("Header Files" FILES ${pnFactory_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnInputCore/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnInputCore/CMakeLists.txt index d3b26611c0..0dd49f9a17 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnInputCore/CMakeLists.txt @@ -11,6 +11,13 @@ set(pnInputCore_SOURCES ) add_library(pnInputCore STATIC ${pnInputCore_HEADERS} ${pnInputCore_SOURCES}) +target_link_libraries( + pnInputCore + PUBLIC + CoreLib + PRIVATE + plResMgr # :( +) target_include_directories(pnInputCore PRIVATE "${PLASMA_SOURCE_ROOT}/PubUtilLib") diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt index 22f5e196d7..5596d8e213 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt @@ -19,7 +19,18 @@ set(pnKeyedObject_SOURCES ) add_library(pnKeyedObject STATIC ${pnKeyedObject_HEADERS} ${pnKeyedObject_SOURCES}) -target_link_libraries(pnKeyedObject CoreLib pnMessage) +target_link_libraries( + pnKeyedObject + PUBLIC + CoreLib + pnFactory + string_theory + PRIVATE + pnDispatch + pnMessage + pnNetCommon + pnNucleusInc +) source_group("Header Files" FILES ${pnKeyedObject_HEADERS}) source_group("Source Files" FILES ${pnKeyedObject_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp index cd435e7b84..d29e86d1c4 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsKeyedObject.h" #include "plKeyImp.h" #include "hsResMgr.h" -#include "pnDispatch/plDispatch.h" +#include "plgDispatch.h" #include "pnMessage/plSelfDestructMsg.h" #include diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp index 49e4f23022..cde81eeaa3 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp @@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plFixedKey.h" #include "plCreatableIndex.h" -#include "pnKeyedObject/plKey.h" +#include "plKey.h" #include "pnFactory/plCreator.h" //// plKeySeed /////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt index d02c564f26..040f51a485 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt @@ -58,7 +58,17 @@ set(pnMessage_SOURCES add_library(pnMessage STATIC ${pnMessage_HEADERS} ${pnMessage_SOURCES}) target_include_directories(pnMessage PRIVATE "${PLASMA_SOURCE_ROOT}/PubUtilLib") -target_link_libraries(pnMessage PUBLIC CoreLib pnNetCommon) +target_link_libraries( + pnMessage + PUBLIC + CoreLib + pnFactory + pnKeyedObject + pnNetCommon + pnNucleusInc + PRIVATE + plSDL # :( +) source_group("Header Files" FILES ${pnMessage_HEADERS}) source_group("Source Files" FILES ${pnMessage_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h index 107574c9ec..10ca7b8ecc 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h @@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // camera message class // -#include "pnMessage/plMessage.h" +#include "plMessage.h" #include "hsBitVector.h" #include "hsGeometry3.h" diff --git a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h index cc4de92668..45f235e4fc 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h @@ -42,8 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plClientMsg_inc #define plClientMsg_inc -#include "pnMessage/plMessage.h" -#include "pnMessage/plRefMsg.h" +#include "plMessage.h" +#include "plRefMsg.h" #include "hsStream.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h index c9d8e159ee..761ed665f4 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plCursorChangeMsg_inc #define plCursorChangeMsg_inc -#include "pnMessage/plMessage.h" +#include "plMessage.h" #include "hsBitVector.h" class hsStream; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plFakeOutMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plFakeOutMsg.h index 07077981c2..e8cd173cd4 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plFakeOutMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plFakeOutMsg.h @@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // this message is to fake out a gadget to see if it would potentially trigger... // -#include "pnMessage/plMessage.h" +#include "plMessage.h" #include "hsBitVector.h" class hsStream; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h index 833e275655..d32fdb500d 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage.h" #include "hsResMgr.h" -#include "pnModifier/plSingleModifier.h" #include "hsGeometry3.h" diff --git a/Sources/Plasma/NucleusLib/pnMessage/plPipeResMakeMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plPipeResMakeMsg.h index ef8c90c926..52c7e55d7e 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plPipeResMakeMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plPipeResMakeMsg.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plPipeResMakeMsg_inc #define plPipeResMakeMsg_inc -#include "pnMessage/plMessage.h" +#include "plMessage.h" class plPipeline; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h index c1f96ff8f4..06bd549620 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plPlayerPageMsg_inc #define plPlayerPageMsg_inc -#include "pnMessage/plMessage.h" +#include "plMessage.h" #include "hsResMgr.h" #include "hsStream.h" diff --git a/Sources/Plasma/NucleusLib/pnMessage/plRemoteAvatarInfoMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plRemoteAvatarInfoMsg.h index 577d4617f9..90d595fc45 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plRemoteAvatarInfoMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plRemoteAvatarInfoMsg.h @@ -46,11 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // this message is to fake out a gadget to see if it would potentially trigger... // -#include "pnMessage/plMessage.h" - -class hsStream; -class hsResMgr; -class plKey; +#include "plMessage.h" class plRemoteAvatarInfoMsg : public plMessage { diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h index 66f4a4fade..d65096ddaf 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h @@ -42,14 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plSDLModifierMsg_INC #define plSDLModifierMsg_INC -#include "pnMessage/plMessage.h" +#include "plMessage.h" // // A msg sent to an SDL modifier to tell it send or recv state. // -class hsStream; -class hsResMgr; class plStateDataRecord; class plSDLModifierMsg : public plMessage { diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSDLNotificationMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSDLNotificationMsg.h index fa28dbefab..b24615fe36 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSDLNotificationMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSDLNotificationMsg.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plSDLNotificationMsg_inc #define plSDLNotificationMsg_inc -#include "pnMessage/plMessage.h" +#include "plMessage.h" class plSimpleStateVariable; class plSDLNotificationMsg : public plMessage diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSatisfiedMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSatisfiedMsg.h index 2d1fb42b3c..7b883829a6 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSatisfiedMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSatisfiedMsg.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plSatisfiedMsg_inc #define plSatisfiedMsg_inc -#include "pnMessage/plMessage.h" +#include "plMessage.h" class plSatisfiedMsg : public plMessage { diff --git a/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.h index 5880c09c9a..d62e4c6142 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.h @@ -45,9 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage.h" -class hsStream; -class hsResMgr; - // // Sent by server to confirm/deny a sharedState lock attempt. diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSharedStateMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSharedStateMsg.h index 9907bf11d2..6c7114abc0 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSharedStateMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSharedStateMsg.h @@ -45,9 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage.h" #include "pnNetCommon/plNetSharedState.h" -class hsStream; -class hsResMgr; - // // Msg from server containing generic sharedState // diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSimulationMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSimulationMsg.h index 771b038f01..3a0181bccd 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSimulationMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSimulationMsg.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLSIMULATIONMSG_H #define PLSIMULATIONMSG_H -#include "pnMessage/plMessage.h" +#include "plMessage.h" // PLSIMULATIONMSG // Virtual base class for all messages which are specific to the simulation interface diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSingleModMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSingleModMsg.h index cf7a2aee7c..28905760c9 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSingleModMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSingleModMsg.h @@ -46,10 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage.h" #include "hsBitVector.h" -class hsStream; -class hsResMgr; - - class plSingleModMsg : public plMessage { public: diff --git a/Sources/Plasma/NucleusLib/pnModifier/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnModifier/CMakeLists.txt index 68bd9c8c35..091a860b45 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnModifier/CMakeLists.txt @@ -16,6 +16,19 @@ set(pnModifier_SOURCES ) add_library(pnModifier STATIC ${pnModifier_HEADERS} ${pnModifier_SOURCES}) +target_link_libraries( + pnModifier + PUBLIC + CoreLib + pnFactory + pnKeyedObject + pnNetCommon + PRIVATE + pnMessage + plNetMessage + pnNucleusInc + pnSceneObject +) target_include_directories(pnModifier PRIVATE "${PLASMA_SOURCE_ROOT}/PubUtilLib") diff --git a/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.cpp b/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.cpp index 77458ea08c..7f43c3b53e 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.cpp +++ b/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.cpp @@ -39,26 +39,33 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" + #include "plConditionalObject.h" -#include "plLogicModBase.h" -plConditionalObject::plConditionalObject() : -bSatisfied(false), -fToggle(false), -fLogicMod(nil), -fReset(false) -{ +#include "hsStream.h" +plConditionalObject::plConditionalObject() + : bSatisfied(), + fToggle(), + fLogicMod(), + fReset() +{ } plConditionalObject::~plConditionalObject() { - } +void plConditionalObject::Read(hsStream* stream, hsResMgr* mgr) +{ + hsKeyedObject::Read(stream, mgr); + bSatisfied = stream->ReadBool(); + fToggle = stream->ReadBool(); +} -///////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////// - - +void plConditionalObject::Write(hsStream* stream, hsResMgr* mgr) +{ + hsKeyedObject::Write(stream, mgr); + stream->WriteBool(bSatisfied); + stream->WriteBool(fToggle); +} diff --git a/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.h b/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.h index 1298057602..d4ea321e5f 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.h +++ b/Sources/Plasma/NucleusLib/pnModifier/plConditionalObject.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/hsKeyedObject.h" #include "hsBitVector.h" -#include "pnNetCommon/plSynchedValue.h" class plLogicModBase; @@ -73,8 +72,8 @@ class plConditionalObject : public hsKeyedObject CLASSNAME_REGISTER( plConditionalObject ); GETINTERFACE_ANY( plConditionalObject, hsKeyedObject ); - virtual void Read(hsStream* stream, hsResMgr* mgr) { hsKeyedObject::Read(stream, mgr); bSatisfied = stream->ReadBool(); fToggle = stream->ReadBool();} - virtual void Write(hsStream* stream, hsResMgr* mgr){ hsKeyedObject::Write(stream, mgr); stream->WriteBool( bSatisfied ); stream->WriteBool(fToggle);} + void Read(hsStream* stream, hsResMgr* mgr) override; + void Write(hsStream* stream, hsResMgr* mgr) override; virtual void SetLogicMod(plLogicModBase* pMod) { fLogicMod = pMod; } diff --git a/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.h b/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.h index 5e6033567f..793cef789b 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.h +++ b/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plLogicModBase_inc #include "plSingleModifier.h" -#include "pnNetCommon/plSynchedValue.h" #include "hsTemplates.h" class plConditionalObject; diff --git a/Sources/Plasma/NucleusLib/pnModifier/plMultiModifier.h b/Sources/Plasma/NucleusLib/pnModifier/plMultiModifier.h index e3bb149156..83c9360fe2 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plMultiModifier.h +++ b/Sources/Plasma/NucleusLib/pnModifier/plMultiModifier.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plModifier.h" #include "hsBitVector.h" -#include "pnNetCommon/plSynchedValue.h" #include "hsTemplates.h" class plSceneObject; diff --git a/Sources/Plasma/NucleusLib/pnModifier/plSingleModifier.h b/Sources/Plasma/NucleusLib/pnModifier/plSingleModifier.h index 674197f308..e04b397a5b 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plSingleModifier.h +++ b/Sources/Plasma/NucleusLib/pnModifier/plSingleModifier.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plModifier.h" #include "hsBitVector.h" -#include "pnNetCommon/plSynchedValue.h" class plSceneObject; class plSingleModMsg; diff --git a/Sources/Plasma/NucleusLib/pnNetBase/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetBase/CMakeLists.txt index 0c08995a92..382b72a538 100644 --- a/Sources/Plasma/NucleusLib/pnNetBase/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetBase/CMakeLists.txt @@ -15,6 +15,13 @@ set(pnNetBase_SOURCES ) add_library(pnNetBase STATIC ${pnNetBase_HEADERS} ${pnNetBase_SOURCES}) +target_link_libraries( + pnNetBase + PUBLIC + CoreLib + PRIVATE + string_theory +) source_group("Header Files" FILES ${pnNetBase_HEADERS}) source_group("Source Files" FILES ${pnNetBase_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt index 52122964fa..b24a7d7e57 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt @@ -12,6 +12,17 @@ set(pnNetCli_SOURCES ) add_library(pnNetCli STATIC ${pnNetCli_HEADERS} ${pnNetCli_SOURCES}) +target_link_libraries( + pnNetCli + PUBLIC + CoreLib + pnEncryption + PRIVATE + pnAsyncCore + pnNetBase + pnUtils + pnUUID +) source_group("Header Files" FILES ${pnNetCli_HEADERS}) source_group("Source Files" FILES ${pnNetCli_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index d2bd4cc422..e58ebffc7f 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -27,14 +27,18 @@ set(pnNetCommon_SOURCES ) add_library(pnNetCommon STATIC ${pnNetCommon_HEADERS} ${pnNetCommon_SOURCES}) -target_link_libraries(pnNetCommon pnNucleusInc) -target_link_libraries(pnNetCommon pnDispatch) -target_link_libraries(pnNetCommon pnFactory) -target_link_libraries(pnNetCommon pnKeyedObject) -target_link_libraries(pnNetCommon pnUUID) -if(WIN32) - target_link_libraries(pnNetCommon ws2_32) -endif(WIN32) +target_link_libraries( + pnNetCommon + PUBLIC + CoreLib + pnFactory + pnKeyedObject + pnUUID + PRIVATE + pnMessage + pnSceneObject + $<$:ws2_32> +) source_group("Header Files" FILES ${pnNetCommon_HEADERS}) source_group("Source Files" FILES ${pnNetCommon_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp index 6c41b2413a..805aa856c8 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetApp.h" #include "plNetGroup.h" #include "hsResMgr.h" -#include "pnSceneObject/plSceneObject.h" #include "pnKeyedObject/plKey.h" #include "pnMessage/plSDLModifierMsg.h" #include "pnMessage/plSetNetGroupIDMsg.h" diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt index 2e890667aa..0d6f3440c7 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt @@ -33,6 +33,17 @@ add_library(pnNetProtocol STATIC ${pnNetProtocol_HEADERS} ${pnNetProtocol_PRIVAT ${pnNetProtocol_PROTO_CLI2AUTH} ${pnNetProtocol_PROTO_CLI2FILE} ${pnNetProtocol_PROTO_CLI2GAME} ${pnNetProtocol_PROTO_CLI2GK} ) +target_link_libraries( + pnNetProtocol + PUBLIC + CoreLib + pnUUID + PRIVATE + pnAsyncCore + pnNetBase + pnNetCli + pnUtils +) source_group("Header Files" FILES ${pnNetProtocol_HEADERS}) source_group("Private" FILES ${pnNetProtocol_PRIVATE}) diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt index 12c1a9730e..1b2f750fd4 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt @@ -18,7 +18,18 @@ set(pnSceneObject_SOURCES ) add_library(pnSceneObject STATIC ${pnSceneObject_HEADERS} ${pnSceneObject_SOURCES}) -target_link_libraries(pnSceneObject CoreLib pnKeyedObject pnNetCommon) +target_link_libraries( + pnSceneObject + PUBLIC + CoreLib + pnFactory + pnKeyedObject + pnNetCommon + PRIVATE + pnMessage + pnNetCommon + pnNucleusInc +) source_group("Header Files" FILES ${pnSceneObject_HEADERS}) source_group("Source Files" FILES ${pnSceneObject_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.h b/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.h index 5a931a195c..a0d5ff8fe0 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.h +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.h @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plObjInterface.h" #include "hsTemplates.h" #include "hsMatrix44.h" -#include "pnNetCommon/plSynchedValue.h" class hsStream; class hsResMgr; diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plObjInterface.h b/Sources/Plasma/NucleusLib/pnSceneObject/plObjInterface.h index 9c246c76c9..058f96213b 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plObjInterface.h +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plObjInterface.h @@ -44,11 +44,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plInterface_inc #include "pnKeyedObject/hsKeyedObject.h" -#include "pnMessage/plRefMsg.h" #include "plSceneObject.h" #include "hsStream.h" #include "pnNetCommon/plSynchedObject.h" -#include "pnNetCommon/plSynchedValue.h" #include "hsBitVector.h" class hsResMgr; diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.h b/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.h index ad0341deae..a1119df40d 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.h +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.h @@ -45,11 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsBitVector.h" #include "pnKeyedObject/hsKeyedObject.h" -#include "pnMessage/plRefMsg.h" #include "pnNetCommon/plSynchedObject.h" -#include "pnNetCommon/plSynchedValue.h" -#include "pnModifier/plModifier.h" #include "hsStream.h" +#include "hsTemplates.h" class plObjInterface; class plDrawInterface; @@ -62,6 +60,7 @@ class hsResMgr; class plMessage; class plDispatchBase; struct hsMatrix44; +class plModifier; // The following two aren't dragging the Conversion side into the runtime. // They are just to let the converter do things we don't want done at runtime. @@ -70,8 +69,6 @@ class plMaxNode; class plMaxNodeBase; class plSceneObject : public plSynchedObject { - friend class plSynchedValueBase; -private: plDrawInterface* GetVolatileDrawInterface() { return fDrawInterface; } plSimulationInterface* GetVolatileSimulationInterface() { return fSimulationInterface; } plCoordinateInterface* GetVolatileCoordinateInterface() { return fCoordinateInterface; } diff --git a/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt index 5c64e67402..6a63b30c0c 100644 --- a/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt @@ -11,7 +11,15 @@ set(pnTimer_SOURCES ) add_library(pnTimer STATIC ${pnTimer_HEADERS} ${pnTimer_SOURCES}) -target_link_libraries(pnTimer CoreLib) +target_link_libraries( + pnTimer + PUBLIC + CoreLib + PRIVATE + pnKeyedObject + pnMessage + pnNucleusInc +) source_group("Header Files" FILES ${pnTimer_HEADERS}) source_group("Source Files" FILES ${pnTimer_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt index 43aad5353f..0cc5fd1157 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -25,13 +25,15 @@ set(pnUUID_HEADERS ) add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) -target_link_libraries(pnUUID CoreLib) -if(WIN32) - target_link_libraries(pnUUID pnUtils) - target_link_libraries(pnUUID rpcrt4) -elseif(NOT APPLE) - target_link_libraries(pnUUID ${Uuid_LIBRARIES}) -endif(WIN32) +target_link_libraries( + pnUUID + PUBLIC + CoreLib + string_theory + PRIVATE + $<$:${Uuid_LIBRARIES}> + $<$:rpcrt4> +) source_group("Source Files" FILES ${pnUUID_SOURCES}) source_group("Header Files" FILES ${pnUUID_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index b8d68c4999..07903700e9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -20,8 +20,14 @@ set(pnUtils_SOURCES ) add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_SOURCES}) - -target_link_libraries(pnUtils CoreLib) +target_link_libraries( + pnUtils + PUBLIC + CoreLib + pnEncryption + PRIVATE + OpenSSL::Crypto +) source_group("Header Files" FILES ${pnUtils_HEADERS}) source_group("Source Files" FILES ${pnUtils_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Pch.h b/Sources/Plasma/NucleusLib/pnUtils/Pch.h index 5fe130ef88..53de5f8200 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Pch.h @@ -56,11 +56,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #endif -#ifdef HS_BUILD_FOR_WIN32 -#include -#define NTDDI_XP NTDDI_WINXP //Because Microsoft sucks. -#include -#include // for SHGetSpecialFolderPath -#endif - #endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 10643fec16..e2af1bc83f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -45,6 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ +#include "Pch.h" + #include "pnUtCrypt.h" #include "pnUtStr.h" #include "pnUtTime.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h index 50eee8fb05..5a21b7ec42 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H -#include "Pch.h" #include "pnEncryption/plChecksum.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp index 92cfb159cc..9b5e63696a 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ +#include "Pch.h" #include "pnUtHash.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index 317432a5a6..37a2fdad75 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H -#include "Pch.h" #include "pnUtList.h" #include "pnUtStr.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp index 7ca34e6deb..aea37ed1ac 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ +#include "Pch.h" #include "pnUtList.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index 209708b6c4..04b8325d57 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -48,8 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H -#include "Pch.h" - /**************************************************************************** * * Constants diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index 2c3b7c1fac..f376d69e16 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H -#include "Pch.h" +#include /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp index 7618620b24..3555b78ad1 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp @@ -45,10 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ +#include "Pch.h" #include "pnUtStr.h" -#include - /***************************************************************************** * * Private data diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index 1470a896fd..4c699adacf 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -48,9 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H -#include "Pch.h" -#include - /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp index 8db63da2a4..7acdc96f29 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ + +#include "Pch.h" #include "pnUtTime.h" #if HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h index 4aab2e58a8..97f9334d69 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h @@ -48,8 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H -#include "Pch.h" - /***************************************************************************** * * Time query functions diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp index 82cdbf4c5e..84acd73f66 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp @@ -57,6 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // other #include "plInterp/plAnimEaseTypes.h" #include "plMessage/plAnimCmdMsg.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plSDLModifierMsg.h" #include "pnMessage/plSDLNotificationMsg.h" #include "pnMessage/plTimeMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp index 240d755f32..dbad991db1 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp @@ -54,7 +54,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsResMgr.h" #include "plgDispatch.h" #include "plAudioSystem.h" -#include "pnMessage/plAudioSysMsg.h" +#include "pnMessage/plAudioSysMsg.h" +#include "pnMessage/plRefMsg.h" #ifdef EAX_SDK_AVAILABLE #include diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp index 103932bbf1..de683dd0b8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfMessage/plArmatureEffectMsg.h" #include "plMessage/plAnimCmdMsg.h" #include "plMessage/plAvatarMsg.h" +#include "pnMessage/plRefMsg.h" #include "plArmatureMod.h" #include "pnSceneObject/plAudioInterface.h" #include "plAudio/plSound.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index 3c1bf540e3..2c6c471104 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -48,6 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plSwimRegion.h" #include "plArmatureMod.h" +#include "pnMessage/plRefMsg.h" + void plSwimRegionInterface::Read(hsStream* s, hsResMgr* mgr) { plObjInterface::Read(s, mgr); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp index fc9cbb970c..0c698e5230 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plSpanTemplate.h" #include "plCluster.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plTimeMsg.h" #include "plScene/plVisMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp index 96b2547b95..d41d8c2683 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp @@ -62,6 +62,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plSurface/plLayerInterface.h" #include "plMessage/plDynaDecalEnableMsg.h" +#include "pnMessage/plRefMsg.h" #include "plMessage/plRippleShapeMsg.h" #include "plMessage/plAvatarMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp index 0b9bba908f..c4f042fdca 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp @@ -56,6 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsResMgr.h" #include "plgDispatch.h" +#include "pnMessage/plRefMsg.h" #include "plMessage/plRenderMsg.h" #include "plSharedMesh.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequenceSDLMod.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequenceSDLMod.cpp index 4c381d273c..86b6dba3c7 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequenceSDLMod.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequenceSDLMod.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plSharedMesh.h" #include "hsResMgr.h" #include "pnSceneObject/plSceneObject.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plSDLModifierMsg.h" #include "plSDL/plSDL.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp index 63b5dbeb73..b9eb447c82 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp @@ -47,6 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plDrawableSpans.h" #include "plMorphSequence.h" +#include "pnMessage/plRefMsg.h" + plSharedMesh::plSharedMesh() : fMorphSet(nil), fFlags(0) { } diff --git a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt index e9650909db..b09766dc8a 100644 --- a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt @@ -15,7 +15,11 @@ set(plFile_HEADERS ) add_library(plFile STATIC ${plFile_SOURCES} ${plFile_HEADERS}) -target_link_libraries(plFile CoreLib plUnifiedTime) +target_link_libraries( + plFile + PUBLIC + CoreLib +) source_group("Source Files" FILES ${plFile_SOURCES}) source_group("Header Files" FILES ${plFile_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp index 70c8bdaeae..0d26eaec17 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "hsResMgr.h" +#include "pnMessage/plRefMsg.h" + //////////////////////////////////////////////////////////////////////////////////////// // Base hard and complex diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp index a05b040a6d..064870383a 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp @@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plVolumeIsect.h" #include "plSoftVolumeTypes.h" +#include "pnMessage/plRefMsg.h" + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h index 1563d3d205..40095f2694 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plReplaceGeometryMsg_inc #include "pnMessage/plMessage.h" +#include "pnMessage/plRefMsg.h" class plSharedMesh; class hsGMaterial; diff --git a/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.cpp index f661947792..d8621b6694 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" #include "plNetMessage/plNetMsgHelpers.h" #include "pnMessage/plNotifyMsg.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plTimeMsg.h" #include "pnMessage/plCmdIfaceModMsg.h" #include "plMessage/plAnimCmdMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp index f38bec2660..aa579706d4 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnEncryption/plRandom.h" #include "plParticleSystem.h" #include "plMessage/plParticleUpdateMsg.h" +#include "pnMessage/plRefMsg.h" #include diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp index 12bd6ab111..1cf783bfa4 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnSceneObject/plSceneObject.h" #include "pnSceneObject/plDrawInterface.h" #include "pnSceneObject/plCoordinateInterface.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plTimeMsg.h" #include "plMessage/plRenderMsg.h" #include "plMessage/plAgeLoadedMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.cpp index 2c61e02b1c..0b818ac303 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.cpp @@ -62,6 +62,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnSceneObject/plSceneObject.h" #include "pnSceneObject/plCoordinateInterface.h" #include "pnSceneObject/plDrawInterface.h" +#include "pnMessage/plRefMsg.h" #include "pnMessage/plTimeMsg.h" #include "plMessage/plRenderRequestMsg.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp b/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp index 68604cc411..bb39a07b89 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plRelevanceMgr.h" #include "plRelevanceRegion.h" #include "plIntersect/plRegionBase.h" +#include "pnMessage/plRefMsg.h" #include "hsStream.h" #include "hsStringTokenizer.h" diff --git a/Sources/Plasma/PubUtilLib/plScene/plRelevanceRegion.cpp b/Sources/Plasma/PubUtilLib/plScene/plRelevanceRegion.cpp index 5368b71d8d..c33c0e44ad 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plRelevanceRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plRelevanceRegion.cpp @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plRelevanceRegion.h" #include "plRelevanceMgr.h" #include "plIntersect/plRegionBase.h" +#include "pnMessage/plRefMsg.h" void plRelevanceRegion::Read(hsStream* s, hsResMgr* mgr) { diff --git a/Sources/Plasma/PubUtilLib/plScene/plVisRegion.cpp b/Sources/Plasma/PubUtilLib/plScene/plVisRegion.cpp index dfc1c07e99..8a578c12bd 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plVisRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plVisRegion.cpp @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plVisMgr.h" #include "pnMessage/plEnableMsg.h" +#include "pnMessage/plRefMsg.h" #include "plIntersect/plRegionBase.h" plVisRegion::plVisRegion() From bdfcfa6915979bbd87ff04c0d83fb947b73818e2 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 20 Jan 2021 23:22:00 -0500 Subject: [PATCH 2/5] Use pnUtils PCH and unity build it. Original time: 6s, Now: 2s. --- Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 07903700e9..06e1acd09b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -20,6 +20,7 @@ set(pnUtils_SOURCES ) add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_SOURCES}) +plasma_optimize_target(pnUtils PRECOMPILED_HEADERS Pch.h UNITY_BUILD) target_link_libraries( pnUtils PUBLIC From 5a73e19dac537ffbc5a3e2d3be2ca0c879b7b4b7 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 20 Jan 2021 23:41:01 -0500 Subject: [PATCH 3/5] Throw away old plServers net-common stuff. --- .../Plasma/FeatureLib/pfPython/CMakeLists.txt | 3 - .../pfPython/pyNetServerSessionInfo.cpp | 48 --- .../pfPython/pyNetServerSessionInfo.h | 137 ------- .../pfPython/pyNetServerSessionInfoGlue.cpp | 372 ------------------ .../Plasma/NucleusLib/inc/plCreatableIndex.h | 2 +- .../NucleusLib/pnNetCommon/CMakeLists.txt | 2 - .../NucleusLib/pnNetCommon/plNetServers.cpp | 144 ------- .../NucleusLib/pnNetCommon/plNetServers.h | 164 -------- .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 1 - .../plNetClient/plNetClientMgrVoice.cpp | 1 - .../PubUtilLib/plNetClient/plNetLinkingMgr.h | 8 - .../plNetCommon/plNetCommonCreatable.h | 1 - .../plNetCommon/plNetServerSessionInfo.cpp | 266 ------------- .../plNetCommon/plNetServerSessionInfo.h | 81 ---- .../PubUtilLib/plNetMessage/plNetMessage.h | 1 - .../plNetMessage/plNetMsgHelpers.cpp | 1 - 16 files changed, 1 insertion(+), 1231 deletions(-) delete mode 100644 Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.cpp delete mode 100644 Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h delete mode 100644 Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h diff --git a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt index b2d53fd065..e4e0eb8331 100644 --- a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt @@ -57,7 +57,6 @@ set(pfPython_SOURCES pyMatrix44.cpp pyMoviePlayer.cpp pyNetLinkingMgr.cpp - pyNetServerSessionInfo.cpp pyNotify.cpp pyPlayer.cpp pySceneObject.cpp @@ -144,7 +143,6 @@ set(pfPython_HEADERS pyMatrix44.h pyMoviePlayer.h pyNetLinkingMgr.h - pyNetServerSessionInfo.h pyNotify.h pyObjectRef.h pyPlayer.h @@ -227,7 +225,6 @@ set(pfPython_GLUE pyMatrix44Glue.cpp pyMoviePlayerGlue.cpp pyNetLinkingMgrGlue.cpp - pyNetServerSessionInfoGlue.cpp pyNotifyGlue.cpp pyPlayerGlue.cpp pySceneObjectGlue.cpp diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.cpp deleted file mode 100644 index 0f33b9bf93..0000000000 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ - - -#include "pyNetServerSessionInfo.h" - -//////////////////////////////////////////////////////////////////// - -plNetServerSessionInfo pyNetServerSessionInfoRef::fDefaultServerSessionInfo; // for python glue use only, do NOT use \ No newline at end of file diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h deleted file mode 100644 index 916bb9ac55..0000000000 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h +++ /dev/null @@ -1,137 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -#ifndef pyNetServerSessionInfo_h_inc -#define pyNetServerSessionInfo_h_inc - -#include "HeadSpin.h" -#include "plNetCommon/plNetServerSessionInfo.h" -#include "pnUUID/pnUUID.h" -#include "pyGlueHelpers.h" - -////////////////////////////////////////////////////////////////////// -// -// pyNetServerSessionInfo, pyNetServerSessionInfoRef -// - wrapper classes to provide interface to the plNetServerSessionInfo -// -////////////////////////////////////////////////////////////////////// - -class pyNetServerSessionInfo -{ -private: - plNetServerSessionInfo fInfo; - mutable plUUID fServerGuid; // for GetServerGuid() - -protected: - pyNetServerSessionInfo() {} - pyNetServerSessionInfo(const plNetServerSessionInfo & info) { fInfo.CopyFrom(&info); } - -public: - // required functions for PyObject interoperability - PYTHON_CLASS_NEW_FRIEND(ptNetServerSessionInfo); - PYTHON_CLASS_NEW_DEFINITION; - static PyObject *New(const plNetServerSessionInfo &info); - PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyNetServerSessionInfo object - PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyNetServerSessionInfo); // converts a PyObject to a pyNetServerSessionInfo (throws error if not correct type) - - static void AddPlasmaClasses(PyObject *m); - - plNetServerSessionInfo & ServerInfo() { return fInfo; } - - void SetServerName(const ST::string & val) { fInfo.SetServerName( val ); } - void SetServerType(uint8_t val) { fInfo.SetServerType( val ); } - void SetServerAddr(const ST::string & val) { fInfo.SetServerAddr( val ); } - void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); } - void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); } - bool HasServerName() const { return fInfo.HasServerName(); } - bool HasServerType() const { return fInfo.HasServerType(); } - bool HasServerAddr() const { return fInfo.HasServerAddr(); } - bool HasServerPort() const { return fInfo.HasServerPort(); } - bool HasServerGuid() const { return fInfo.HasServerGuid(); } - ST::string GetServerName() const { return fInfo.GetServerName(); } - uint8_t GetServerType() const { return fInfo.GetServerType(); } - ST::string GetServerAddr() const { return fInfo.GetServerAddr(); } - uint16_t GetServerPort() const { return fInfo.GetServerPort(); } - const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); } -}; - - -class pyNetServerSessionInfoRef -{ -private: - static plNetServerSessionInfo fDefaultServerSessionInfo; // created so a default constructor could be made for python. Do NOT use - - plNetServerSessionInfo& fInfo; - mutable plUUID fServerGuid; // for GetServerGuid() - -protected: - pyNetServerSessionInfoRef(): fInfo(fDefaultServerSessionInfo) {} // only here for the python glue... do NOT call directly - pyNetServerSessionInfoRef( plNetServerSessionInfo& info ): fInfo( info ) {} - plNetServerSessionInfo & ServerInfo() { return fInfo; } - -public: - // required functions for PyObject interoperability - PYTHON_CLASS_NEW_FRIEND(ptNetServerSessionInfoRef); - static PyObject *New(plNetServerSessionInfo &info); - PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyNetServerSessionInfoRef object - PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyNetServerSessionInfoRef); // converts a PyObject to a pyNetServerSessionInfoRef (throws error if not correct type) - - static void AddPlasmaClasses(PyObject *m); - - void SetServerName(const ST::string & val) { fInfo.SetServerName( val ); } - void SetServerType(uint8_t val) { fInfo.SetServerType( val ); } - void SetServerAddr(const ST::string & val) { fInfo.SetServerAddr( val ); } - void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); } - void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); } - bool HasServerName() const { return fInfo.HasServerName(); } - bool HasServerType() const { return fInfo.HasServerType(); } - bool HasServerAddr() const { return fInfo.HasServerAddr(); } - bool HasServerPort() const { return fInfo.HasServerPort(); } - bool HasServerGuid() const { return fInfo.HasServerGuid(); } - ST::string GetServerName() const { return fInfo.GetServerName(); } - uint8_t GetServerType() const { return fInfo.GetServerType(); } - ST::string GetServerAddr() const { return fInfo.GetServerAddr(); } - uint16_t GetServerPort() const { return fInfo.GetServerPort(); } - const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); } -}; - - -#endif // pyNetServerSessionInfo_h_inc diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp deleted file mode 100644 index 7cd27863aa..0000000000 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ - -#include - -#include "pyNetServerSessionInfo.h" - -// glue functions -PYTHON_CLASS_DEFINITION(ptNetServerSessionInfo, pyNetServerSessionInfo); - -PYTHON_DEFAULT_NEW_DEFINITION(ptNetServerSessionInfo, pyNetServerSessionInfo) -PYTHON_DEFAULT_DEALLOC_DEFINITION(ptNetServerSessionInfo) - -PYTHON_INIT_DEFINITION(ptNetServerSessionInfo, args, keywords) -{ - PYTHON_RETURN_INIT_OK; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfo, setServerName, args) -{ - char* name; - if (!PyArg_ParseTuple(args, "s", &name)) - { - PyErr_SetString(PyExc_TypeError, "setServerName expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerName(name); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfo, setServerType, args) -{ - unsigned char serverType; - if (!PyArg_ParseTuple(args, "b", &serverType)) - { - PyErr_SetString(PyExc_TypeError, "setServerType expects an unsigned 8-bit int"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerType(serverType); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfo, setServerAddr, args) -{ - char* addr; - if (!PyArg_ParseTuple(args, "s", &addr)) - { - PyErr_SetString(PyExc_TypeError, "setServerAddr expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerAddr(addr); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfo, setServerPort, args) -{ - unsigned short port; - if (!PyArg_ParseTuple(args, "h", &port)) - { - PyErr_SetString(PyExc_TypeError, "setServerPort expects a unsigned short"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerPort(port); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfo, setServerGuid, args) -{ - char* guid; - if (!PyArg_ParseTuple(args, "s", &guid)) - { - PyErr_SetString(PyExc_TypeError, "setServerGuid expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerGuid(guid); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerName) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerName()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerType) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerType()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerAddr) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerAddr()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerPort) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerPort()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerGuid) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerGuid()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerName) -{ - return PyUnicode_FromSTString(self->fThis->GetServerName()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerType) -{ - return PyLong_FromLong(self->fThis->GetServerType()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerAddr) -{ - return PyUnicode_FromSTString(self->fThis->GetServerAddr()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerPort) -{ - return PyLong_FromLong(self->fThis->GetServerPort()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerGuid) -{ - return PyUnicode_FromString(self->fThis->GetServerGuid()); -} - -PYTHON_START_METHODS_TABLE(ptNetServerSessionInfo) - PYTHON_METHOD(ptNetServerSessionInfo, setServerName, "Params: name\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfo, setServerType, "Params: type\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfo, setServerAddr, "Params: addr\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfo, setServerPort, "Params: port\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfo, setServerGuid, "Params: guid\nUNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, hasServerName, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, hasServerType, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, hasServerAddr, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, hasServerPort, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, hasServerGuid, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, getServerName, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, getServerType, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, getServerAddr, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, getServerPort, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfo, getServerGuid, "UNKNOWN"), -PYTHON_END_METHODS_TABLE; - -// Type structure definition -PLASMA_DEFAULT_TYPE(ptNetServerSessionInfo, "Basic server session info class"); - -// required functions for PyObject interoperability -PYTHON_CLASS_NEW_IMPL(ptNetServerSessionInfo, pyNetServerSessionInfo) - -PyObject *pyNetServerSessionInfo::New(const plNetServerSessionInfo &info) -{ - ptNetServerSessionInfo *newObj = (ptNetServerSessionInfo*)ptNetServerSessionInfo_type.tp_new(&ptNetServerSessionInfo_type, NULL, NULL); - newObj->fThis->fInfo.CopyFrom(&info); - return (PyObject*)newObj; -} - -PYTHON_CLASS_CHECK_IMPL(ptNetServerSessionInfo, pyNetServerSessionInfo) -PYTHON_CLASS_CONVERT_FROM_IMPL(ptNetServerSessionInfo, pyNetServerSessionInfo) - -/////////////////////////////////////////////////////////////////////////// -// -// AddPlasmaClasses - the python module definitions -// -void pyNetServerSessionInfo::AddPlasmaClasses(PyObject *m) -{ - PYTHON_CLASS_IMPORT_START(m); - PYTHON_CLASS_IMPORT(m, ptNetServerSessionInfo); - PYTHON_CLASS_IMPORT_END(m); -} - -// glue functions -PYTHON_CLASS_DEFINITION(ptNetServerSessionInfoRef, pyNetServerSessionInfoRef); - -PYTHON_DEFAULT_NEW_DEFINITION(ptNetServerSessionInfoRef, pyNetServerSessionInfoRef) -PYTHON_DEFAULT_DEALLOC_DEFINITION(ptNetServerSessionInfoRef) - -PYTHON_NO_INIT_DEFINITION(ptNetServerSessionInfoRef) - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfoRef, setServerName, args) -{ - char* name; - if (!PyArg_ParseTuple(args, "s", &name)) - { - PyErr_SetString(PyExc_TypeError, "setServerName expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerName(name); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfoRef, setServerType, args) -{ - unsigned char serverType; - if (!PyArg_ParseTuple(args, "b", &serverType)) - { - PyErr_SetString(PyExc_TypeError, "setServerType expects an unsigned 8-bit int"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerType(serverType); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfoRef, setServerAddr, args) -{ - char* addr; - if (!PyArg_ParseTuple(args, "s", &addr)) - { - PyErr_SetString(PyExc_TypeError, "setServerAddr expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerAddr(addr); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfoRef, setServerPort, args) -{ - unsigned short port; - if (!PyArg_ParseTuple(args, "h", &port)) - { - PyErr_SetString(PyExc_TypeError, "setServerPort expects a unsigned short"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerPort(port); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION(ptNetServerSessionInfoRef, setServerGuid, args) -{ - char* guid; - if (!PyArg_ParseTuple(args, "s", &guid)) - { - PyErr_SetString(PyExc_TypeError, "setServerGuid expects a string"); - PYTHON_RETURN_ERROR; - } - self->fThis->SetServerGuid(guid); - PYTHON_RETURN_NONE; -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerName) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerName()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerType) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerType()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerAddr) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerAddr()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerPort) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerPort()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerGuid) -{ - PYTHON_RETURN_BOOL(self->fThis->HasServerGuid()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerName) -{ - return PyUnicode_FromSTString(self->fThis->GetServerName()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerType) -{ - return PyLong_FromLong(self->fThis->GetServerType()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerAddr) -{ - return PyUnicode_FromSTString(self->fThis->GetServerAddr()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerPort) -{ - return PyLong_FromLong(self->fThis->GetServerPort()); -} - -PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerGuid) -{ - return PyUnicode_FromString(self->fThis->GetServerGuid()); -} - -PYTHON_START_METHODS_TABLE(ptNetServerSessionInfoRef) - PYTHON_METHOD(ptNetServerSessionInfoRef, setServerName, "Params: name\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfoRef, setServerType, "Params: type\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfoRef, setServerAddr, "Params: addr\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfoRef, setServerPort, "Params: port\nUNKNOWN"), - PYTHON_METHOD(ptNetServerSessionInfoRef, setServerGuid, "Params: guid\nUNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, hasServerName, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, hasServerType, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, hasServerAddr, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, hasServerPort, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, hasServerGuid, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, getServerName, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, getServerType, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, getServerAddr, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, getServerPort, "UNKNOWN"), - PYTHON_METHOD_NOARGS(ptNetServerSessionInfoRef, getServerGuid, "UNKNOWN"), -PYTHON_END_METHODS_TABLE; - -// Type structure definition -PLASMA_DEFAULT_TYPE(ptNetServerSessionInfoRef, "Basic server session info class"); - -// required functions for PyObject interoperability -PyObject *pyNetServerSessionInfoRef::New(plNetServerSessionInfo &info) -{ - ptNetServerSessionInfoRef *newObj = (ptNetServerSessionInfoRef*)ptNetServerSessionInfoRef_type.tp_new(&ptNetServerSessionInfoRef_type, NULL, NULL); - newObj->fThis->fInfo.CopyFrom(&info); - return (PyObject*)newObj; -} - -PYTHON_CLASS_CHECK_IMPL(ptNetServerSessionInfoRef, pyNetServerSessionInfoRef) -PYTHON_CLASS_CONVERT_FROM_IMPL(ptNetServerSessionInfoRef, pyNetServerSessionInfoRef) - -/////////////////////////////////////////////////////////////////////////// -// -// AddPlasmaClasses - the python module definitions -// -void pyNetServerSessionInfoRef::AddPlasmaClasses(PyObject *m) -{ - PYTHON_CLASS_IMPORT_START(m); - PYTHON_CLASS_IMPORT(m, ptNetServerSessionInfoRef); - PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file diff --git a/Sources/Plasma/NucleusLib/inc/plCreatableIndex.h b/Sources/Plasma/NucleusLib/inc/plCreatableIndex.h index 386dd43d17..730ab628c7 100644 --- a/Sources/Plasma/NucleusLib/inc/plCreatableIndex.h +++ b/Sources/Plasma/NucleusLib/inc/plCreatableIndex.h @@ -520,7 +520,7 @@ CLASS_INDEX_LIST_START CLASS_INDEX(plNetServerMsgFindProcess), CLASS_INDEX(plNetServerMsgProcessFound), CLASS_INDEX(plNetMsgRoutingInfo), - CLASS_INDEX(plNetServerSessionInfo), + CLASS_INDEX(UNUSED_plNetServerSessionInfo), CLASS_INDEX(plSimulationMsg), CLASS_INDEX(plSimulationSynchMsg), CLASS_INDEX(plHKSimulationSynchMsg), diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index e58ebffc7f..7f97703a38 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -4,7 +4,6 @@ set(pnNetCommon_HEADERS plNetAddress.h plNetApp.h plNetGroup.h - plNetServers.h plNetSharedState.h plSDLTypes.h plSynchedObject.h @@ -18,7 +17,6 @@ set(pnNetCommon_SOURCES plNetAddress.cpp plNetApp.cpp plNetGroup.cpp - plNetServers.cpp plNetSharedState.cpp plSDLTypes.cpp plSynchedObject.cpp diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.cpp deleted file mode 100644 index 4ea2f4108c..0000000000 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ - -#include "plNetServers.h" - - -// Server Defns - -const char* plNetServerConstants::ServerPrograms[] = -{ -#ifndef HS_DEBUGGING -#if HS_BUILD_FOR_WIN32 - "plNetServerAgent.exe", - "plNetLobbyServer.exe", - "plNetGameServer.exe", - "plNetVaultServer.exe", - "plNetAuthServer.exe", - "plNetAdminServer.exe", - "plNetLookupServer.exe", -#elif HS_BUILD_FOR_UNIX - "plNetServerAgent", - "plNetLobbyServer", - "plNetGameServer", - "plNetVaultServer", - "plNetAuthServer", - "plNetAdminServer", - "plNetLookupServer", -#else -#error "No servers work on this Platform!" -#endif -#else // Debug -#if HS_BUILD_FOR_WIN32 - "plNetServerAgent_dbg.exe", - "plNetLobbyServer_dbg.exe", - "plNetGameServer_dbg.exe", - "plNetVaultServer_dbg.exe", - "plNetAuthServer_dbg.exe", - "plNetAdminServer_dbg.exe", - "plNetLookupServer_dbg.exe", -#elif HS_BUILD_FOR_UNIX - "plNetServerAgent.dbg", - "plNetLobbyServer.dbg", - "plNetGameServer.dbg", - "plNetVaultServer.dbg", - "plNetAuthServer.dbg", - "plNetAdminServer.dbg", - "plNetLookupServer.dbg", -#else -#error "No servers work on this Platform!" -#endif -#endif -}; - -// -// STATIC -// -const char* plNetServerConstants::GetServerName(int type) -{ - switch(type) - { - default: -// hsAssert(false, "unknown type"); // not the right place to catch this problem. - return "UNKNOWN"; - case kAgent: - return plNetServerAgentConstants::GetName(); - case kLobby: - return plNetLobbyServerConstants::GetName(); - case kGame: - return plNetGameServerConstants::GetName(); - case kVault: - return plNetVaultServerConstants::GetName(); - case kAuth: - return plNetAuthServerConstants::GetName(); - case kAdmin: - return plNetAdminServerConstants::GetName(); - case kLookup: - return plNetLookupServerConstants::GetName(); - case kClient: - return "plClient"; - } -} - -uint16_t plNetServerConstants::GetPort(int type) -{ - switch(type) - { - default: -// hsAssert(false, "unknown type"); // not the right place to catch this problem. - return 0; - case kGame: - return 0; - case kAgent: - return plNetServerAgentConstants::GetPort(); - case kLobby: - return plNetLobbyServerConstants::GetPort(); - case kVault: - return plNetVaultServerConstants::GetPort(); - case kAuth: - return plNetAuthServerConstants::GetPort(); - case kAdmin: - return plNetAdminServerConstants::GetPort(); - case kLookup: - return plNetLookupServerConstants::GetPort(); - } -} diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h deleted file mode 100644 index 97baf1afbe..0000000000 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h +++ /dev/null @@ -1,164 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -#ifndef PL_NET_SERVERS_H -#define PL_NET_SERVERS_H - -// -// Server Declarations and Constants -// - -#include "HeadSpin.h" - -// -// Windows Class Name for All Servers -// -#define PARABLE_WINCLASSNAME "ParableServer" -#define PARABLE_PLS_WINCLASSNAME "ParableServer_PLS" - - -class plNetServerConstants -{ -public: - enum ServerTypes // Changing the order WILL affect Data including Databases!!! - { - kInvalidLo, - kAgent, - kLobby, - kGame, - kVault, - kAuth, - kAdmin, - kLookup, - - kClient, - kInvalidHi, - }; -private: - - static const char* ServerPrograms[]; - -public: - static const char* GetServerExe(int type) { return (type > kInvalidLo && type < kInvalidHi)?ServerPrograms[type-1]:nil; } - static const char* GetServerName(int type); - static uint16_t GetPort(int type); - static const char* GetServerTypeStr(int type) - { - switch(type) - { - case kAgent: return "kAgent"; - case kLobby: return "kLobby"; - case kGame: return "kGame"; - case kVault: return "kVault"; - case kAuth: return "kAuth"; - case kAdmin: return "kAdmin"; - case kLookup: return "kLookup"; - case kClient: return "kClient"; - default: return "???"; - } - } -}; - - -class plNetServerAgentConstants -{ -public: - static const char* GetName() { return "Server_Agent"; } - static uint16_t GetPort() { return 4800; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAgent; } -}; - - -class plNetLookupServerConstants -{ -public: - static const char* GetName() { return "Lookup_Server"; } - static uint16_t GetPort() { return 2000; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLookup; } -}; - - -class plNetLobbyServerConstants -{ -public: - static const char* GetName() { return "Generated_Lobby"; } - static uint16_t GetPort() { return 5000; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLobby; } -}; - - -class plNetVaultServerConstants -{ -public: - static const char* GetName() { return "Vault_Server"; } - static uint16_t GetPort() { return 2001; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kVault; } -}; - - -class plNetAuthServerConstants -{ -public: - static const char* GetName() { return "Auth_Server"; } - static uint16_t GetPort() { return 2002; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAuth; } -}; - - -class plNetAdminServerConstants -{ -public: - static const char* GetName() { return "Admin_Server"; } - static uint16_t GetPort() { return 2003; } - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAdmin; } -}; - -class plNetGameServerConstants -{ -public: - static const char* GetName() { return "Game_Server"; } - static uint16_t GetLowPort() { return 5001;} - static uint16_t GetHighPort() { return 6001;} - static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kGame; } -}; - - -#endif //PL_NET_SERVERS_H diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index dbc312a9f5..7fe6a5a45f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtils/pnUtils.h" #include "plProduct.h" #include "pnNetCommon/plSynchedObject.h" -#include "pnNetCommon/plNetServers.h" #include "pnNetCommon/plSDLTypes.h" #include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plFixedKey.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp index 7c56be87be..f2226dd719 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetClientMgr.h" #include "plNetMessage/plNetMessage.h" -#include "pnNetCommon/plNetServers.h" #include "pnSceneObject/plSceneObject.h" #include "pnSceneObject/plCoordinateInterface.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h index 3fdf73a916..1eecd86be7 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h @@ -163,11 +163,6 @@ class plNetLinkingMgr plAgeLinkStruct * GetAgeLink() { return &fAgeLink; } plAgeLinkStruct * GetPrevAgeLink() { return &fPrevAgeLink; } - // lobby info - void SetLobbyAddr( const char * ipaddr ) { fLobbyInfo.SetServerAddr( ipaddr );} - void SetLobbyPort( int port ) { fLobbyInfo.SetServerPort( port );} - const plNetServerSessionInfo * GetLobbyServerInfo() const { return &fLobbyInfo;} - // helpers static ST::string GetProperAgeName( const ST::string & ageName ); // attempt to fix wrong case age name. @@ -180,9 +175,6 @@ class plNetLinkingMgr // The age we just left. plAgeLinkStruct fPrevAgeLink; - - // The lobby we want to talk to. - plNetServerSessionInfo fLobbyInfo; }; diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h index da2de91f86..8db121cce2 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h @@ -57,7 +57,6 @@ REGISTER_NONCREATABLE(plNetMember); #include "plNetServerSessionInfo.h" REGISTER_CREATABLE(plAgeInfoStruct); REGISTER_CREATABLE(plAgeLinkStruct); -REGISTER_CREATABLE(plNetServerSessionInfo); #endif // plNetCommonCreatable_inc diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index a681d44d2b..a5064f241a 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -537,271 +537,5 @@ ST::string plAgeLinkStruct::AsString() const return ss.to_string(); } - -//////////////////////////////////////////////////////////////////// - -void plNetServerSessionInfo::Read(hsStream* s, hsResMgr*) -{ - Clear(); - s->LogSubStreamStart("push me"); - s->LogReadLE(&fFlags,"ServerSessionInfo Flags"); - if (IsFlagSet(kHasServerName)){ - s->LogSubStreamPushDesc("ServerName"); - plMsgStdStringHelper::Peek(fServerName,s); - } - if (IsFlagSet(kHasServerType)) - s->LogReadLE(&fServerType,"ServerType"); - if (IsFlagSet(kHasServerAddr)){ - s->LogSubStreamPushDesc("ServerAddr"); - plMsgStdStringHelper::Peek(fServerAddr,s); - } - if (IsFlagSet(kHasServerPort)) - s->LogReadLE(&fServerPort,"ServerPort"); - if (IsFlagSet(kHasServerGuid)){ - s->LogSubStreamPushDesc("ServerGuid"); - fServerGuid.Read(s); - } -} - -void plNetServerSessionInfo::Write(hsStream* s, hsResMgr*) -{ - s->WriteLE(fFlags); - if (IsFlagSet(kHasServerName)) - plMsgStdStringHelper::Poke(fServerName,s); - if (IsFlagSet(kHasServerType)) - s->WriteLE(fServerType); - if (IsFlagSet(kHasServerAddr)) - plMsgStdStringHelper::Poke(fServerAddr,s); - if (IsFlagSet(kHasServerPort)) - s->WriteLE(fServerPort); - if (IsFlagSet(kHasServerGuid)) - fServerGuid.Write(s); -} - -// Read and Write already have their own flags, so I'll just leave those for now. -Colin -void plNetServerSessionInfo::ReadVersion(hsStream* s, hsResMgr* mgr) -{ - Read(s, mgr); -} - -void plNetServerSessionInfo::WriteVersion(hsStream* s, hsResMgr* mgr) -{ - Write(s, mgr); -} - -void plNetServerSessionInfo::Clear() -{ - fFlags = 0; - fServerName = ""; - fServerType = plNetServerConstants::kInvalidLo; - fServerAddr = ""; - fServerPort = 0; - fServerGuid = plUUID(); -} - -void plNetServerSessionInfo::CopyFrom(const plNetServerSessionInfo * other) -{ - if ( other ) - { - fFlags = other->fFlags; - fServerName = other->fServerName; - fServerType = other->fServerType; - fServerAddr = other->fServerAddr; - fServerPort = other->fServerPort; - fServerGuid.CopyFrom(other->fServerGuid); - } - else - { - Clear(); - } -} - -ST::string plNetServerSessionInfo::AsString() const -{ - const char * spacer = kEmpty; - - ST::string_stream ss; - - ss << "["; - - if (HasServerType()) - { - ss << spacer - << "T:" - << plNetServerConstants::GetServerTypeStr(fServerType); - spacer = kComma; - } - if (HasServerName()) - { - ss << spacer - << "N:" - << SAFE(fServerName); - spacer = kComma; - } - if (HasServerGuid()) - { - ss << spacer - << "G:" - << fServerGuid.AsString(); - spacer = kComma; - } - if (HasServerAddr() || HasServerPort()) - { - ss << spacer - << "A:[" - << SAFE(fServerAddr) - << ":" - << fServerPort - << "]"; - spacer = kComma; - } - ss << "]"; - - return ss.to_string(); -} - -ST::string plNetServerSessionInfo::AsLogString() const -{ - const char* spacer = kSemicolon; - - ST::string_stream ss; - ST::string typeName; - - if (HasServerType()) - { - typeName = plNetServerConstants::GetServerTypeStr(fServerType); - } - - if (HasServerName()) - { - ss << typeName << "Name" << "="; - ss << fServerName; - ss << spacer; - } - - if (HasServerAddr()) - { - ss << typeName << "Addr" << "="; - ss << fServerAddr; - ss << spacer; - } - - if (HasServerPort()) - { - ss << typeName << "Port" << "="; - ss << fServerPort; - ss << spacer; - } - - if (HasServerGuid()) - { - ss << typeName << "Guid" << "="; - ss << fServerGuid.AsString(); - ss << spacer; - } - - return ss.to_string(); -} - -bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) const -{ - bool match = true; - if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid)) - match = match && fServerGuid.IsEqualTo(other->GetServerGuid()); - if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName)) - match = match && (fServerName.compare_i(other->fServerName)==0); - if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType)) - match = match && fServerType==other->fServerType; - if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr)) - match = match && (fServerAddr.compare_i(other->fServerAddr)==0); - if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort)) - match = match && fServerPort==other->fServerPort; - return match; -} - - -void plNetServerSessionInfo::SetServerName(const ST::string & val) -{ - fServerName = val; - if (!val.empty()) - { - SetFlag(kHasServerName); - } - else - { - ClearFlag(kHasServerName); - } -} - -void plNetServerSessionInfo::SetServerType(uint8_t val) -{ - if (val>0) - { - fServerType=val; - SetFlag(kHasServerType); - } - else - { - fServerType=0; - ClearFlag(kHasServerType); - } -} - -void plNetServerSessionInfo::SetServerAddr(const ST::string & val) -{ - fServerAddr = val; - if (!val.empty()) - { - SetFlag(kHasServerAddr); - } - else - { - ClearFlag(kHasServerAddr); - } -} - -void plNetServerSessionInfo::SetServerPort(uint16_t val) -{ - if (val>0) - { - fServerPort=val; - SetFlag(kHasServerPort); - } - else - { - fServerPort=0; - ClearFlag(kHasServerPort); - } -} - -void plNetServerSessionInfo::SetServerGuid(const plUUID * val) -{ - if (val && val->IsSet()) - { - fServerGuid.CopyFrom(val); - SetFlag(kHasServerGuid); - } - else - { - fServerGuid.Clear(); - ClearFlag(kHasServerGuid); - } -} - -void plNetServerSessionInfo::CopyServerGuid(const plUUID & val) -{ - if (val.IsSet()) - { - fServerGuid.CopyFrom(val); - SetFlag(kHasServerGuid); - } - else - { - fServerGuid.Clear(); - ClearFlag(kHasServerGuid); - } -} - - /////////////////////////////////////////////////////////////////// // End. diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h index fdc2da9088..02f61a4bad 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h @@ -46,7 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "pnFactory/plCreatable.h" -#include "pnNetCommon/plNetServers.h" #include "plNetCommon/plSpawnPointInfo.h" #include "pnUUID/pnUUID.h" @@ -220,84 +219,4 @@ class plAgeLinkStruct : public plCreatable ST::string AsString() const; }; - -//////////////////////////////////////////////////////////////////// -// Holds info that describes a server session -// - -class plNetServerSessionInfo : public plCreatable -{ - uint8_t fFlags; - ST::string fServerName; - uint8_t fServerType; - ST::string fServerAddr; - uint16_t fServerPort; - plUUID fServerGuid; - - enum - { - kHasServerName = 1<<0, - kHasServerType = 1<<1, - kHasServerAddr = 1<<2, - kHasServerPort = 1<<3, - kHasServerGuid = 1<<4, - }; - - void SetFlag( uint8_t bit ) { fFlags|=bit;} - void ClearFlag( uint8_t bit ) { fFlags&=~bit;} - bool IsFlagSet( uint8_t bit ) const { return (fFlags&bit)!=0;} - -public: - plNetServerSessionInfo() - : fServerType(plNetServerConstants::kInvalidLo) - , fServerPort(0) - , fFlags(0) - {} - CLASSNAME_REGISTER( plNetServerSessionInfo ); - GETINTERFACE_ANY( plNetServerSessionInfo, plCreatable ); - - void SetServerName(const ST::string & val); - void SetServerType(uint8_t val); - void SetServerAddr(const ST::string & val); - void SetServerPort(uint16_t val); - void SetServerGuid(const plUUID * val); - void CopyServerGuid(const plUUID & val); - - ST::string GetServerName() const { return fServerName; } - uint8_t GetServerType() const { return fServerType; } - ST::string GetServerAddr() const { return fServerAddr; } - uint16_t GetServerPort() const { return fServerPort; } - const plUUID *GetServerGuid() const { return &fServerGuid; } - plUUID * GetServerGuid() { return &fServerGuid; } - - bool HasServerName() const { return IsFlagSet(kHasServerName);} - bool HasServerType() const { return IsFlagSet(kHasServerType);} - bool HasServerAddr() const { return IsFlagSet(kHasServerAddr);} - bool HasServerPort() const { return IsFlagSet(kHasServerPort);} - bool HasServerGuid() const { return IsFlagSet(kHasServerGuid);} - bool IsFullyQualified() const - { - return - IsFlagSet(kHasServerName)&& - IsFlagSet(kHasServerType)&& - IsFlagSet(kHasServerAddr)&& - IsFlagSet(kHasServerPort)&& - IsFlagSet(kHasServerGuid); - } - - void Clear(); - void CopyFrom(const plNetServerSessionInfo * other); - bool IsEqualTo(const plNetServerSessionInfo * other) const; - virtual ST::string AsString() const; - virtual ST::string AsLogString() const; - - void Read(hsStream* s, hsResMgr* mgr=nil); - void Write(hsStream* s, hsResMgr* mgr=nil); - - // WriteVersion writes the current version of this creatable and ReadVersion will read in - // any previous version. - virtual void ReadVersion(hsStream* s, hsResMgr* mgr); - virtual void WriteVersion(hsStream* s, hsResMgr* mgr); -}; - #endif // plNetServerSessionInfo_h_inc diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h index 4657703ecc..0a62d50fb2 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsBitVector.h" #include "hsTemplates.h" #include "plGeneric.h" -#include "pnNetCommon/plNetServers.h" #include "pnNetCommon/plNetGroup.h" #include "pnFactory/plCreatable.h" #include "pnFactory/plFactory.h" diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp index 387f733cd8..aa15609854 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetMsgHelpers.h" #include "plNetMessage.h" #include "plCompression/plZlibCompress.h" -#include "pnNetCommon/plNetServers.h" #include "pnNetCommon/plNetApp.h" #include "pnKeyedObject/plKey.h" #include "pnMessage/plMessage.h" From f7f4e7224ce3d3c2fde7dc03e101e53cecc049bc Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 20 Jan 2021 23:50:55 -0500 Subject: [PATCH 4/5] Finish killing off that totally untested plSynchedValue stuff. --- .../NucleusLib/pnNetCommon/CMakeLists.txt | 2 - .../pnNetCommon/plSynchedObject.cpp | 109 ----- .../NucleusLib/pnNetCommon/plSynchedObject.h | 54 --- .../NucleusLib/pnNetCommon/plSynchedValue.cpp | 169 -------- .../NucleusLib/pnNetCommon/plSynchedValue.h | 405 ------------------ .../PubUtilLib/plInterp/plATCEaseCurves.cpp | 2 + .../PubUtilLib/plInterp/plAnimTimeConvert.cpp | 1 + .../PubUtilLib/plInterp/plAnimTimeConvert.h | 1 - .../PubUtilLib/plModifier/plSimpleModifier.h | 1 - .../plParticleSystem/plParticleEmitter.h | 1 - .../plParticleSystem/plParticleGenerator.h | 2 +- .../plParticleSystem/plParticleSystem.h | 1 - .../plPipeline/plCubicRenderTargetModifier.h | 1 - .../PubUtilLib/plSurface/plLayerInterface.h | 1 - 14 files changed, 4 insertions(+), 746 deletions(-) delete mode 100644 Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index 7f97703a38..8599a82727 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -7,7 +7,6 @@ set(pnNetCommon_HEADERS plNetSharedState.h plSDLTypes.h plSynchedObject.h - plSynchedValue.h pnNetCommon.h pnNetCommonCreatable.h ) @@ -20,7 +19,6 @@ set(pnNetCommon_SOURCES plNetSharedState.cpp plSDLTypes.cpp plSynchedObject.cpp - plSynchedValue.cpp pnNetCommon.cpp ) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp index 805aa856c8..666728522d 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plSynchedObject.h" -#include "plSynchedValue.h" #include "plNetApp.h" #include "plNetGroup.h" #include "hsResMgr.h" @@ -57,12 +56,6 @@ std::vector plSynchedObject::fSynchStateStack; plSynchedObject::plSynchedObject() : fSynchFlags(0), -#ifdef USE_SYNCHED_VALUES - fSynchedValueAddrOffsets(nil), - fNumSynchedValues(0), - fSynchedValueFriends(nil), - fNumSynchedValueFriends(0), -#endif fNetGroup(plNetGroup::kNetGroupUnknown) { fStaticSynchedObj=this; @@ -70,10 +63,6 @@ plSynchedObject::plSynchedObject() : plSynchedObject::~plSynchedObject() { -#ifdef USE_SYNCHED_VALUES - delete [] fSynchedValueAddrOffsets; - delete [] fSynchedValueFriends; -#endif } bool plSynchedObject::MsgReceive(plMessage* msg) @@ -88,104 +77,6 @@ bool plSynchedObject::MsgReceive(plMessage* msg) return hsKeyedObject::MsgReceive(msg); } -#ifdef USE_SYNCHED_VALUES -plSynchedValueBase* plSynchedObject::GetSynchedValue(int i) const -{ - if (i>2; - hsAssert(abs(addrOff) < (uint32_t)(1<<(sizeof(AddrOffsetType)<<3)), "address offset overflow"); - IAppendSynchedValueAddrOffset((AddrOffsetType)addrOff); - int32_t idx = fNumSynchedValues-1; - hsAssert(idx<256, "index too big"); - return (uint8_t)idx; -} - -bool plSynchedObject::RemoveSynchedValue(plSynchedValueBase* v) -{ - int i; - for(i=0;i fDirtyNotifiers; - - void IAppendSynchedValueAddrOffset(AddrOffsetType synchedValueAddrOffset); - void IAppendSynchedValueFriend(plSynchedValueBase* v); - plSynchedValueBase* IGetSynchedValue(NumSynchedValuesType i) const - { return (plSynchedValueBase*)((int32_t)this + (fSynchedValueAddrOffsets[i]<<2)); } - plSynchedValueBase* IGetSynchedValueFriend(NumSynchedValuesType i) const - { return fSynchedValueFriends[i]; } - -public: - int32_t GetNumSynchedValues() const { return fNumSynchedValues+fNumSynchedValueFriends; } - plSynchedValueBase* GetSynchedValue(int i) const; - - uint8_t RegisterSynchedValue(plSynchedValueBase* v); - bool RemoveSynchedValue(plSynchedValueBase* v); // handles SVFriends too - void RegisterSynchedValueFriend(plSynchedValueBase* v); -#endif - #ifdef USE_DIRTY_NOTIFIERS // dirty CB notifiers void AddDirtyNotifier(plDirtyNotifier* dn); @@ -267,20 +229,4 @@ class plDirtyNotifier }; #endif -// -// MACROS -// - -#ifdef USE_SYNCHED_VALUES -#define SYNCHED_VALUE(type) plSynchedValue -#define SYNCHED_TARRAY(type) plSynchedTArray -#define SYNCHED_VALUE_FRIEND(type) plSynchedValueFriend -#define SYNCHED_TARRAY_FRIEND(type) plSynchedTArrayFriend -#else -#define SYNCHED_VALUE(type) type -#define SYNCHED_TARRAY(type) hsTArray -#define SYNCHED_VALUE_FRIEND(type) type -#define SYNCHED_TARRAY_FRIEND(type) hsTArray -#endif - #endif // PLSYNCHOBJ_inc diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp deleted file mode 100644 index 5337963ca7..0000000000 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -#include "plSynchedValue.h" - -#ifdef USE_SYNCHED_VALUES -#include "pnKeyedObject/plKey.h" -#include "hsBitVector.h" -#include "pnSceneObject/plSceneObject.h" -#include "hsResMgr.h" -#include "pnKeyedObject/plUoid.h" -#include "pnSceneObject/plCoordinateInterface.h" - -#define ISaveOrLoadSimpleType() \ -{ \ - if (save) \ - stream->WriteLE(v); \ - else \ - stream->ReadLE(&v); \ - return v; \ -} - -// -// baseclass save/load methods for various types -// -hsBitVector plSynchedValueBase::ISaveOrLoad(hsBitVector& v, bool32 save, hsStream* stream, hsResMgr* mgr) -{ - if (save) - v.Write(stream); - else - v.Read(stream); - return v; -} - -float plSynchedValueBase::ISaveOrLoad(float v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -double plSynchedValueBase::ISaveOrLoad(double v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -int32_t plSynchedValueBase::ISaveOrLoad(int32_t v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -uint32_t plSynchedValueBase::ISaveOrLoad(uint32_t v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -int plSynchedValueBase::ISaveOrLoad(int v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -bool plSynchedValueBase::ISaveOrLoad(bool v, bool32 save, hsStream* stream, hsResMgr* mgr) - ISaveOrLoadSimpleType(); - -// -// save or load a key. return the key. -// -const plKey plSynchedValueBase::ISaveOrLoad(const plKey key, bool32 save, hsStream* stream, hsResMgr* mgr) -{ - if (save) - { - if (key) - { - stream->WriteByte(1); - // I need to write a key to MY stream... -#if 0 // DEBUG - ST::char_buffer buf = key->GetName()->to_latin_1(); - stream->WriteLE32(buf.size()); - stream->Write(buf.size(), buf.data()); -#endif - key->GetUoid().Write(stream); - } - else - { - stream->WriteByte(0); - } - return key; - } - else - { - int32_t has=stream->ReadByte(); - if (has) - { - // read a key from MY stream -#if 0 // DEBUG - int32_t len = stream->ReadLE32(); - char tmp[256]; - hsAssert(len<256, "key name overflow"); - stream->Read(len, tmp); -#endif - plUoid uoid; - uoid.Read(stream); - return mgr->FindKey(uoid); - } - else - return (nil); - } - return nil; -} - -hsKeyedObject* plSynchedValueBase::ISaveOrLoad(hsKeyedObject* obj, bool32 save, hsStream* stream, hsResMgr* mgr) -{ - plKey key = obj ? obj->GetKey() : nil; - key = ISaveOrLoad(key, save, stream, mgr); - return key ? key->ObjectIsLoaded() : nil; -} - -plSceneNode* plSynchedValueBase::ISaveOrLoad(plSceneNode* obj, bool32 save, hsStream* stream, hsResMgr* mgr) -{ - // return plSceneNode::ConvertNoRef(ISaveOrLoad(hsKeyedObject::ConvertNoRef(obj), save, stream, mgr)); - hsAssert(false, "SceneNode synchedValues currently not implemented"); - return nil; -} - -plSceneObject* plSynchedValueBase::ISaveOrLoad(plSceneObject* obj, bool32 save, hsStream* stream, hsResMgr* mgr) -{ return plSceneObject::ConvertNoRef(ISaveOrLoad(hsKeyedObject::ConvertNoRef(obj), save, stream, mgr)); } - -plCoordinateInterface* plSynchedValueBase::ISaveOrLoad(const plCoordinateInterface* cInt, bool32 save, hsStream* stream, hsResMgr* mgr) -{ - plSceneObject* obj = ISaveOrLoad(cInt ? cInt->fOwner : nil, save, stream, mgr); - return obj ? obj->fCoordinateInterface : nil; -} - -#else - -// dummy function to prevent a linker warning complaining about no public symbols if the -// contents of the file get compiled out via pre-processor -void _preventLNK4221WarningStub() -{ -} - -#endif // USE_SYNCHED_VALUES - diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h deleted file mode 100644 index 71a0a4b893..0000000000 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h +++ /dev/null @@ -1,405 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -#ifndef PL_SYNCHEDVALUE_inc -#define PL_SYNCHEDVALUE_inc - -#include "plSynchedObject.h" - -#ifdef USE_SYNCHED_VALUES -#include "HeadSpin.h" -#include "hsStream.h" - -#include "hsBitVector.h" -#include "hsMemory.h" -// -// Defines a class for variable types which need to automatically be synchronized -// (replicated) over the network. -// current size is 8 bytes -// - -// -// ----------------------------------------------------- -// SYNCHED VALUE BASE CLASS -// ----------------------------------------------------- -// -class hsResMgr; -class plSceneNode; -class plSceneObject; -class plCoordinateInterface; -class plSynchedValueBase -{ -public: - enum Flags // 16 bits - { - kValueIsDirty = 0x1, - kValueSendOnlyOnce = 0x2, // perm flag - kValueHasBeenSent = 0x4, // perm flag - kRegistered = 0x8, // perm flag - kDontDirty = 0x10 // perm flag - }; - -protected: - int16_t fSynchedObjectAddrOffset; // this could represent uint32_ts instead of uint8_t offsets - uint16_t fFlags; - - void IConstruct() // too bad this can't be virtual (because it's called from ctor) - { - // The synchMgr for the class that owns us is constructed first and the staticMgr - // is set to his address so we can automatically get at it during construction. - fFlags=0; - int32_t off = (int32_t)plSynchedObject::GetStaticSynchedObject() - (int32_t)this; - if ( abs(off) < (1<<(sizeof(fSynchedObjectAddrOffset)<<3)) ) - fSynchedObjectAddrOffset = (int16_t)off; - else - fSynchedObjectAddrOffset=-1; - } - - bool32 IOKToDirty() - { - if (fFlags & (kDontDirty | kValueIsDirty)) - return false; - return GetSynchedObject() ? GetSynchedObject()->IOKToDirty() : false; - } - virtual void ISaveOrLoad(bool32 save, hsStream* stream, hsResMgr* mgr) = 0; - - // save/load methods for different types - const plKey ISaveOrLoad(const plKey key, bool32 save, hsStream* stream, hsResMgr* mgr); - hsKeyedObject* ISaveOrLoad(hsKeyedObject* obj, bool32 save, hsStream* stream, hsResMgr* mgr); - plSceneNode* ISaveOrLoad(plSceneNode* obj, bool32 save, hsStream* stream, hsResMgr* mgr); - plSceneObject* ISaveOrLoad(plSceneObject* obj, bool32 save, hsStream* stream, hsResMgr* mgr); - int32_t ISaveOrLoad(int32_t v, bool32 save, hsStream* stream, hsResMgr* mgr); - uint32_t ISaveOrLoad(uint32_t v, bool32 save, hsStream* stream, hsResMgr* mgr); - bool ISaveOrLoad(bool v, bool32 save, hsStream* stream, hsResMgr* mgr); - int ISaveOrLoad(int v, bool32 save, hsStream* stream, hsResMgr* mgr); // or bool32 - float ISaveOrLoad(float v, bool32 save, hsStream* stream, hsResMgr* mgr); - double ISaveOrLoad(double v, bool32 save, hsStream* stream, hsResMgr* mgr); - hsBitVector ISaveOrLoad(hsBitVector& v, bool32 save, hsStream* stream, hsResMgr* mgr); - plCoordinateInterface* ISaveOrLoad(const plCoordinateInterface* cInt, bool32 save, hsStream* stream, hsResMgr* mgr); -public: - plSynchedValueBase() { IConstruct(); } - virtual ~plSynchedValueBase() {} - - // getters - virtual plSynchedObject* GetSynchedObject() - { - hsAssert(fSynchedObjectAddrOffset!=-1, "invalid synchedObject address offset"); - plSynchedObject* so = fSynchedObjectAddrOffset == -1 ? nil : (plSynchedObject*)((int32_t)this+fSynchedObjectAddrOffset); - if (!(fFlags & kRegistered) && so) - { - so->RegisterSynchedValue(this); - fFlags |= kRegistered; - } - return so; - } - uint16_t GetFlags() { return fFlags; } - - // setters - void SetFlags(uint16_t f) { fFlags=f; } - - void MakeDirty() { SetFlags(GetFlags() | kValueIsDirty); } - void MakeClean() { SetFlags(GetFlags() & ~kValueIsDirty); } - - void DirtyIfNecessary() - { - if (IOKToDirty()) - { - MakeDirty(); // dirty value - if (GetSynchedObject()) - GetSynchedObject()->DirtySynchState(ST::string(), 0); // dirty owner - } - } - - // save/load - static void Save(plSynchedValueBase& obj, hsStream* stream, hsResMgr* mgr) { obj.ISaveOrLoad(true, stream, mgr); } - static void Load(plSynchedValueBase& obj, hsStream* stream, hsResMgr* mgr) { obj.ISaveOrLoad(false, stream, mgr); } -}; - -// -// ----------------------------------- -// SYNCHED VALUE TEMPLATE -// ----------------------------------- -// -template -class plSynchedValue : public plSynchedValueBase -{ -protected: - T fValue; - - void ISaveOrLoad(bool32 save, hsStream* stream, hsResMgr* mgr) - { fValue=(T)plSynchedValueBase::ISaveOrLoad(fValue, save, stream, mgr); } // default method - -public: - - plSynchedValue() {} - plSynchedValue(const T& v) : plSynchedValueBase() { fValue=v; } - plSynchedValue(const plSynchedValue& pRHS) : plSynchedValueBase() { fValue=pRHS.GetValue(); } // copy ctor - - // conversion operators - operator T() const { return fValue; } - T* operator &() const { return &fValue; } - T* operator &() { return &fValue; } - - // equality - bool32 operator==(const T& other) const { return fValue==(T)other; } - bool32 operator!=(const T& other) const { return !(*this == other); } - - // other operators - T operator++() { DirtyIfNecessary(); return ++fValue; } - T operator++(int) { DirtyIfNecessary(); return fValue++; } // postfix - T operator--() { DirtyIfNecessary(); return --fValue; } - T operator--(int) { DirtyIfNecessary(); return fValue--; } // postfix - T operator+=(const T& other) { return SetValue(fValue+other); } - T operator*=(const T& other) { return SetValue(fValue*other); } - T operator/=(const T& other) { return SetValue(fValue/other); } - - // these return reference in the event they are bitvector types - T& operator&=(const T& other) { return SetValue(fValue&other); } - T& operator|=(const T& other) { return SetValue(fValue|other); } - T& operator^=(const T& other) { return SetValue(fValue^other); } - T& operator-=(const T& other) { return SetValue(fValue-other); } - - const T& operator=(const T& v){ return SetValue(v); } - - // for pointer types, which are allowed to change the object pointed to - T operator->() { return fValue; } - - // asignment, can use instead of setvalue - const T& operator=(const plSynchedValue& pRHS ) { return SetValue(pRHS.GetValue()); } - - // setters - T& SetValue(const T& v) // return true if changed value - { - if (v != fValue) // dont dirty unless value changes - { - fValue=v; - DirtyIfNecessary(); - } - return fValue; - } - - // getters - const T& GetValue() const { return fValue; } - - // for hsBitVector - bool32 IsBitSet(uint32_t which) const { return fValue.IsBitSet(which); } - bool32 SetBit(uint32_t which, bool32 on = true) - { bool32 bitSet = IsBitSet(which); - if ( (on && !bitSet) || (!on && bitSet) ) - DirtyIfNecessary(); - return fValue.SetBit(which, on); - } - void Read(hsStream* s) { fValue.Read(s); } - void Write(hsStream* s) const { fValue.Write(s); } - void Clear() { DirtyIfNecessary(); fValue.Clear(); } - bool32 ClearBit(uint32_t which) { if (fValue.IsBitSet(which)) DirtyIfNecessary(); return fValue.ClearBit(which); } - void Reset() { if (fValue.GetSize()!=0) DirtyIfNecessary(); fValue.Reset(); } - bool32 ToggleBit(uint32_t which) { DirtyIfNecessary(); return fValue.ToggleBit(which); } - uint32_t GetSize() { return fValue.GetSize(); } -}; - -////////////////////////////////////// -// Synched Value Friend - allows a synched value to be contained -// in an object which is not a synchedObject. Uses a pointer instead -// of an computer the addr offset of it's associated synchedObject. -// This one is 4 bytes bigger than regular synched values. -////////////////////////////////////// -template -class plSynchedValueFriend : public plSynchedValue -{ -protected: - plSynchedObject** fSynchedObject; -public: - plSynchedValueFriend() : fSynchedObject(nil) { } - // this is explicit so it won't be invoked instead of operator()= - explicit plSynchedValueFriend(const T& v) : plSynchedValue(v),fSynchedObject(nil) { } - plSynchedValueFriend(const plSynchedValueFriend& pRHS) : plSynchedValue(pRHS) - { fSynchedObject = pRHS.fSynchedObject; } - ~plSynchedValueFriend() - { - if (GetSynchedObject()) - GetSynchedObject()->RemoveSynchedValue(this); - } - - // this isn't inherited for some reason - const T& operator=(const T& v) { return SetValue(v); } - - plSynchedObject* GetSynchedObject() - { - hsAssert(fSynchedObject, "nil synched object, need to SetSynchedObjectPtrAddr?"); - - if (*fSynchedObject && !(fFlags & kRegistered)) - { - (*fSynchedObject)->RegisterSynchedValueFriend(this); - fFlags |= kRegistered; - } - return *fSynchedObject; - } - - void SetSynchedObjectPtrAddr(plSynchedObject** so) - { - hsAssert(!(fFlags & kRegistered), "SynchedValueFriend already registered?"); - fSynchedObject=so; - } -}; - -///////////////////////////////////// -// Synched TArray Template -///////////////////////////////////// -#include "hsTemplates.h" -template -class plSynchedTArray : public plSynchedValueBase -{ -private: - hsTArray fValueList; - - void ISaveOrLoad(bool32 save, hsStream* stream, hsResMgr* mgr); -public: - enum { kMissingIndex = hsTArray::kMissingIndex }; - plSynchedTArray() {} - ~plSynchedTArray() {} - - // conversion operators - operator T() const { return fValueList; } - - // common methods - const T& operator[](int i) const { return Get(i); } - - const T& Get(int i) const { return fValueList.Get(i); } - void Set(int i, const T& item) { if (fValueList[i] != item) DirtyIfNecessary(); fValueList[i]=item; } - void Append(const T& item) { fValueList.Append(item); DirtyIfNecessary(); } - T* Insert(int index) { fValueList.Insert(index); DirtyIfNecessary(); } - void Remove(int index) { fValueList.Remove(index); DirtyIfNecessary(); } - int Count() const { return fValueList.Count(); } - int GetCount() const { return Count(); } - void Reset() { if (fValueList.GetCount() != 0) DirtyIfNecessary(); fValueList.Reset(); } - void SetCountAndZero(int count) { if (count || GetCount()) DirtyIfNecessary(); fValueList.SetCountAndZero(count); } - void SetCount(int count) { if (count || GetCount()) DirtyIfNecessary(); fValueList.SetCount(count); } - void ExpandAndZero(int count) { if (count || GetCount()) DirtyIfNecessary(); fValueList.ExpandAndZero(count); } - int Find(const T& item) const { return fValueList.Find(item); } - T* Push() { DirtyIfNecessary(); return fValueList.Push(); } - void Push(const T& item) { DirtyIfNecessary(); return fValueList.Push(item); } - T Pop() { DirtyIfNecessary(); return fValueList.Pop(); } - const T& Peek() const { return fValue.Peek(); } - T* AcquireArray() { DirtyIfNecessary(); return fValueList.AcquireArray(); } -}; - -// -// inlines -// -template inline -void plSynchedTArray::ISaveOrLoad(bool32 save, hsStream* stream, hsResMgr* mgr) -{ - if (save) - { - // write out size of array - int32_t i, num = fValueList.GetCount(); - stream->WriteLE(num); - for(i=0;iReadLE(&num); - - for(i=0;i -class plSynchedTArrayFriend : public plSynchedTArray -{ -protected: - plSynchedObject** fSynchedObject; -public: - plSynchedTArrayFriend() : fSynchedObject(nil) { } - - plSynchedObject* GetSynchedObject() - { - hsAssert(fSynchedObject, "nil synched object, need to SetSynchedObjectPtrAddr?"); - - if (*fSynchedObject && !(fFlags & kRegistered)) - { - (*fSynchedObject)->RegisterSynchedValueFriend(this); - fFlags |= kRegistered; - } - return *fSynchedObject; - } - - void SetSynchedObjectPtrAddr(plSynchedObject** so) - { - hsAssert(!(fFlags & kRegistered), "SynchedValueTArrayFriend already registered?"); - fSynchedObject=so; - } - - -#if 0 - // - // redefine operators since they are not inherited - // - - // conversion operators - operator T() const { return fValueList; } - - // common methods - const T& operator[](int i) const { return Get(i); } -#endif -}; -#endif // USE_SYNCHED_VALUES - -#endif // PL_SYNCHEDVALUE_inc - diff --git a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp index ca22d92c2a..09e84a84c9 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp @@ -44,6 +44,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plAnimEaseTypes.h" #include "plAnimTimeConvert.h" +#include "hsStream.h" + /////////////////////////////////////////////////////////////////////////////////////////////// plATCEaseCurve *plATCEaseCurve::CreateEaseCurve(uint8_t type, float minLength, float maxLength, float length, diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp index ddc8c8bb31..754fc38164 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plAnimCmdMsg.h" #include "pnNetCommon/plSDLTypes.h" +#include "pnNetCommon/plSynchedObject.h" #include "hsResMgr.h" #include "plgDispatch.h" diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h index 06fd7df8f5..f793e47d68 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "pnFactory/plCreatable.h" #include "hsTemplates.h" -#include "pnNetCommon/plSynchedValue.h" class plSynchedObject; class plAnimCmdMsg; diff --git a/Sources/Plasma/PubUtilLib/plModifier/plSimpleModifier.h b/Sources/Plasma/PubUtilLib/plModifier/plSimpleModifier.h index f1a02d1ea4..16774fc5b4 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plSimpleModifier.h +++ b/Sources/Plasma/PubUtilLib/plModifier/plSimpleModifier.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plSimpleModifier_inc #include "pnModifier/plModifier.h" -#include "pnNetCommon/plSynchedValue.h" #include "plInterp/plAnimTimeConvert.h" class plSceneObject; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.h b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.h index 3687290567..7915ddac6b 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.h +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsGeometry3.h" #include "hsBounds.h" -#include "pnNetCommon/plSynchedValue.h" #include "hsColorRGBA.h" class hsBounds3Ext; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h index ef85b92eae..fff3337fbc 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plParticleGenerator_inc #include "hsGeometry3.h" -#include "pnNetCommon/plSynchedValue.h" + class plParticleEmitter; class plScalarController; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.h b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.h index 1e81b4500d..6f3aebc13e 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.h +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "hsGeometry3.h" #include "pnModifier/plModifier.h" -#include "pnNetCommon/plSynchedValue.h" #include "hsColorRGBA.h" #include "hsMatrix44.h" #include "plEffectTargetInfo.h" diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.h b/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.h index 1d02c40c21..d9f1b088e8 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/plCubicRenderTargetModifier.h @@ -58,7 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _plCubicRenderTargetModifier_h #include "pnModifier/plModifier.h" -#include "pnNetCommon/plSynchedValue.h" class plCubicRenderTarget; diff --git a/Sources/Plasma/PubUtilLib/plSurface/plLayerInterface.h b/Sources/Plasma/PubUtilLib/plSurface/plLayerInterface.h index 50a6c53ed1..1b0e14dc86 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plLayerInterface.h +++ b/Sources/Plasma/PubUtilLib/plSurface/plLayerInterface.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plLayerInterface_inc #define plLayerInterface_inc -#include "pnNetCommon/plSynchedValue.h" #include "pnNetCommon/plSynchedObject.h" #include "hsGMatState.h" From c84d0dc040da5624cbf40fe485d2ea12624ad6a9 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 20 Jan 2021 23:56:30 -0500 Subject: [PATCH 5/5] Fix straggler hidden by PCH/unity build. --- Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index f51ed825a8..c108a1eaea 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -41,10 +41,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include -#include +#include +#include #include "pyAgeInfoStruct.h" -#include "pnUtils/pnUtCrypt.h" #include "pnEncryption/plChecksum.h"