diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt index 7ae078118a..65d53b304c 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/CMakeLists.txt @@ -25,7 +25,6 @@ target_link_libraries( PRIVATE pnAsyncCoreExe # Implementation is here pnNetBase - pnUtils plStatusLog # :( ) diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Pch.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Pch.h index f97f9a3d0b..67c73887b7 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Pch.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Pch.h @@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#include "pnUtils/pnUtils.h" #include "plProduct.h" #include "pnNetBase/pnNetBase.h" #include "Private/pnAcAllIncludes.h" diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h index e0695b66e5..061c9643f9 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h @@ -54,7 +54,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "pnNetBase/pnNbError.h" -#include "pnUtils/pnUtils.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt index 3bc992488f..c242208e5b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/CMakeLists.txt @@ -26,7 +26,7 @@ target_link_libraries( CoreLib pnAsyncCore pnNetBase - pnUtils + pnNucleusInc ASIO::ASIO $<$:${VLD_LIBRARY}> ) diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Pch.h b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Pch.h index eb57dec6e1..e66966a8fb 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Pch.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Pch.h @@ -68,10 +68,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "Private/pnAceInt.h" #include "hsThread.h" +#include "hsTimer.h" #include "plProduct.h" #include "pnAsyncCore/pnAsyncCore.h" #include "pnNetBase/pnNetBase.h" -#include "pnUtils/pnUtils.h" #ifdef USE_VLD #include diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceSocket.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceSocket.cpp index caa795df3b..6d38c5d27c 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceSocket.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceSocket.cpp @@ -274,7 +274,7 @@ static bool SocketInitConnect(ConnectOperation& op) // This steals ownership of op->fSock auto sock = std::make_unique(op); - sock->initTimeMs = TimeGetMs(); + sock->initTimeMs = hsTimer::GetMilliSeconds(); asio::error_code err; sock->fSock.non_blocking(true, err); @@ -422,7 +422,7 @@ static bool SocketQueueAsyncWrite(AsyncSocket conn, const void* data, size_t byt // check for data backlog if (!conn->fWriteOps.empty()) { WriteOperation* firstQueuedWrite = conn->fWriteOps.front(); - unsigned currTimeMs = TimeGetMs(); + unsigned currTimeMs = hsTimer::GetMilliSeconds(); if (((long)(currTimeMs - firstQueuedWrite->queueTimeMs) >= (long)kBacklogFailMs) && ((long)(currTimeMs - conn->initTimeMs) >= (long)kBacklogInitMs)) { PerfAddCounter(kAsyncPerfSocketDisconnectBacklog, 1); @@ -464,7 +464,7 @@ static bool SocketQueueAsyncWrite(AsyncSocket conn, const void* data, size_t byt op->fNotify.buffer = membuf + sizeof(WriteOperation); op->fNotify.bytes = bytes; op->fNotify.bytesProcessed = 0; - op->queueTimeMs = TimeGetMs(); + op->queueTimeMs = hsTimer::GetMilliSeconds(); memcpy(op->fNotify.buffer, data, bytes); PerfAddCounter(kAsyncPerfSocketBytesWaitQueued, bytes); diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp index 8e0834235b..339e1f9ba3 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp @@ -73,9 +73,10 @@ static void CreateThreadProc(AsyncThreadRef thread) //============================================================================ void ThreadDestroy(unsigned exitThreadWaitMs) { - unsigned bailAt = TimeGetMs() + exitThreadWaitMs; - while (AsyncPerfGetCounter(kAsyncPerfThreadsCurr) && signed(bailAt - TimeGetMs()) > 0) + unsigned bailAt = hsTimer::GetMilliSeconds() + exitThreadWaitMs; + while (AsyncPerfGetCounter(kAsyncPerfThreadsCurr) && hsTimer::GetMilliSeconds() < bailAt) { std::this_thread::sleep_for(std::chrono::milliseconds(10)); + } } //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnEncryption/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnEncryption/CMakeLists.txt index c3644053be..98685459f7 100644 --- a/Sources/Plasma/NucleusLib/pnEncryption/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnEncryption/CMakeLists.txt @@ -2,6 +2,7 @@ set(pnEncryption_SOURCES plBigNum.cpp plChallengeHash.cpp plChecksum.cpp + plEncryption.cpp plSha0.cpp ) @@ -9,6 +10,7 @@ set(pnEncryption_HEADERS plBigNum.h plChallengeHash.h plChecksum.h + plEncryption.h plSha0.h plRandom.h ) diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnEncryption/plEncryption.cpp similarity index 95% rename from Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp rename to Sources/Plasma/NucleusLib/pnEncryption/plEncryption.cpp index b868fa63c6..535ca5afd8 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnEncryption/plEncryption.cpp @@ -39,17 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp -* -***/ - -#include "Pch.h" -#include "pnUtCrypt.h" -#include "pnUtStr.h" -#include "pnUtTime.h" +#include "plEncryption.h" #include diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnEncryption/plEncryption.h similarity index 88% rename from Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h rename to Sources/Plasma/NucleusLib/pnEncryption/plEncryption.h index 5a21b7ec42..9facfb32c1 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnEncryption/plEncryption.h @@ -39,16 +39,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h -* -***/ -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H +#ifndef PL_ENCRYPTION_H +#define PL_ENCRYPTION_H -#include "pnEncryption/plChecksum.h" +#include "plChecksum.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt index 700646cf9e..8a8c324274 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCli/CMakeLists.txt @@ -20,7 +20,6 @@ target_link_libraries( PRIVATE pnAsyncCore pnNetBase - pnUtils pnUUID ) diff --git a/Sources/Plasma/NucleusLib/pnNetCli/Pch.h b/Sources/Plasma/NucleusLib/pnNetCli/Pch.h index 0e3391bf71..ccdd8f76cb 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/Pch.h +++ b/Sources/Plasma/NucleusLib/pnNetCli/Pch.h @@ -51,7 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETCLI_PCH_H -#include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" #include "pnAsyncCore/pnAsyncCore.h" #include "pnEncryption/plBigNum.h" diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 119f599a41..8127ea3f6d 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsWindows.h" #include "pnEncryption/plChallengeHash.h" +#include "pnEncryption/plEncryption.h" #include "pnUUID/pnUUID.h" #include "hsLockGuard.h" #include diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt index 9216a4d887..13716da151 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries( pnNetProtocol PUBLIC CoreLib + pnEncryption pnNetBase pnUUID PRIVATE diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h index fbb65a7c7c..3b2a1ca668 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h @@ -51,7 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PCH_H #include "HeadSpin.h" -#include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" #include "pnAsyncCore/pnAsyncCore.h" #include "pnNetCli/pnNetCli.h" diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index 6f3570139c..b4bbdd9872 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #include "../Pch.h" + +#include "pnUtils/pnUtStr.h" #include "pnUUID/pnUUID.h" #include diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index d7b2cd9124..bc43004675 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -64,6 +64,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifdef USES_NETCLI +#include "pnEncryption/plChecksum.h" + const NetMsgField kNetMsgFieldAccountName = NET_MSG_FIELD_STRING(kMaxAccountNameLength); const NetMsgField kNetMsgFieldPlayerName = NET_MSG_FIELD_STRING(kMaxPlayerNameLength); const NetMsgField kNetMsgFieldShaDigest = NET_MSG_FIELD_RAW_DATA(sizeof(ShaDigest)); diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index c0aac7a5a4..78fa603ed5 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -1,31 +1,16 @@ set(pnUtils_HEADERS - Pch.h - pnUtils.h - pnUtCoreLib.h - pnUtAllIncludes.h - pnUtCrypt.h pnUtStr.h - pnUtTime.h ) set(pnUtils_SOURCES - pnUtCrypt.cpp pnUtStr.cpp - pnUtTime.cpp ) -plasma_library(pnUtils - SOURCES ${pnUtils_HEADERS} ${pnUtils_SOURCES} - PRECOMPILED_HEADERS Pch.h - UNITY_BUILD -) +plasma_library(pnUtils SOURCES ${pnUtils_HEADERS} ${pnUtils_SOURCES}) target_link_libraries( pnUtils PUBLIC CoreLib - pnEncryption - PRIVATE - OpenSSL::Crypto ) source_group("Header Files" FILES ${pnUtils_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Pch.h b/Sources/Plasma/NucleusLib/pnUtils/Pch.h deleted file mode 100644 index 31e7c08fed..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Pch.h +++ /dev/null @@ -1,54 +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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Pch.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H - -#include "pnUtCoreLib.h" // must be first in list -#include "hsWindows.h" - -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h deleted file mode 100644 index 80d972f07f..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ /dev/null @@ -1,57 +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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTALLINCLUDES_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTALLINCLUDES_H - - -#include "pnUtCoreLib.h" // must be first in list -#include "pnUtTime.h" -#include "pnUtStr.h" -#include "pnUtCrypt.h" - -#endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTALLINCLUDES_H diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h deleted file mode 100644 index 8a141d08ca..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h +++ /dev/null @@ -1,54 +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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H - -#include "HeadSpin.h" -#include "hsStream.h" - -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp index fc09c4e61b..90b5e10ecc 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "Pch.h" #include "pnUtStr.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index be262fe4fb..406e46a011 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -48,6 +48,7 @@ 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 "HeadSpin.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp deleted file mode 100644 index 6924606cc3..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp +++ /dev/null @@ -1,80 +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 "Pch.h" -#include "pnUtTime.h" - -#if HS_BUILD_FOR_UNIX -#include -#include -#endif - -/****************************************************************************** - * I've combined all the pnUtils Time stuff in here and made it work cross- - * platform as best as possible. - * - * At some point, hsTimer needs to be rewritten to ensure that it's fully - * corss-platform and using a reliable millisecond clock. - * When that happens, these functions should be merged into hsTimer. - * - * -- dpogue (April 14, 2012) - * - *****************************************************************************/ - - -/***************************************************************************** -* -* Exports -* -***/ - -uint32_t TimeGetMs () { -#if HS_BUILD_FOR_WIN32 - return GetTickCount(); -#else - struct timeval tv; - if (gettimeofday(&tv, nullptr) != 0) - return 0; - - return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); -#endif -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h deleted file mode 100644 index 97f9334d69..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h +++ /dev/null @@ -1,58 +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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H - -/***************************************************************************** -* -* Time query functions -* -***/ -// millisecond timer; wraps ~49 days -uint32_t TimeGetMs (); -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h deleted file mode 100644 index cb1e601dbe..0000000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h +++ /dev/null @@ -1,55 +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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H - - -#include "pnUtAllIncludes.h" - - -#endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H diff --git a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt index a2008740e9..6695fdb4eb 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt @@ -53,6 +53,7 @@ target_link_libraries(plNetClient pnModifier pnNucleusInc pnSceneObject + pnUtils plAgeDescription plAgeLoader plAnimation diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.h index fa2266e980..2c3185c159 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.h @@ -50,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "pnUtils/pnUtils.h" #include "plNetClientComm/plNetClientComm.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 4ea52e673f..b89aa89c64 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnMessage/plClientMsg.h" #include "pnNetCommon/pnNetCommon.h" #include "pnSceneObject/plSceneObject.h" +#include "pnUtils/pnUtStr.h" #include "plAvatar/plAvatarMgr.h" #include "plAvatar/plArmatureMod.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt index ee4b9c2ab6..78551b47b0 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt @@ -22,6 +22,7 @@ target_link_libraries( pnNetCli pnNetCommon pnNucleusInc + pnUtils plFile plNetGameLib plNetMessage diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index eab5846245..b9e3bdafdf 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -61,6 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNetBase/pnNbConst.h" #include "pnNetCli/pnNetCli.h" #include "pnNetCommon/plNetApp.h" +#include "pnUtils/pnUtStr.h" #include "plFile/plStreamSource.h" #include "plMessage/plAccountUpdateMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Pch.h b/Sources/Plasma/PubUtilLib/plNetGameLib/Pch.h index 9a40ff9cc9..7edc28bcb5 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Pch.h +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Pch.h @@ -61,7 +61,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnEncryption/plBigNum.h" #include "pnNetBase/pnNetBase.h" #include "pnNetCli/pnNetCli.h" -#include "pnUtils/pnUtils.h" #define USES_PROTOCOL_CLI2AUTH #define USES_PROTOCOL_CLI2GAME diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index 4f4f541786..221b12a8a9 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "pnEncryption/plChallengeHash.h" +#include "pnUtils/pnUtStr.h" + #include "plVault/plVaultConstants.h" namespace Ngl { namespace Auth { @@ -1655,7 +1657,7 @@ void CliAuConn::TimerReconnect () { Ref("Connecting"); // Remember the time we started the reconnect attempt, guarding against - // TimeGetMs() returning zero (unlikely), as a value of zero indicates + // hsTimer::GetMilliSeconds() returning zero (unlikely), as a value of zero indicates // a first-time connect condition to StartAutoReconnect() reconnectStartMs = GetNonZeroTimeMs(); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp index ad12f99dac..3cd0aac804 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp @@ -47,6 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "../Pch.h" +#include "pnUtils/pnUtStr.h" + // Define this if the file servers are running behind load-balancing hardware. // It changes the logic by which the decision to attempt a reconnect is made. #define LOAD_BALANCER_HARDWARE @@ -599,7 +601,7 @@ void CliFileConn::TimerReconnect () { Ref("Connecting"); // Remember the time we started the reconnect attempt, guarding against - // TimeGetMs() returning zero (unlikely), as a value of zero indicates + // hsTimer::GetMilliSeconds() returning zero (unlikely), as a value of zero indicates // a first-time connect condition to StartAutoReconnect() reconnectStartMs = GetNonZeroTimeMs(); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp index 79233a57e5..c6b6d06255 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp @@ -535,7 +535,7 @@ void CliGkConn::TimerReconnect () { Ref("Connecting"); // Remember the time we started the reconnect attempt, guarding against - // TimeGetMs() returning zero (unlikely), as a value of zero indicates + // hsTimer::GetMilliSeconds() returning zero (unlikely), as a value of zero indicates // a first-time connect condition to StartAutoReconnect() reconnectStartMs = GetNonZeroTimeMs();