From b4477640575fc13d2da2698e282bf98673eaa038 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sun, 10 Apr 2011 10:42:56 -0700 Subject: [PATCH] Add the patcher --- .../Sources/Plasma/Apps/CMakeLists.txt | 5 +- .../Apps/plClientPatcher/CMakeLists.txt | 23 +++++++ .../Plasma/Apps/plClientPatcher/UruPlayer.cpp | 4 +- .../Plasma/Apps/plUruLauncher/CMakeLists.txt | 66 +++++++++++++++++++ .../Sources/Plasma/Apps/plUruLauncher/Pch.h | 8 ++- .../Apps/plUruLauncher/plUruLauncher.rc | 4 +- 6 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt create mode 100644 MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/CMakeLists.txt b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/CMakeLists.txt index 832661cd..637418e9 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/CMakeLists.txt +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/CMakeLists.txt @@ -1,5 +1,4 @@ -add_definitions(-D_LIB) # We shouldn't actually need this here, but - # Cyan uses it, so meh - add_subdirectory(plClient) +add_subdirectory(plClientPatcher) add_subdirectory(plPythonPack) +add_subdirectory(plUruLauncher) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt new file mode 100644 index 00000000..b121b331 --- /dev/null +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt @@ -0,0 +1,23 @@ +add_definitions(-D_LIB) + +include_directories("../../CoreLib") +include_directories("../../NucleusLib/inc") +include_directories("../../NucleusLib") +include_directories("../../PubUtilLib") + +include_directories(${OPENSSL_INCLUDE_DIR}) + +set(plClientPatcher_HEADERS + Intern.h + Pch.h + UruPlayer.h +) + +set(plClientPatcher_SOURCES + UruPlayer.cpp +) + +add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES}) + +source_group("Header Files" FILES ${plClientPatcher_HEADERS}) +source_group("Source Files" FILES ${plClientPatcher_SOURCES}) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp index 0b2c8bce..31af2253 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp @@ -487,7 +487,7 @@ static void ProcessManifestEntry (void * param, ENetError error) { } // if we have a file that was cached the MD5 check will be really fast throwing off our approx time remaining. - dword t = TimeGetTime() / kTimeIntervalsPerMs - start; + dword t = (dword)(TimeGetTime() / kTimeIntervalsPerMs - start); if(t < 25) { // cached file @@ -561,7 +561,7 @@ static void ProcessManifest (void * param) { } } - ProcessManifestEntryParam::startTime = TimeGetTime() / kTimeIntervalsPerMs; + ProcessManifestEntryParam::startTime = (double)(TimeGetTime() / kTimeIntervalsPerMs); for (unsigned i = 0; i < entryCount && s_running; ++i){ ProcessManifestEntry(¶ms[i], kNetSuccess); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt new file mode 100644 index 00000000..b8375728 --- /dev/null +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt @@ -0,0 +1,66 @@ +include_directories("../../Apps") +include_directories("../../CoreLib") +include_directories("../../NucleusLib/inc") +include_directories("../../NucleusLib") +include_directories("../../PubUtilLib") + +include_directories(${OPENSSL_INCLUDE_DIR}) + +set(plUruLauncher_HEADERS + Intern.h + Pch.h + plLauncherInfo.h +) + +set(plUruLauncher_SOURCES + Main.cpp + SelfPatcher.cpp +) + +set(plUruLauncher_RESOURCES + plUruLauncher.rc + resource.h + + banner.bmp + Dirt.ICO +) + +add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEADERS} + ${plUruLauncher_RESOURCES}) +target_link_libraries(plUruLauncher CoreLib) +target_link_libraries(plUruLauncher CoreLibExe) +target_link_libraries(plUruLauncher plAudioCore) +target_link_libraries(plUruLauncher plClientPatcher) +target_link_libraries(plUruLauncher plCompression) +target_link_libraries(plUruLauncher plEncryption) +target_link_libraries(plUruLauncher plFile) +target_link_libraries(plUruLauncher plNetClient) +target_link_libraries(plUruLauncher plNetClientComm) +target_link_libraries(plUruLauncher plNetGameLib) +target_link_libraries(plUruLauncher plNetMessage) +target_link_libraries(plUruLauncher plNetTransport) +target_link_libraries(plUruLauncher plUnifiedTime) +target_link_libraries(plUruLauncher pnAsyncCore) +target_link_libraries(plUruLauncher pnAsyncCoreExe) +target_link_libraries(plUruLauncher pnNetBase) +target_link_libraries(plUruLauncher pnNetCli) +target_link_libraries(plUruLauncher pnNetCommon) +target_link_libraries(plUruLauncher pnNetProtocol) +target_link_libraries(plUruLauncher pnProduct) +target_link_libraries(plUruLauncher pnSimpleNet) +target_link_libraries(plUruLauncher pnTimer) +target_link_libraries(plUruLauncher pnUtils) +target_link_libraries(plUruLauncher pnUtilsExe) + +target_link_libraries(plUruLauncher ${OPENSSL_LIBRARIES}) +target_link_libraries(plUruLauncher ${Ogg_LIBRARIES}) +target_link_libraries(plUruLauncher ${Vorbis_LIBRARIES}) +target_link_libraries(plUruLauncher ws2_32) +target_link_libraries(plUruLauncher winhttp) +target_link_libraries(plUruLauncher rpcrt4) +target_link_libraries(plUruLauncher dxerr9) +target_link_libraries(plUruLauncher comctl32) + +source_group("Source Files" FILES ${plUruLauncher_SOURCES}) +source_group("Header Files" FILES ${plUruLauncher_HEADERS}) +source_group("Resource Files" FILES ${plUruLauncher_RESOURCES}) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h index 08cc9564..63d73f12 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h @@ -36,6 +36,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include + +#include +#include +#include + #include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" #include "pnAsyncCore/pnAsyncCore.h" @@ -45,9 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plEncryption/plChecksum.h" #include "plCompression/plZlibStream.h" -#include "../plClientPatcher/UruPlayer.h" +#include "plClientPatcher/UruPlayer.h" #include "plLauncherInfo.h" #include "Intern.h" -#include "WinHttp.h" diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc index dcc6778e..4338f3a3 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#include \r\n" "\0" END