Fix line endings and tabs
140
CMakeLists.txt
@ -1,70 +1,70 @@
|
|||||||
project(Plasma)
|
project(Plasma)
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
# Find all 3rd-party libraries that are required
|
# Find all 3rd-party libraries that are required
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
find_package(PythonLibs REQUIRED)
|
find_package(PythonLibs REQUIRED)
|
||||||
find_package(EXPAT REQUIRED)
|
find_package(EXPAT REQUIRED)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
find_package(PHYSX REQUIRED) #TODO: Not required if we aren't building the client
|
find_package(PHYSX REQUIRED) #TODO: Not required if we aren't building the client
|
||||||
find_package(Ogg REQUIRED) #TODO: Not required if we aren't building the client
|
find_package(Ogg REQUIRED) #TODO: Not required if we aren't building the client
|
||||||
find_package(Vorbis REQUIRED) #TODO: Not required if we aren't building the client
|
find_package(Vorbis REQUIRED) #TODO: Not required if we aren't building the client
|
||||||
find_package(Speex REQUIRED) #TODO: Not required if we aren't building the client
|
find_package(Speex REQUIRED) #TODO: Not required if we aren't building the client
|
||||||
find_package(DirectX REQUIRED)
|
find_package(DirectX REQUIRED)
|
||||||
find_package(Bink) #TODO: Find Bink, but don't require it if plPipeline isn't built...
|
find_package(Bink) #TODO: Find Bink, but don't require it if plPipeline isn't built...
|
||||||
# Or better yet, just eliminate bink altogether
|
# Or better yet, just eliminate bink altogether
|
||||||
|
|
||||||
option(PLASMA_EXTERNAL_RELEASE "Is this release intended for the general public?" OFF)
|
option(PLASMA_EXTERNAL_RELEASE "Is this release intended for the general public?" OFF)
|
||||||
|
|
||||||
if(PLASMA_EXTERNAL_RELEASE)
|
if(PLASMA_EXTERNAL_RELEASE)
|
||||||
add_definitions(-DPLASMA_EXTERNAL_RELEASE)
|
add_definitions(-DPLASMA_EXTERNAL_RELEASE)
|
||||||
endif(PLASMA_EXTERNAL_RELEASE)
|
endif(PLASMA_EXTERNAL_RELEASE)
|
||||||
|
|
||||||
set(PLASMA_BUILD_TYPE "Live"
|
set(PLASMA_BUILD_TYPE "Live"
|
||||||
CACHE STRING "Which type of client to build")
|
CACHE STRING "Which type of client to build")
|
||||||
set_property(CACHE PLASMA_BUILD_TYPE PROPERTY STRINGS
|
set_property(CACHE PLASMA_BUILD_TYPE PROPERTY STRINGS
|
||||||
"Dev" "QA" "Test" "Beta" "Live")
|
"Dev" "QA" "Test" "Beta" "Live")
|
||||||
|
|
||||||
if(PLASMA_BUILD_TYPE STREQUAL "Dev")
|
if(PLASMA_BUILD_TYPE STREQUAL "Dev")
|
||||||
add_definitions(-DBUILD_TYPE=BUILD_TYPE_DEV)
|
add_definitions(-DBUILD_TYPE=BUILD_TYPE_DEV)
|
||||||
elseif(PLASMA_BUILD_TYPE STREQUAL "QA")
|
elseif(PLASMA_BUILD_TYPE STREQUAL "QA")
|
||||||
add_definitions(-DBUILD_TYPE=BUILD_TYPE_QA)
|
add_definitions(-DBUILD_TYPE=BUILD_TYPE_QA)
|
||||||
elseif(PLASMA_BUILD_TYPE STREQUAL "Test")
|
elseif(PLASMA_BUILD_TYPE STREQUAL "Test")
|
||||||
add_definitions(-DBUILD_TYPE=BUILD_TYPE_TEST)
|
add_definitions(-DBUILD_TYPE=BUILD_TYPE_TEST)
|
||||||
elseif(PLASMA_BUILD_TYPE STREQUAL "Beta")
|
elseif(PLASMA_BUILD_TYPE STREQUAL "Beta")
|
||||||
add_definitions(-DBUILD_TYPE=BUILD_TYPE_BETA)
|
add_definitions(-DBUILD_TYPE=BUILD_TYPE_BETA)
|
||||||
elseif(PLASMA_BUILD_TYPE STREQUAL "Live")
|
elseif(PLASMA_BUILD_TYPE STREQUAL "Live")
|
||||||
add_definitions(-DBUILD_TYPE=BUILD_TYPE_LIVE)
|
add_definitions(-DBUILD_TYPE=BUILD_TYPE_LIVE)
|
||||||
endif(PLASMA_BUILD_TYPE STREQUAL "Dev")
|
endif(PLASMA_BUILD_TYPE STREQUAL "Dev")
|
||||||
|
|
||||||
set(PLASMA_TARGETS "Client"
|
set(PLASMA_TARGETS "Client"
|
||||||
CACHE STRING "Which set of plasma targets to build and use")
|
CACHE STRING "Which set of plasma targets to build and use")
|
||||||
set_property(CACHE PLASMA_TARGETS PROPERTY STRINGS
|
set_property(CACHE PLASMA_TARGETS PROPERTY STRINGS
|
||||||
"Client" "Server" "Patcher" "Ethereal" "NoAvMsgs")
|
"Client" "Server" "Patcher" "Ethereal" "NoAvMsgs")
|
||||||
|
|
||||||
if(PLASMA_TARGETS STREQUAL "Patcher")
|
if(PLASMA_TARGETS STREQUAL "Patcher")
|
||||||
add_definitions(-DPATCHER)
|
add_definitions(-DPATCHER)
|
||||||
endif(PLASMA_TARGETS STREQUAL "Patcher")
|
endif(PLASMA_TARGETS STREQUAL "Patcher")
|
||||||
|
|
||||||
if(PLASMA_TARGETS STREQUAL "Server")
|
if(PLASMA_TARGETS STREQUAL "Server")
|
||||||
add_definitions(-DSERVER)
|
add_definitions(-DSERVER)
|
||||||
endif(PLASMA_TARGETS STREQUAL "Server")
|
endif(PLASMA_TARGETS STREQUAL "Server")
|
||||||
|
|
||||||
if(PLASMA_TARGETS STREQUAL "NoAvMsgs")
|
if(PLASMA_TARGETS STREQUAL "NoAvMsgs")
|
||||||
add_definitions(-DNO_AV_MSGS)
|
add_definitions(-DNO_AV_MSGS)
|
||||||
endif(PLASMA_TARGETS STREQUAL "NoAvMsgs")
|
endif(PLASMA_TARGETS STREQUAL "NoAvMsgs")
|
||||||
|
|
||||||
if(PLASMA_TARGETS STREQUAL "Ethereal")
|
if(PLASMA_TARGETS STREQUAL "Ethereal")
|
||||||
add_definitions(-DSTREAM_LOGGER)
|
add_definitions(-DSTREAM_LOGGER)
|
||||||
endif(PLASMA_TARGETS STREQUAL "Ethereal")
|
endif(PLASMA_TARGETS STREQUAL "Ethereal")
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
add_subdirectory(Sources/Plasma)
|
add_subdirectory(Sources/Plasma)
|
||||||
# add_subdirectory(Sources/Tools)
|
# add_subdirectory(Sources/Tools)
|
||||||
|
1244
LICENSE.txt
@ -1,4 +1,4 @@
|
|||||||
add_subdirectory(plClient)
|
add_subdirectory(plClient)
|
||||||
add_subdirectory(plClientPatcher)
|
add_subdirectory(plClientPatcher)
|
||||||
add_subdirectory(plPythonPack)
|
add_subdirectory(plPythonPack)
|
||||||
add_subdirectory(plUruLauncher)
|
add_subdirectory(plUruLauncher)
|
||||||
|
@ -1,213 +1,213 @@
|
|||||||
include_directories("../../Apps")
|
include_directories("../../Apps")
|
||||||
include_directories("../../CoreLib")
|
include_directories("../../CoreLib")
|
||||||
include_directories("../../FeatureLib/inc")
|
include_directories("../../FeatureLib/inc")
|
||||||
include_directories("../../FeatureLib")
|
include_directories("../../FeatureLib")
|
||||||
include_directories("../../NucleusLib/inc")
|
include_directories("../../NucleusLib/inc")
|
||||||
include_directories("../../NucleusLib")
|
include_directories("../../NucleusLib")
|
||||||
include_directories("../../PubUtilLib/inc")
|
include_directories("../../PubUtilLib/inc")
|
||||||
include_directories("../../PubUtilLib")
|
include_directories("../../PubUtilLib")
|
||||||
|
|
||||||
if(Bink_SDK_AVAILABLE)
|
if(Bink_SDK_AVAILABLE)
|
||||||
include_directories(${Bink_INCLUDE_DIR})
|
include_directories(${Bink_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
include_directories(${OPENAL_INCLUDE_DIR})
|
include_directories(${OPENAL_INCLUDE_DIR})
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
include_directories(${PYTHON_INCLUDE_DIR})
|
include_directories(${PYTHON_INCLUDE_DIR})
|
||||||
|
|
||||||
set(plClient_HEADERS
|
set(plClient_HEADERS
|
||||||
plClient.h
|
plClient.h
|
||||||
plClientCreatable.h
|
plClientCreatable.h
|
||||||
#plClientKey.h
|
#plClientKey.h
|
||||||
plClientUpdateFormat.h
|
plClientUpdateFormat.h
|
||||||
#plPluginClient.h
|
#plPluginClient.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plClient_SOURCES
|
set(plClient_SOURCES
|
||||||
pfAllCreatables.cpp
|
pfAllCreatables.cpp
|
||||||
plAllCreatables.cpp
|
plAllCreatables.cpp
|
||||||
plClient.cpp
|
plClient.cpp
|
||||||
#plClientKey.cpp
|
#plClientKey.cpp
|
||||||
#plPluginClient.cpp
|
#plPluginClient.cpp
|
||||||
pnAllCreatables.cpp
|
pnAllCreatables.cpp
|
||||||
winmain.cpp
|
winmain.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plClient_TEXT
|
set(plClient_TEXT
|
||||||
../../../../Docs/ReleaseNotes/ReleaseNotes.txt
|
../../../../Docs/ReleaseNotes/ReleaseNotes.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plClient_RESOURCES
|
set(plClient_RESOURCES
|
||||||
res/plClient.rc
|
res/plClient.rc
|
||||||
res/resource.h
|
res/resource.h
|
||||||
|
|
||||||
res/banner.bmp
|
res/banner.bmp
|
||||||
res/bitmap1.bmp
|
res/bitmap1.bmp
|
||||||
res/bitmap2.bmp
|
res/bitmap2.bmp
|
||||||
res/bitmap3.bmp
|
res/bitmap3.bmp
|
||||||
res/bmp00001.bmp
|
res/bmp00001.bmp
|
||||||
res/bmp00002.bmp
|
res/bmp00002.bmp
|
||||||
res/bmp00003.bmp
|
res/bmp00003.bmp
|
||||||
res/bmp00004.bmp
|
res/bmp00004.bmp
|
||||||
res/bmp00005.bmp
|
res/bmp00005.bmp
|
||||||
res/book.bmp
|
res/book.bmp
|
||||||
res/book_cli.bmp
|
res/book_cli.bmp
|
||||||
res/book_hig.bmp
|
res/book_hig.bmp
|
||||||
res/cnsl1.bin
|
res/cnsl1.bin
|
||||||
res/cursor_clicked.bmp
|
res/cursor_clicked.bmp
|
||||||
res/cursor_disabled.bmp
|
res/cursor_disabled.bmp
|
||||||
res/cursor_down.bmp
|
res/cursor_down.bmp
|
||||||
res/cursor_grab.bmp
|
res/cursor_grab.bmp
|
||||||
res/cursor_left.bmp
|
res/cursor_left.bmp
|
||||||
res/cursor_open.bmp
|
res/cursor_open.bmp
|
||||||
res/cursor_poised.bmp
|
res/cursor_poised.bmp
|
||||||
res/cursor_right.bmp
|
res/cursor_right.bmp
|
||||||
res/cursor_u.bmp
|
res/cursor_u.bmp
|
||||||
res/cursor_up.bmp
|
res/cursor_up.bmp
|
||||||
res/cursor_upward.bmp
|
res/cursor_upward.bmp
|
||||||
res/Dirt.ICO
|
res/Dirt.ICO
|
||||||
res/headspin.ico
|
res/headspin.ico
|
||||||
res/Microphone.bmp
|
res/Microphone.bmp
|
||||||
res/Speaker.bmp
|
res/Speaker.bmp
|
||||||
res/xLoading_Linking.01.jpg
|
res/xLoading_Linking.01.jpg
|
||||||
res/xLoading_Linking.02.jpg
|
res/xLoading_Linking.02.jpg
|
||||||
res/xLoading_Linking.03.jpg
|
res/xLoading_Linking.03.jpg
|
||||||
res/xLoading_Linking.04.jpg
|
res/xLoading_Linking.04.jpg
|
||||||
res/xLoading_Linking.05.jpg
|
res/xLoading_Linking.05.jpg
|
||||||
res/xLoading_Linking.06.jpg
|
res/xLoading_Linking.06.jpg
|
||||||
res/xLoading_Linking.07.jpg
|
res/xLoading_Linking.07.jpg
|
||||||
res/xLoading_Linking.08.jpg
|
res/xLoading_Linking.08.jpg
|
||||||
res/xLoading_Linking.09.jpg
|
res/xLoading_Linking.09.jpg
|
||||||
res/xLoading_Linking.10.jpg
|
res/xLoading_Linking.10.jpg
|
||||||
res/xLoading_Linking.11.jpg
|
res/xLoading_Linking.11.jpg
|
||||||
res/xLoading_Linking.12.jpg
|
res/xLoading_Linking.12.jpg
|
||||||
res/xLoading_Linking.13.jpg
|
res/xLoading_Linking.13.jpg
|
||||||
res/xLoading_Linking.14.jpg
|
res/xLoading_Linking.14.jpg
|
||||||
res/xLoading_Linking.15.jpg
|
res/xLoading_Linking.15.jpg
|
||||||
res/xLoading_Linking.16.jpg
|
res/xLoading_Linking.16.jpg
|
||||||
res/xLoading_Linking.17.jpg
|
res/xLoading_Linking.17.jpg
|
||||||
res/xLoading_Linking.18.jpg
|
res/xLoading_Linking.18.jpg
|
||||||
res/xLoading_Linking_Text.jpg
|
res/xLoading_Linking_Text.jpg
|
||||||
res/xLoading_Updating_Text.jpg
|
res/xLoading_Updating_Text.jpg
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(plClient WIN32 ${plClient_SOURCES} ${plClient_HEADERS}
|
add_executable(plClient WIN32 ${plClient_SOURCES} ${plClient_HEADERS}
|
||||||
${plClient_TEXT} ${plClient_RESOURCES})
|
${plClient_TEXT} ${plClient_RESOURCES})
|
||||||
target_link_libraries(plClient CoreLib)
|
target_link_libraries(plClient CoreLib)
|
||||||
target_link_libraries(plClient CoreLibExe)
|
target_link_libraries(plClient CoreLibExe)
|
||||||
target_link_libraries(plClient pfAnimation)
|
target_link_libraries(plClient pfAnimation)
|
||||||
target_link_libraries(plClient pfAudio)
|
target_link_libraries(plClient pfAudio)
|
||||||
target_link_libraries(plClient pfCamera)
|
target_link_libraries(plClient pfCamera)
|
||||||
target_link_libraries(plClient pfCCR)
|
target_link_libraries(plClient pfCCR)
|
||||||
target_link_libraries(plClient pfCharacter)
|
target_link_libraries(plClient pfCharacter)
|
||||||
target_link_libraries(plClient pfConditional)
|
target_link_libraries(plClient pfConditional)
|
||||||
target_link_libraries(plClient pfConsole)
|
target_link_libraries(plClient pfConsole)
|
||||||
target_link_libraries(plClient pfCsrSrv)
|
target_link_libraries(plClient pfCsrSrv)
|
||||||
target_link_libraries(plClient pfGameGUIMgr)
|
target_link_libraries(plClient pfGameGUIMgr)
|
||||||
target_link_libraries(plClient pfGameMgr)
|
target_link_libraries(plClient pfGameMgr)
|
||||||
target_link_libraries(plClient pfGameScoreMgr)
|
target_link_libraries(plClient pfGameScoreMgr)
|
||||||
target_link_libraries(plClient pfJournalBook)
|
target_link_libraries(plClient pfJournalBook)
|
||||||
target_link_libraries(plClient pfLocalizationMgr)
|
target_link_libraries(plClient pfLocalizationMgr)
|
||||||
target_link_libraries(plClient pfMessage)
|
target_link_libraries(plClient pfMessage)
|
||||||
target_link_libraries(plClient pfPython)
|
target_link_libraries(plClient pfPython)
|
||||||
target_link_libraries(plClient pfSecurePreloader)
|
target_link_libraries(plClient pfSecurePreloader)
|
||||||
target_link_libraries(plClient pfStackTrace)
|
target_link_libraries(plClient pfStackTrace)
|
||||||
target_link_libraries(plClient pfSurface)
|
target_link_libraries(plClient pfSurface)
|
||||||
target_link_libraries(plClient plAgeDescription)
|
target_link_libraries(plClient plAgeDescription)
|
||||||
target_link_libraries(plClient plAgeLoader)
|
target_link_libraries(plClient plAgeLoader)
|
||||||
target_link_libraries(plClient plAudible)
|
target_link_libraries(plClient plAudible)
|
||||||
target_link_libraries(plClient plAudio)
|
target_link_libraries(plClient plAudio)
|
||||||
target_link_libraries(plClient plAudioCore)
|
target_link_libraries(plClient plAudioCore)
|
||||||
target_link_libraries(plClient plAvatar)
|
target_link_libraries(plClient plAvatar)
|
||||||
#target_link_libraries(plClient plClientKey)
|
#target_link_libraries(plClient plClientKey)
|
||||||
target_link_libraries(plClient plCompression)
|
target_link_libraries(plClient plCompression)
|
||||||
target_link_libraries(plClient plContainer)
|
target_link_libraries(plClient plContainer)
|
||||||
target_link_libraries(plClient plDrawable)
|
target_link_libraries(plClient plDrawable)
|
||||||
target_link_libraries(plClient plEncryption)
|
target_link_libraries(plClient plEncryption)
|
||||||
target_link_libraries(plClient plFile)
|
target_link_libraries(plClient plFile)
|
||||||
target_link_libraries(plClient plGImage)
|
target_link_libraries(plClient plGImage)
|
||||||
target_link_libraries(plClient plGLight)
|
target_link_libraries(plClient plGLight)
|
||||||
target_link_libraries(plClient plInputCore)
|
target_link_libraries(plClient plInputCore)
|
||||||
target_link_libraries(plClient plInterp)
|
target_link_libraries(plClient plInterp)
|
||||||
target_link_libraries(plClient plIntersect)
|
target_link_libraries(plClient plIntersect)
|
||||||
target_link_libraries(plClient plJPEG)
|
target_link_libraries(plClient plJPEG)
|
||||||
target_link_libraries(plClient plMath)
|
target_link_libraries(plClient plMath)
|
||||||
target_link_libraries(plClient plMessage)
|
target_link_libraries(plClient plMessage)
|
||||||
target_link_libraries(plClient plModifier)
|
target_link_libraries(plClient plModifier)
|
||||||
target_link_libraries(plClient plNetClient)
|
target_link_libraries(plClient plNetClient)
|
||||||
target_link_libraries(plClient plNetClientComm)
|
target_link_libraries(plClient plNetClientComm)
|
||||||
target_link_libraries(plClient plNetClientRecorder)
|
target_link_libraries(plClient plNetClientRecorder)
|
||||||
target_link_libraries(plClient plNetCommon)
|
target_link_libraries(plClient plNetCommon)
|
||||||
target_link_libraries(plClient plNetGameLib)
|
target_link_libraries(plClient plNetGameLib)
|
||||||
target_link_libraries(plClient plNetMessage)
|
target_link_libraries(plClient plNetMessage)
|
||||||
target_link_libraries(plClient plNetTransport)
|
target_link_libraries(plClient plNetTransport)
|
||||||
target_link_libraries(plClient plParticleSystem)
|
target_link_libraries(plClient plParticleSystem)
|
||||||
target_link_libraries(plClient plPhysical)
|
target_link_libraries(plClient plPhysical)
|
||||||
target_link_libraries(plClient plPhysX)
|
target_link_libraries(plClient plPhysX)
|
||||||
target_link_libraries(plClient plPipeline)
|
target_link_libraries(plClient plPipeline)
|
||||||
target_link_libraries(plClient plProgressMgr)
|
target_link_libraries(plClient plProgressMgr)
|
||||||
target_link_libraries(plClient plResMgr)
|
target_link_libraries(plClient plResMgr)
|
||||||
target_link_libraries(plClient plScene)
|
target_link_libraries(plClient plScene)
|
||||||
target_link_libraries(plClient plSDL)
|
target_link_libraries(plClient plSDL)
|
||||||
target_link_libraries(plClient plSockets)
|
target_link_libraries(plClient plSockets)
|
||||||
target_link_libraries(plClient plStatGather)
|
target_link_libraries(plClient plStatGather)
|
||||||
target_link_libraries(plClient plStatusLog)
|
target_link_libraries(plClient plStatusLog)
|
||||||
target_link_libraries(plClient plStreamLogger)
|
target_link_libraries(plClient plStreamLogger)
|
||||||
target_link_libraries(plClient plSurface)
|
target_link_libraries(plClient plSurface)
|
||||||
target_link_libraries(plClient plTransform)
|
target_link_libraries(plClient plTransform)
|
||||||
target_link_libraries(plClient plUnifiedTime)
|
target_link_libraries(plClient plUnifiedTime)
|
||||||
target_link_libraries(plClient plUUID)
|
target_link_libraries(plClient plUUID)
|
||||||
target_link_libraries(plClient plVault)
|
target_link_libraries(plClient plVault)
|
||||||
target_link_libraries(plClient pnAddrInfo)
|
target_link_libraries(plClient pnAddrInfo)
|
||||||
target_link_libraries(plClient pnAsyncCore)
|
target_link_libraries(plClient pnAsyncCore)
|
||||||
target_link_libraries(plClient pnAsyncCoreExe)
|
target_link_libraries(plClient pnAsyncCoreExe)
|
||||||
target_link_libraries(plClient pnCsrNet)
|
target_link_libraries(plClient pnCsrNet)
|
||||||
target_link_libraries(plClient pnDispatch)
|
target_link_libraries(plClient pnDispatch)
|
||||||
target_link_libraries(plClient pnFactory)
|
target_link_libraries(plClient pnFactory)
|
||||||
target_link_libraries(plClient pnGameMgr)
|
target_link_libraries(plClient pnGameMgr)
|
||||||
target_link_libraries(plClient pnIni)
|
target_link_libraries(plClient pnIni)
|
||||||
target_link_libraries(plClient pnIniExe)
|
target_link_libraries(plClient pnIniExe)
|
||||||
target_link_libraries(plClient pnInputCore)
|
target_link_libraries(plClient pnInputCore)
|
||||||
target_link_libraries(plClient pnKeyedObject)
|
target_link_libraries(plClient pnKeyedObject)
|
||||||
target_link_libraries(plClient pnMessage)
|
target_link_libraries(plClient pnMessage)
|
||||||
target_link_libraries(plClient pnModifier)
|
target_link_libraries(plClient pnModifier)
|
||||||
target_link_libraries(plClient pnNetBase)
|
target_link_libraries(plClient pnNetBase)
|
||||||
target_link_libraries(plClient pnNetCli)
|
target_link_libraries(plClient pnNetCli)
|
||||||
target_link_libraries(plClient pnNetCommon)
|
target_link_libraries(plClient pnNetCommon)
|
||||||
target_link_libraries(plClient pnNetProtocol)
|
target_link_libraries(plClient pnNetProtocol)
|
||||||
target_link_libraries(plClient pnNucleusInc)
|
target_link_libraries(plClient pnNucleusInc)
|
||||||
target_link_libraries(plClient pnProduct)
|
target_link_libraries(plClient pnProduct)
|
||||||
target_link_libraries(plClient pnSceneObject)
|
target_link_libraries(plClient pnSceneObject)
|
||||||
target_link_libraries(plClient pnSimpleNet)
|
target_link_libraries(plClient pnSimpleNet)
|
||||||
target_link_libraries(plClient pnTimer)
|
target_link_libraries(plClient pnTimer)
|
||||||
target_link_libraries(plClient pnUtils)
|
target_link_libraries(plClient pnUtils)
|
||||||
target_link_libraries(plClient pnUtilsExe)
|
target_link_libraries(plClient pnUtilsExe)
|
||||||
|
|
||||||
target_link_libraries(plClient debug ${PYTHON_DEBUG_LIBRARY})
|
target_link_libraries(plClient debug ${PYTHON_DEBUG_LIBRARY})
|
||||||
target_link_libraries(plClient optimized ${PYTHON_LIBRARY})
|
target_link_libraries(plClient optimized ${PYTHON_LIBRARY})
|
||||||
target_link_libraries(plClient ${OPENAL_LIBRARY})
|
target_link_libraries(plClient ${OPENAL_LIBRARY})
|
||||||
target_link_libraries(plClient ${OPENSSL_LIBRARIES})
|
target_link_libraries(plClient ${OPENSSL_LIBRARIES})
|
||||||
target_link_libraries(plClient ${EXPAT_LIBRARY})
|
target_link_libraries(plClient ${EXPAT_LIBRARY})
|
||||||
target_link_libraries(plClient ${JPEG_LIBRARY})
|
target_link_libraries(plClient ${JPEG_LIBRARY})
|
||||||
target_link_libraries(plClient ${Speex_LIBRARY})
|
target_link_libraries(plClient ${Speex_LIBRARY})
|
||||||
target_link_libraries(plClient ${PHYSX_LIBRARIES})
|
target_link_libraries(plClient ${PHYSX_LIBRARIES})
|
||||||
target_link_libraries(plClient ${Ogg_LIBRARIES})
|
target_link_libraries(plClient ${Ogg_LIBRARIES})
|
||||||
target_link_libraries(plClient ${Vorbis_LIBRARIES})
|
target_link_libraries(plClient ${Vorbis_LIBRARIES})
|
||||||
target_link_libraries(plClient ${DirectX_LIBRARIES})
|
target_link_libraries(plClient ${DirectX_LIBRARIES})
|
||||||
|
|
||||||
if(Bink_SDK_AVAILABLE)
|
if(Bink_SDK_AVAILABLE)
|
||||||
target_link_libraries(plClient ${Bink_LIBRARIES})
|
target_link_libraries(plClient ${Bink_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(plClient Rpcrt4)
|
target_link_libraries(plClient Rpcrt4)
|
||||||
target_link_libraries(plClient Winhttp)
|
target_link_libraries(plClient Winhttp)
|
||||||
target_link_libraries(plClient Version)
|
target_link_libraries(plClient Version)
|
||||||
target_link_libraries(plClient Vfw32)
|
target_link_libraries(plClient Vfw32)
|
||||||
target_link_libraries(plClient Ws2_32)
|
target_link_libraries(plClient Ws2_32)
|
||||||
target_link_libraries(plClient strmiids)
|
target_link_libraries(plClient strmiids)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
source_group("Source Files" FILES ${plClient_SOURCES})
|
source_group("Source Files" FILES ${plClient_SOURCES})
|
||||||
source_group("Header Files" FILES ${plClient_HEADERS})
|
source_group("Header Files" FILES ${plClient_HEADERS})
|
||||||
source_group("Text" FILES ${plClient_TEXT})
|
source_group("Text" FILES ${plClient_TEXT})
|
||||||
source_group("Resource Files" FILES ${plClient_RESOURCES})
|
source_group("Resource Files" FILES ${plClient_RESOURCES})
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "pfAllCreatables.h"
|
#include "pfAllCreatables.h"
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsWindows.h"
|
#include "hsWindows.h"
|
||||||
#include "plAllCreatables.h"
|
#include "plAllCreatables.h"
|
||||||
|
@ -1,295 +1,295 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef plClient_inc
|
#ifndef plClient_inc
|
||||||
#define plClient_inc
|
#define plClient_inc
|
||||||
|
|
||||||
|
|
||||||
//#define NEW_CAMERA_CODE
|
//#define NEW_CAMERA_CODE
|
||||||
|
|
||||||
#include "hsWindowHndl.h"
|
#include "hsWindowHndl.h"
|
||||||
#include "hsBitVector.h"
|
#include "hsBitVector.h"
|
||||||
#include "hsTemplates.h"
|
#include "hsTemplates.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
#include "hsStlUtils.h"
|
#include "hsStlUtils.h"
|
||||||
#include "pnKeyedObject/hsKeyedObject.h"
|
#include "pnKeyedObject/hsKeyedObject.h"
|
||||||
#include "pnKeyedObject/plUoid.h"
|
#include "pnKeyedObject/plUoid.h"
|
||||||
#include "plScene/plRenderRequest.h"
|
#include "plScene/plRenderRequest.h"
|
||||||
|
|
||||||
class plSceneNode;
|
class plSceneNode;
|
||||||
class plPipeline;
|
class plPipeline;
|
||||||
class hsG3DDeviceModeRecord;
|
class hsG3DDeviceModeRecord;
|
||||||
class plInputManager;
|
class plInputManager;
|
||||||
class plInputController;
|
class plInputController;
|
||||||
class plSceneObject;
|
class plSceneObject;
|
||||||
class pfConsoleEngine;
|
class pfConsoleEngine;
|
||||||
class pfConsole;
|
class pfConsole;
|
||||||
class plAudioSystem;
|
class plAudioSystem;
|
||||||
class plVirtualCam1;
|
class plVirtualCam1;
|
||||||
class plKey;
|
class plKey;
|
||||||
class plPageTreeMgr;
|
class plPageTreeMgr;
|
||||||
class plTransitionMgr;
|
class plTransitionMgr;
|
||||||
class plLinkEffectsMgr;
|
class plLinkEffectsMgr;
|
||||||
class plOperationProgress;
|
class plOperationProgress;
|
||||||
class pfGameGUIMgr;
|
class pfGameGUIMgr;
|
||||||
class pfKI;
|
class pfKI;
|
||||||
class plAnimDebugList;
|
class plAnimDebugList;
|
||||||
class plFontCache;
|
class plFontCache;
|
||||||
class plClientMsg;
|
class plClientMsg;
|
||||||
class plLocation;
|
class plLocation;
|
||||||
class plMovieMsg;
|
class plMovieMsg;
|
||||||
class plBinkPlayer;
|
class plBinkPlayer;
|
||||||
class plPreloaderMsg;
|
class plPreloaderMsg;
|
||||||
class plNetCommAuthMsg;
|
class plNetCommAuthMsg;
|
||||||
class plAgeLoaded2Msg;
|
class plAgeLoaded2Msg;
|
||||||
|
|
||||||
|
|
||||||
typedef void (*plMessagePumpProc)( void );
|
typedef void (*plMessagePumpProc)( void );
|
||||||
|
|
||||||
class plClient : public hsKeyedObject
|
class plClient : public hsKeyedObject
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
class plRoomRec
|
class plRoomRec
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
plSceneNode *fNode;
|
plSceneNode *fNode;
|
||||||
UInt32 fFlags;
|
UInt32 fFlags;
|
||||||
|
|
||||||
plRoomRec() { fNode = nil; fFlags = 0; }
|
plRoomRec() { fNode = nil; fFlags = 0; }
|
||||||
plRoomRec( plSceneNode *n, UInt32 f ) : fNode( n ), fFlags( f ) {}
|
plRoomRec( plSceneNode *n, UInt32 f ) : fNode( n ), fFlags( f ) {}
|
||||||
|
|
||||||
enum Flags
|
enum Flags
|
||||||
{
|
{
|
||||||
kHeld = 0x00000001
|
kHeld = 0x00000001
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hsBitVector fFlags;
|
hsBitVector fFlags;
|
||||||
|
|
||||||
plInputManager* fInputManager;
|
plInputManager* fInputManager;
|
||||||
|
|
||||||
plPageTreeMgr* fPageMgr;
|
plPageTreeMgr* fPageMgr;
|
||||||
hsTArray<plRoomRec> fRooms;
|
hsTArray<plRoomRec> fRooms;
|
||||||
plSceneNode* fCurrentNode;
|
plSceneNode* fCurrentNode;
|
||||||
|
|
||||||
plPipeline* fPipeline;
|
plPipeline* fPipeline;
|
||||||
hsColorRGBA fClearColor;
|
hsColorRGBA fClearColor;
|
||||||
plTransitionMgr *fTransitionMgr;
|
plTransitionMgr *fTransitionMgr;
|
||||||
plLinkEffectsMgr *fLinkEffectsMgr;
|
plLinkEffectsMgr *fLinkEffectsMgr;
|
||||||
plFontCache *fFontCache;
|
plFontCache *fFontCache;
|
||||||
|
|
||||||
pfConsoleEngine* fConsoleEngine;
|
pfConsoleEngine* fConsoleEngine;
|
||||||
pfConsole* fConsole;
|
pfConsole* fConsole;
|
||||||
|
|
||||||
pfKI *fKIGUIGlue;
|
pfKI *fKIGUIGlue;
|
||||||
|
|
||||||
hsBool fDone;
|
hsBool fDone;
|
||||||
hsBool fWindowActive;
|
hsBool fWindowActive;
|
||||||
|
|
||||||
hsWindowHndl fWindowHndl;
|
hsWindowHndl fWindowHndl;
|
||||||
|
|
||||||
double fLastProgressUpdate;
|
double fLastProgressUpdate;
|
||||||
plOperationProgress *fProgressBar;
|
plOperationProgress *fProgressBar;
|
||||||
|
|
||||||
pfGameGUIMgr *fGameGUIMgr;
|
pfGameGUIMgr *fGameGUIMgr;
|
||||||
|
|
||||||
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
|
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
|
||||||
|
|
||||||
hsBool IUpdate();
|
hsBool IUpdate();
|
||||||
hsBool IDraw();
|
hsBool IDraw();
|
||||||
hsBool IDrawProgress();
|
hsBool IDrawProgress();
|
||||||
|
|
||||||
plVirtualCam1* fNewCamera;
|
plVirtualCam1* fNewCamera;
|
||||||
|
|
||||||
static plClient* fInstance;
|
static plClient* fInstance;
|
||||||
char * fpAuxInitDir;
|
char * fpAuxInitDir;
|
||||||
static hsBool fDelayMS;
|
static hsBool fDelayMS;
|
||||||
|
|
||||||
int fClampCap;
|
int fClampCap;
|
||||||
int fQuality;
|
int fQuality;
|
||||||
|
|
||||||
hsBool fQuitIntro;
|
hsBool fQuitIntro;
|
||||||
hsTArray<plBinkPlayer*> fMovies;
|
hsTArray<plBinkPlayer*> fMovies;
|
||||||
|
|
||||||
hsBool fPatchGlobalAges;
|
hsBool fPatchGlobalAges;
|
||||||
|
|
||||||
plMessagePumpProc fMessagePumpProc;
|
plMessagePumpProc fMessagePumpProc;
|
||||||
|
|
||||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||||
bool bPythonDebugConnected;
|
bool bPythonDebugConnected;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hsTArray<plRenderRequest*> fPreRenderRequests;
|
hsTArray<plRenderRequest*> fPreRenderRequests;
|
||||||
hsTArray<plRenderRequest*> fPostRenderRequests;
|
hsTArray<plRenderRequest*> fPostRenderRequests;
|
||||||
|
|
||||||
bool fHoldLoadRequests;
|
bool fHoldLoadRequests;
|
||||||
class LoadRequest
|
class LoadRequest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LoadRequest(const plLocation& loc, bool hold) { this->loc = loc; this->hold = hold; }
|
LoadRequest(const plLocation& loc, bool hold) { this->loc = loc; this->hold = hold; }
|
||||||
plLocation loc;
|
plLocation loc;
|
||||||
bool hold;
|
bool hold;
|
||||||
};
|
};
|
||||||
typedef std::list<LoadRequest*> LoadList;
|
typedef std::list<LoadRequest*> LoadList;
|
||||||
LoadList fLoadRooms;
|
LoadList fLoadRooms;
|
||||||
int fNumLoadingRooms; // Number of rooms we're waiting for load callbacks on
|
int fNumLoadingRooms; // Number of rooms we're waiting for load callbacks on
|
||||||
std::vector<plLocation> fRoomsLoading; // the locations we are currently in the middle of loading
|
std::vector<plLocation> fRoomsLoading; // the locations we are currently in the middle of loading
|
||||||
|
|
||||||
int fNumPostLoadMsgs;
|
int fNumPostLoadMsgs;
|
||||||
float fPostLoadMsgInc;
|
float fPostLoadMsgInc;
|
||||||
|
|
||||||
void ICompleteInit ();
|
void ICompleteInit ();
|
||||||
void IOnAsyncInitComplete ();
|
void IOnAsyncInitComplete ();
|
||||||
void IHandlePreloaderMsg (plPreloaderMsg * msg);
|
void IHandlePreloaderMsg (plPreloaderMsg * msg);
|
||||||
void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg);
|
void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg);
|
||||||
bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg);
|
bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg);
|
||||||
|
|
||||||
hsBool IFlushRenderRequests();
|
hsBool IFlushRenderRequests();
|
||||||
void IProcessPreRenderRequests();
|
void IProcessPreRenderRequests();
|
||||||
void IProcessPostRenderRequests();
|
void IProcessPostRenderRequests();
|
||||||
void IProcessRenderRequests(hsTArray<plRenderRequest*>& reqs);
|
void IProcessRenderRequests(hsTArray<plRenderRequest*>& reqs);
|
||||||
void IAddRenderRequest(plRenderRequest* req);
|
void IAddRenderRequest(plRenderRequest* req);
|
||||||
|
|
||||||
hsBool IPlayIntroBink(const char* movieName, hsScalar endDelay, hsScalar posX, hsScalar posY, hsScalar scaleX, hsScalar scaleY, hsScalar volume = 1.0);
|
hsBool IPlayIntroBink(const char* movieName, hsScalar endDelay, hsScalar posX, hsScalar posY, hsScalar scaleX, hsScalar scaleY, hsScalar volume = 1.0);
|
||||||
hsBool IHandleMovieMsg(plMovieMsg* mov);
|
hsBool IHandleMovieMsg(plMovieMsg* mov);
|
||||||
void IKillMovies();
|
void IKillMovies();
|
||||||
void IServiceMovies();
|
void IServiceMovies();
|
||||||
|
|
||||||
void IStartProgress( const char *title, hsScalar len );
|
void IStartProgress( const char *title, hsScalar len );
|
||||||
void IIncProgress( hsScalar byHowMuch, const char *text );
|
void IIncProgress( hsScalar byHowMuch, const char *text );
|
||||||
void IStopProgress( void );
|
void IStopProgress( void );
|
||||||
|
|
||||||
static void IDispatchMsgReceiveCallback();
|
static void IDispatchMsgReceiveCallback();
|
||||||
static void IReadKeyedObjCallback(plKey key);
|
static void IReadKeyedObjCallback(plKey key);
|
||||||
static void IProgressMgrCallbackProc( plOperationProgress *progress );
|
static void IProgressMgrCallbackProc( plOperationProgress *progress );
|
||||||
|
|
||||||
void IPatchGlobalAgeFiles( void );
|
void IPatchGlobalAgeFiles( void );
|
||||||
|
|
||||||
int IFindRoomByLoc(const plLocation& loc);
|
int IFindRoomByLoc(const plLocation& loc);
|
||||||
bool IIsRoomLoading(const plLocation& loc);
|
bool IIsRoomLoading(const plLocation& loc);
|
||||||
void IQueueRoomLoad(const std::vector<plLocation>& locs, bool hold);
|
void IQueueRoomLoad(const std::vector<plLocation>& locs, bool hold);
|
||||||
void ILoadNextRoom();
|
void ILoadNextRoom();
|
||||||
void IUnloadRooms(const std::vector<plLocation>& locs);
|
void IUnloadRooms(const std::vector<plLocation>& locs);
|
||||||
void IRoomLoaded(plSceneNode* node, bool hold);
|
void IRoomLoaded(plSceneNode* node, bool hold);
|
||||||
void IRoomUnloaded(plSceneNode* node);
|
void IRoomUnloaded(plSceneNode* node);
|
||||||
void ISetGraphicsDefaults();
|
void ISetGraphicsDefaults();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
plClient();
|
plClient();
|
||||||
virtual ~plClient();
|
virtual ~plClient();
|
||||||
|
|
||||||
CLASSNAME_REGISTER( plClient );
|
CLASSNAME_REGISTER( plClient );
|
||||||
GETINTERFACE_ANY( plClient, hsKeyedObject );
|
GETINTERFACE_ANY( plClient, hsKeyedObject );
|
||||||
|
|
||||||
static plClient* GetInstance() { return fInstance; }
|
static plClient* GetInstance() { return fInstance; }
|
||||||
static void SetInstance(plClient* v) { fInstance=v; }
|
static void SetInstance(plClient* v) { fInstance=v; }
|
||||||
|
|
||||||
virtual hsBool MsgReceive(plMessage* msg);
|
virtual hsBool MsgReceive(plMessage* msg);
|
||||||
|
|
||||||
hsBool InitPipeline();
|
hsBool InitPipeline();
|
||||||
|
|
||||||
void InitInputs();
|
void InitInputs();
|
||||||
|
|
||||||
void InitDLLs();
|
void InitDLLs();
|
||||||
void ShutdownDLLs();
|
void ShutdownDLLs();
|
||||||
|
|
||||||
void InitAuxInits();
|
void InitAuxInits();
|
||||||
|
|
||||||
virtual hsBool StartInit();
|
virtual hsBool StartInit();
|
||||||
virtual hsBool Shutdown();
|
virtual hsBool Shutdown();
|
||||||
virtual hsBool MainLoop();
|
virtual hsBool MainLoop();
|
||||||
|
|
||||||
plClient& SetDone(hsBool done) { fDone = done; return *this; }
|
plClient& SetDone(hsBool done) { fDone = done; return *this; }
|
||||||
hsBool GetDone() { return fDone; }
|
hsBool GetDone() { return fDone; }
|
||||||
|
|
||||||
// Set this to true to queue any room load requests that come in. Set it to false to process them.
|
// Set this to true to queue any room load requests that come in. Set it to false to process them.
|
||||||
void SetHoldLoadRequests(bool hold);
|
void SetHoldLoadRequests(bool hold);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
kFlagIniting,
|
kFlagIniting,
|
||||||
kFlagDBGDisableRender,
|
kFlagDBGDisableRender,
|
||||||
kFlagDBGDisableRRequests,
|
kFlagDBGDisableRRequests,
|
||||||
kFlagAsyncInitComplete,
|
kFlagAsyncInitComplete,
|
||||||
kFlagGlobalDataLoaded,
|
kFlagGlobalDataLoaded,
|
||||||
};
|
};
|
||||||
|
|
||||||
hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
|
hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
|
||||||
void SetFlag(int f, hsBool on=true) { fFlags.SetBit(f, on); }
|
void SetFlag(int f, hsBool on=true) { fFlags.SetBit(f, on); }
|
||||||
|
|
||||||
virtual plClient& SetWindowHandle(hsWindowHndl hndl) { fWindowHndl=hndl; return *this; }
|
virtual plClient& SetWindowHandle(hsWindowHndl hndl) { fWindowHndl=hndl; return *this; }
|
||||||
hsWindowHndl GetWindowHandle() { return fWindowHndl; }
|
hsWindowHndl GetWindowHandle() { return fWindowHndl; }
|
||||||
|
|
||||||
plInputManager* GetInputManager() { return fInputManager; }
|
plInputManager* GetInputManager() { return fInputManager; }
|
||||||
|
|
||||||
plPipeline* GetPipeline() { return fPipeline; }
|
plPipeline* GetPipeline() { return fPipeline; }
|
||||||
|
|
||||||
plSceneNode* GetCurrentScene() { return fCurrentNode; }
|
plSceneNode* GetCurrentScene() { return fCurrentNode; }
|
||||||
|
|
||||||
pfConsoleEngine *GetConsoleEngine() { return fConsoleEngine; }
|
pfConsoleEngine *GetConsoleEngine() { return fConsoleEngine; }
|
||||||
|
|
||||||
void SetAuxInitDir(const char *p) { delete [] fpAuxInitDir; fpAuxInitDir = hsStrcpy(p); }
|
void SetAuxInitDir(const char *p) { delete [] fpAuxInitDir; fpAuxInitDir = hsStrcpy(p); }
|
||||||
|
|
||||||
static void EnableClientDelay() { plClient::fDelayMS = true; }
|
static void EnableClientDelay() { plClient::fDelayMS = true; }
|
||||||
|
|
||||||
// These are a hack to let the console fake a lesser capabile board and test out quality settings.
|
// These are a hack to let the console fake a lesser capabile board and test out quality settings.
|
||||||
// They should go away once we have this built into ClientSetup et.al.
|
// They should go away once we have this built into ClientSetup et.al.
|
||||||
void SetClampCap(int c) { fClampCap = c; }
|
void SetClampCap(int c) { fClampCap = c; }
|
||||||
int GetClampCap() const { return fClampCap; }
|
int GetClampCap() const { return fClampCap; }
|
||||||
void SetQuality(int q) { fQuality = q; }
|
void SetQuality(int q) { fQuality = q; }
|
||||||
int GetQuality() const { return fQuality; }
|
int GetQuality() const { return fQuality; }
|
||||||
|
|
||||||
hsBool GetQuitIntro() const { return fQuitIntro; }
|
hsBool GetQuitIntro() const { return fQuitIntro; }
|
||||||
void SetQuitIntro(hsBool on) { fQuitIntro = on; }
|
void SetQuitIntro(hsBool on) { fQuitIntro = on; }
|
||||||
|
|
||||||
void SetClearColor( hsColorRGBA &color );
|
void SetClearColor( hsColorRGBA &color );
|
||||||
hsColorRGBA GetClearColor() const { return fClearColor; }
|
hsColorRGBA GetClearColor() const { return fClearColor; }
|
||||||
|
|
||||||
// The client window has focus (true) or lost it (false)
|
// The client window has focus (true) or lost it (false)
|
||||||
virtual void WindowActivate(bool active);
|
virtual void WindowActivate(bool active);
|
||||||
virtual hsBool WindowActive() const { return fWindowActive; }
|
virtual hsBool WindowActive() const { return fWindowActive; }
|
||||||
|
|
||||||
void SetMessagePumpProc( plMessagePumpProc proc ) { fMessagePumpProc = proc; }
|
void SetMessagePumpProc( plMessagePumpProc proc ) { fMessagePumpProc = proc; }
|
||||||
void ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync = false, hsBool windowOnly = false);
|
void ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync = false, hsBool windowOnly = false);
|
||||||
void IDetectAudioVideoSettings();
|
void IDetectAudioVideoSettings();
|
||||||
void IWriteDefaultGraphicsSettings(const wchar* destFile);
|
void IWriteDefaultGraphicsSettings(const wchar* destFile);
|
||||||
|
|
||||||
plAnimDebugList *fAnimDebugList;
|
plAnimDebugList *fAnimDebugList;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
std::string fUsername;
|
std::string fUsername;
|
||||||
std::string fPasswordDigest;
|
std::string fPasswordDigest;
|
||||||
std::string fServer;
|
std::string fServer;
|
||||||
int fPlayerID;
|
int fPlayerID;
|
||||||
bool fRecreatePlayer;
|
bool fRecreatePlayer;
|
||||||
bool fAuthPassed;
|
bool fAuthPassed;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // plClient_inc
|
#endif // plClient_inc
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
|
|
||||||
#ifndef plClientCreatable_inc
|
#ifndef plClientCreatable_inc
|
||||||
#define plClientCreatable_inc
|
#define plClientCreatable_inc
|
||||||
|
|
||||||
#include "pnFactory/plCreator.h"
|
#include "pnFactory/plCreator.h"
|
||||||
|
|
||||||
#include "plClient.h"
|
#include "plClient.h"
|
||||||
|
|
||||||
REGISTER_NONCREATABLE( plClient );
|
REGISTER_NONCREATABLE( plClient );
|
||||||
|
|
||||||
#endif // plClientCreatable
|
#endif // plClientCreatable
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plClientUpdateFormat_h_inc
|
#ifndef plClientUpdateFormat_h_inc
|
||||||
#define plClientUpdateFormat_h_inc
|
#define plClientUpdateFormat_h_inc
|
||||||
|
|
||||||
namespace ClientUpdate
|
namespace ClientUpdate
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
kUpdate,
|
kUpdate,
|
||||||
kShutdown,
|
kShutdown,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Format of the update stream
|
// Format of the update stream
|
||||||
//
|
//
|
||||||
// UInt8 - type (kUpdate, kShutdown)
|
// UInt8 - type (kUpdate, kShutdown)
|
||||||
//
|
//
|
||||||
// If type is kUpdate:
|
// If type is kUpdate:
|
||||||
// UInt32 - number of deleted keys
|
// UInt32 - number of deleted keys
|
||||||
// plUoid - uoid of deleted key (* num)
|
// plUoid - uoid of deleted key (* num)
|
||||||
//
|
//
|
||||||
// UInt32 - number of new creatables
|
// UInt32 - number of new creatables
|
||||||
// plCreatable - new creatable (* num)
|
// plCreatable - new creatable (* num)
|
||||||
//
|
//
|
||||||
|
|
||||||
#endif // plClientUpdateFormat_h_inc
|
#endif // plClientUpdateFormat_h_inc
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
|
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#pragma warning( disable : 4305 4503 4018 4786 4284)
|
#pragma warning( disable : 4305 4503 4018 4786 4284)
|
||||||
#include "pnAllCreatables.h"
|
#include "pnAllCreatables.h"
|
||||||
|
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@ -1,22 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
<assemblyIdentity
|
<assemblyIdentity
|
||||||
version="1.0.0.0"
|
version="1.0.0.0"
|
||||||
processorArchitecture="x86"
|
processorArchitecture="x86"
|
||||||
name="plClient"
|
name="plClient"
|
||||||
type="win32"
|
type="win32"
|
||||||
/>
|
/>
|
||||||
<description>plClient</description>
|
<description>plClient</description>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity
|
<assemblyIdentity
|
||||||
type="win32"
|
type="win32"
|
||||||
name="Microsoft.Windows.Common-Controls"
|
name="Microsoft.Windows.Common-Controls"
|
||||||
version="6.0.0.0"
|
version="6.0.0.0"
|
||||||
processorArchitecture="X86"
|
processorArchitecture="X86"
|
||||||
publicKeyToken="6595b64144ccf1df"
|
publicKeyToken="6595b64144ccf1df"
|
||||||
language="*"
|
language="*"
|
||||||
/>
|
/>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
</assembly>
|
</assembly>
|
@ -1,379 +1,379 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include <afxres.h>
|
#include <afxres.h>
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include <afxres.h>\r\n"
|
"#include <afxres.h>\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||||
"#ifdef _WIN32\r\n"
|
"#ifdef _WIN32\r\n"
|
||||||
"LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n"
|
"LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n"
|
||||||
"#pragma code_page(1252)\r\n"
|
"#pragma code_page(1252)\r\n"
|
||||||
"#endif //_WIN32\r\n"
|
"#endif //_WIN32\r\n"
|
||||||
"#endif\r\n"
|
"#endif\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""plClient.exe.manifest""\0"
|
"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""plClient.exe.manifest""\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Bitmap
|
// Bitmap
|
||||||
//
|
//
|
||||||
|
|
||||||
IDB_CURSOR_UP BITMAP "cursor_up.bmp"
|
IDB_CURSOR_UP BITMAP "cursor_up.bmp"
|
||||||
IDB_CURSOR_DOWN BITMAP "cursor_down.bmp"
|
IDB_CURSOR_DOWN BITMAP "cursor_down.bmp"
|
||||||
IDB_CURSOR_LEFT BITMAP "cursor_right.bmp"
|
IDB_CURSOR_LEFT BITMAP "cursor_right.bmp"
|
||||||
IDB_CURSOR_RIGHT BITMAP "cursor_left.bmp"
|
IDB_CURSOR_RIGHT BITMAP "cursor_left.bmp"
|
||||||
IDB_CURSOR_OPEN BITMAP "cursor_open.bmp"
|
IDB_CURSOR_OPEN BITMAP "cursor_open.bmp"
|
||||||
IDB_CURSOR_GRAB BITMAP "cursor_grab.bmp"
|
IDB_CURSOR_GRAB BITMAP "cursor_grab.bmp"
|
||||||
IDB_CURSOR_CLICKED BITMAP "cursor_clicked.bmp"
|
IDB_CURSOR_CLICKED BITMAP "cursor_clicked.bmp"
|
||||||
IDB_CURSOR_POISED BITMAP "cursor_poised.bmp"
|
IDB_CURSOR_POISED BITMAP "cursor_poised.bmp"
|
||||||
IDB_CURSOR_ARROW BITMAP "cursor_u.bmp"
|
IDB_CURSOR_ARROW BITMAP "cursor_u.bmp"
|
||||||
IDB_CURSOR_4WAYOPEN BITMAP "bitmap1.bmp"
|
IDB_CURSOR_4WAYOPEN BITMAP "bitmap1.bmp"
|
||||||
IDB_CURSOR_UPDOWNCLOSED BITMAP "bmp00001.bmp"
|
IDB_CURSOR_UPDOWNCLOSED BITMAP "bmp00001.bmp"
|
||||||
IDB_CURSOR_UPDOWNOPEN BITMAP "bitmap2.bmp"
|
IDB_CURSOR_UPDOWNOPEN BITMAP "bitmap2.bmp"
|
||||||
IDB_CURSOR_4WAYCLOSED BITMAP "bitmap3.bmp"
|
IDB_CURSOR_4WAYCLOSED BITMAP "bitmap3.bmp"
|
||||||
IDB_CURSOR_LEFTRIGHTCLOSED BITMAP "bmp00003.bmp"
|
IDB_CURSOR_LEFTRIGHTCLOSED BITMAP "bmp00003.bmp"
|
||||||
IDB_CURSOR_LEFTRIGHTOPEN BITMAP "bmp00002.bmp"
|
IDB_CURSOR_LEFTRIGHTOPEN BITMAP "bmp00002.bmp"
|
||||||
IDB_MICROPHONE BITMAP "Microphone.bmp"
|
IDB_MICROPHONE BITMAP "Microphone.bmp"
|
||||||
IDB_TALKING BITMAP "Speaker.bmp"
|
IDB_TALKING BITMAP "Speaker.bmp"
|
||||||
IDB_CURSOR_BOOK_HIGHLIGHT BITMAP "book_hig.bmp"
|
IDB_CURSOR_BOOK_HIGHLIGHT BITMAP "book_hig.bmp"
|
||||||
IDB_CURSOR_BOOK BITMAP "book.bmp"
|
IDB_CURSOR_BOOK BITMAP "book.bmp"
|
||||||
IDB_CURSOR_BOOK_CLICKED BITMAP "book_cli.bmp"
|
IDB_CURSOR_BOOK_CLICKED BITMAP "book_cli.bmp"
|
||||||
IDB_CURSOR_DISABLED BITMAP "cursor_disabled.bmp"
|
IDB_CURSOR_DISABLED BITMAP "cursor_disabled.bmp"
|
||||||
IDB_CURSOR_HAND BITMAP "bmp00005.bmp"
|
IDB_CURSOR_HAND BITMAP "bmp00005.bmp"
|
||||||
IDB_CURSOR_UPWARD BITMAP "cursor_upward.bmp"
|
IDB_CURSOR_UPWARD BITMAP "cursor_upward.bmp"
|
||||||
IDB_BANNER BITMAP "banner.bmp"
|
IDB_BANNER BITMAP "banner.bmp"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
//
|
//
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON_DIRT ICON "Dirt.ICO"
|
IDI_ICON_DIRT ICON "Dirt.ICO"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_LOADING DIALOGEX 0, 0, 161, 26
|
IDD_LOADING DIALOGEX 0, 0, 161, 26
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||||
WS_POPUP | WS_VISIBLE
|
WS_POPUP | WS_VISIBLE
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Starting URU. Please wait...",IDC_STARTING_TEXT,32,9,
|
LTEXT "Starting URU. Please wait...",IDC_STARTING_TEXT,32,9,
|
||||||
127,8
|
127,8
|
||||||
ICON IDI_ICON_DIRT,IDC_STATIC,5,3,20,20
|
ICON IDI_ICON_DIRT,IDC_STATIC,5,3,20,20
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_EXCEPTION DIALOGEX 0, 0, 296, 183
|
IDD_EXCEPTION DIALOGEX 0, 0, 296, 183
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Error"
|
CAPTION "Error"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,239,7,50,14
|
DEFPUSHBUTTON "OK",IDOK,239,7,50,14
|
||||||
ICON IDI_ICON_DIRT,IDC_STATIC,7,7,20,20
|
ICON IDI_ICON_DIRT,IDC_STATIC,7,7,20,20
|
||||||
LTEXT " URU has experienced a serious error. Please report the information below.\n\nWe apologize for any inconvenience. ",
|
LTEXT " URU has experienced a serious error. Please report the information below.\n\nWe apologize for any inconvenience. ",
|
||||||
IDC_MSG,38,7,189,37
|
IDC_MSG,38,7,189,37
|
||||||
EDITTEXT IDC_CRASHINFO,7,45,282,131,ES_MULTILINE | ES_AUTOVSCROLL |
|
EDITTEXT IDC_CRASHINFO,7,45,282,131,ES_MULTILINE | ES_AUTOVSCROLL |
|
||||||
ES_AUTOHSCROLL | ES_READONLY
|
ES_AUTOHSCROLL | ES_READONLY
|
||||||
PUSHBUTTON "Copy",IDC_COPY,239,26,50,14
|
PUSHBUTTON "Copy",IDC_COPY,239,26,50,14
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URUTAP_LOGIN DIALOGEX 0, 0, 188, 111
|
IDD_URUTAP_LOGIN DIALOGEX 0, 0, 188, 111
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
||||||
CAPTION "Enter Login Info"
|
CAPTION "Enter Login Info"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Enter",IDOK,33,90,50,14
|
DEFPUSHBUTTON "Enter",IDOK,33,90,50,14
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,107,90,50,14
|
PUSHBUTTON "Cancel",IDCANCEL,107,90,50,14
|
||||||
LTEXT "Username",IDC_STATIC,7,7,38,11
|
LTEXT "Username",IDC_STATIC,7,7,38,11
|
||||||
EDITTEXT IDC_URUTAP_USERNAME,52,7,129,13,ES_AUTOHSCROLL
|
EDITTEXT IDC_URUTAP_USERNAME,52,7,129,13,ES_AUTOHSCROLL
|
||||||
LTEXT "Password",IDC_STATIC,7,30,38,12
|
LTEXT "Password",IDC_STATIC,7,30,38,12
|
||||||
EDITTEXT IDC_URUTAP_PASSWORD,52,28,129,12,ES_PASSWORD |
|
EDITTEXT IDC_URUTAP_PASSWORD,52,28,129,12,ES_PASSWORD |
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
LTEXT "Server",IDC_STATIC,7,54,35,12
|
LTEXT "Server",IDC_STATIC,7,54,35,12
|
||||||
EDITTEXT IDC_URUTAP_SERVER,51,51,130,13,ES_AUTOHSCROLL
|
EDITTEXT IDC_URUTAP_SERVER,51,51,130,13,ES_AUTOHSCROLL
|
||||||
CONTROL "Destroy and recreate player",IDC_URUTAP_DESTROY,"Button",
|
CONTROL "Destroy and recreate player",IDC_URUTAP_DESTROY,"Button",
|
||||||
BS_AUTOCHECKBOX | WS_TABSTOP,51,70,130,12
|
BS_AUTOCHECKBOX | WS_TABSTOP,51,70,130,12
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URU_LOGIN DIALOGEX 0, 0, 200, 133
|
IDD_URU_LOGIN DIALOGEX 0, 0, 200, 133
|
||||||
STYLE DS_SETFONT | DS_3DLOOK | WS_POPUP | WS_SYSMENU
|
STYLE DS_SETFONT | DS_3DLOOK | WS_POPUP | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_STATICEDGE
|
EXSTYLE WS_EX_STATICEDGE
|
||||||
FONT 12, "Hobo Std", 500, 0, 0x0
|
FONT 12, "Hobo Std", 500, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Submit",IDOK,139,114,50,14
|
DEFPUSHBUTTON "Submit",IDOK,139,114,50,14
|
||||||
PUSHBUTTON "Quit",IDCANCEL,77,114,50,14
|
PUSHBUTTON "Quit",IDCANCEL,77,114,50,14
|
||||||
EDITTEXT IDC_USERNAME,65,55,110,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_USERNAME,65,55,110,12,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_PASSWORD,65,71,110,12,ES_PASSWORD | ES_AUTOHSCROLL
|
EDITTEXT IDC_PASSWORD,65,71,110,12,ES_PASSWORD | ES_AUTOHSCROLL
|
||||||
LTEXT "Username:",IDC_TEXT_USER,25,58,36,8
|
LTEXT "Username:",IDC_TEXT_USER,25,58,36,8
|
||||||
LTEXT "Password:",IDC_TEXT_PASS,27,73,34,8
|
LTEXT "Password:",IDC_TEXT_PASS,27,73,34,8
|
||||||
LTEXT "Welcome to URU!",IDC_TEXT_WELCOME,72,45,57,8
|
LTEXT "Welcome to URU!",IDC_TEXT_WELCOME,72,45,57,8
|
||||||
CONTROL "Remember Password:",IDC_REMEMBER_PASS,"Button",
|
CONTROL "Remember Password:",IDC_REMEMBER_PASS,"Button",
|
||||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,23,87,85,10
|
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,23,87,85,10
|
||||||
GROUPBOX "",IDC_BOX_01,5,30,190,79
|
GROUPBOX "",IDC_BOX_01,5,30,190,79
|
||||||
GROUPBOX "",IDC_BOX_02,14,38,172,64
|
GROUPBOX "",IDC_BOX_02,14,38,172,64
|
||||||
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
||||||
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URU_EULA DIALOGEX 0, 0, 201, 158
|
IDD_URU_EULA DIALOGEX 0, 0, 201, 158
|
||||||
STYLE DS_SETFONT | WS_POPUP | WS_SYSMENU
|
STYLE DS_SETFONT | WS_POPUP | WS_SYSMENU
|
||||||
FONT 12, "Hobo Std", 500, 0, 0x0
|
FONT 12, "Hobo Std", 500, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Accept",IDOK,141,138,50,14
|
DEFPUSHBUTTON "Accept",IDOK,141,138,50,14
|
||||||
PUSHBUTTON "Decline",IDCANCEL,79,138,50,14
|
PUSHBUTTON "Decline",IDCANCEL,79,138,50,14
|
||||||
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
||||||
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
||||||
GROUPBOX "",IDC_BOX_03,5,30,190,103
|
GROUPBOX "",IDC_BOX_03,5,30,190,103
|
||||||
LTEXT "Terms of Use Agreement",IDC_TEXT_TERMS,59,36,83,8
|
LTEXT "Terms of Use Agreement",IDC_TEXT_TERMS,59,36,83,8
|
||||||
CONTROL "Custom1",IDC_DYN_EULA,"",WS_TABSTOP,13,46,174,80
|
CONTROL "Custom1",IDC_DYN_EULA,"",WS_TABSTOP,13,46,174,80
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URULOGIN_MAIN DIALOGEX 0, 0, 302, 230
|
IDD_URULOGIN_MAIN DIALOGEX 0, 0, 302, 230
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
|
||||||
DS_CENTER | WS_POPUP
|
DS_CENTER | WS_POPUP
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Login",IDOK,87,209,50,14
|
DEFPUSHBUTTON "Login",IDOK,87,209,50,14
|
||||||
PUSHBUTTON "Quit",IDCANCEL,163,209,50,14
|
PUSHBUTTON "Quit",IDCANCEL,163,209,50,14
|
||||||
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
|
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
|
||||||
WS_BORDER,7,7,289,36
|
WS_BORDER,7,7,289,36
|
||||||
LTEXT "Account name:",IDC_STATIC,69,119,49,10
|
LTEXT "Account name:",IDC_STATIC,69,119,49,10
|
||||||
LTEXT "Password:",IDC_STATIC,69,135,49,10
|
LTEXT "Password:",IDC_STATIC,69,135,49,10
|
||||||
EDITTEXT IDC_URULOGIN_USERNAME,123,119,108,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_URULOGIN_USERNAME,123,119,108,12,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_URULOGIN_PASSWORD,123,135,108,12,ES_PASSWORD |
|
EDITTEXT IDC_URULOGIN_PASSWORD,123,135,108,12,ES_PASSWORD |
|
||||||
ES_AUTOHSCROLL
|
ES_AUTOHSCROLL
|
||||||
GROUPBOX "",IDC_STATIC,14,99,274,96
|
GROUPBOX "",IDC_STATIC,14,99,274,96
|
||||||
CONTROL "Remember Password:",IDC_URULOGIN_REMEMBERPASS,"Button",
|
CONTROL "Remember Password:",IDC_URULOGIN_REMEMBERPASS,"Button",
|
||||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,69,151,100,10
|
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,69,151,100,10
|
||||||
GROUPBOX "",IDC_STATIC,14,54,274,43
|
GROUPBOX "",IDC_STATIC,14,54,274,43
|
||||||
LTEXT "Welcome to URU",IDC_STATUS_TEXT,17,62,267,20
|
LTEXT "Welcome to URU",IDC_STATUS_TEXT,17,62,267,20
|
||||||
RTEXT "Product String",IDC_PRODUCTSTRING,88,86,194,8
|
RTEXT "Product String",IDC_PRODUCTSTRING,88,86,194,8
|
||||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,49,
|
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,49,
|
||||||
288,152
|
288,152
|
||||||
PUSHBUTTON "Need an account?",IDC_URULOGIN_GAMETAPLINK,95,175,110,
|
PUSHBUTTON "Need an account?",IDC_URULOGIN_GAMETAPLINK,95,175,110,
|
||||||
14,BS_FLAT
|
14,BS_FLAT
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URULOGIN_EULA DIALOGEX 0, 0, 300, 318
|
IDD_URULOGIN_EULA DIALOGEX 0, 0, 300, 318
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Accept",IDOK,89,297,50,14
|
DEFPUSHBUTTON "Accept",IDOK,89,297,50,14
|
||||||
PUSHBUTTON "Decline",IDCANCEL,160,297,50,14
|
PUSHBUTTON "Decline",IDCANCEL,160,297,50,14
|
||||||
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP,7,7,287,36,
|
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP,7,7,287,36,
|
||||||
WS_EX_CLIENTEDGE
|
WS_EX_CLIENTEDGE
|
||||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,9,46,
|
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,9,46,
|
||||||
284,242
|
284,242
|
||||||
CTEXT "End User License Agreement",IDC_STATIC,46,55,207,10
|
CTEXT "End User License Agreement",IDC_STATIC,46,55,207,10
|
||||||
GROUPBOX "",IDC_STATIC,17,66,266,212
|
GROUPBOX "",IDC_STATIC,17,66,266,212
|
||||||
CONTROL "",IDC_URULOGIN_EULATEXT,"RichEdit20A",ES_MULTILINE |
|
CONTROL "",IDC_URULOGIN_EULATEXT,"RichEdit20A",ES_MULTILINE |
|
||||||
ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_VSCROLL |
|
ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_VSCROLL |
|
||||||
WS_HSCROLL | WS_TABSTOP,25,75,250,197
|
WS_HSCROLL | WS_TABSTOP,25,75,250,197
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_AUTHFAILED DIALOGEX 0, 0, 177, 89
|
IDD_AUTHFAILED DIALOGEX 0, 0, 177, 89
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||||
WS_POPUP | WS_VISIBLE
|
WS_POPUP | WS_VISIBLE
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Authentication failed. Please try again.",
|
LTEXT "Authentication failed. Please try again.",
|
||||||
IDC_AUTH_TEXT,38,17,127,8
|
IDC_AUTH_TEXT,38,17,127,8
|
||||||
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
||||||
PUSHBUTTON "Ok",IDOK,67,73,42,14
|
PUSHBUTTON "Ok",IDOK,67,73,42,14
|
||||||
CTEXT "",IDC_AUTH_MESSAGE,0,37,175,32
|
CTEXT "",IDC_AUTH_MESSAGE,0,37,175,32
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_AUTHENTICATING DIALOGEX 0, 0, 177, 60
|
IDD_AUTHENTICATING DIALOGEX 0, 0, 177, 60
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||||
WS_POPUP | WS_VISIBLE
|
WS_POPUP | WS_VISIBLE
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
||||||
LTEXT "Logging in to URU. Please wait...",IDC_AUTH_TEXT,38,17,
|
LTEXT "Logging in to URU. Please wait...",IDC_AUTH_TEXT,38,17,
|
||||||
137,8
|
137,8
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,64,42,49,15
|
PUSHBUTTON "Cancel",IDCANCEL,64,42,49,15
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DESIGNINFO
|
// DESIGNINFO
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO
|
GUIDELINES DESIGNINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_LOADING, DIALOG
|
IDD_LOADING, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
RIGHTMARGIN, 159
|
RIGHTMARGIN, 159
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_EXCEPTION, DIALOG
|
IDD_EXCEPTION, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 289
|
RIGHTMARGIN, 289
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 176
|
BOTTOMMARGIN, 176
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URUTAP_LOGIN, DIALOG
|
IDD_URUTAP_LOGIN, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 181
|
RIGHTMARGIN, 181
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 104
|
BOTTOMMARGIN, 104
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URU_LOGIN, DIALOG
|
IDD_URU_LOGIN, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 4
|
LEFTMARGIN, 4
|
||||||
RIGHTMARGIN, 168
|
RIGHTMARGIN, 168
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 128
|
BOTTOMMARGIN, 128
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URU_EULA, DIALOG
|
IDD_URU_EULA, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 194
|
RIGHTMARGIN, 194
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 151
|
BOTTOMMARGIN, 151
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URULOGIN_MAIN, DIALOG
|
IDD_URULOGIN_MAIN, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 295
|
RIGHTMARGIN, 295
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 223
|
BOTTOMMARGIN, 223
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_URULOGIN_EULA, DIALOG
|
IDD_URULOGIN_EULA, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 293
|
RIGHTMARGIN, 293
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 311
|
BOTTOMMARGIN, 311
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_AUTHFAILED, DIALOG
|
IDD_AUTHFAILED, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
RIGHTMARGIN, 175
|
RIGHTMARGIN, 175
|
||||||
BOTTOMMARGIN, 87
|
BOTTOMMARGIN, 87
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_AUTHENTICATING, DIALOG
|
IDD_AUTHENTICATING, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
RIGHTMARGIN, 175
|
RIGHTMARGIN, 175
|
||||||
BOTTOMMARGIN, 57
|
BOTTOMMARGIN, 57
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// CNSL
|
// CNSL
|
||||||
//
|
//
|
||||||
|
|
||||||
IDR_CNSL1 CNSL "cnsl1.bin"
|
IDR_CNSL1 CNSL "cnsl1.bin"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// JPEG
|
// JPEG
|
||||||
//
|
//
|
||||||
|
|
||||||
IDR_LOADING_01 JPEG "xLoading_Linking.01.jpg"
|
IDR_LOADING_01 JPEG "xLoading_Linking.01.jpg"
|
||||||
IDR_LOADING_02 JPEG "xLoading_Linking.02.jpg"
|
IDR_LOADING_02 JPEG "xLoading_Linking.02.jpg"
|
||||||
IDR_LOADING_03 JPEG "xLoading_Linking.03.jpg"
|
IDR_LOADING_03 JPEG "xLoading_Linking.03.jpg"
|
||||||
IDR_LOADING_04 JPEG "xLoading_Linking.04.jpg"
|
IDR_LOADING_04 JPEG "xLoading_Linking.04.jpg"
|
||||||
IDR_LOADING_05 JPEG "xLoading_Linking.05.jpg"
|
IDR_LOADING_05 JPEG "xLoading_Linking.05.jpg"
|
||||||
IDR_LOADING_06 JPEG "xLoading_Linking.06.jpg"
|
IDR_LOADING_06 JPEG "xLoading_Linking.06.jpg"
|
||||||
IDR_LOADING_07 JPEG "xLoading_Linking.07.jpg"
|
IDR_LOADING_07 JPEG "xLoading_Linking.07.jpg"
|
||||||
IDR_LOADING_08 JPEG "xLoading_Linking.08.jpg"
|
IDR_LOADING_08 JPEG "xLoading_Linking.08.jpg"
|
||||||
IDR_LOADING_09 JPEG "xLoading_Linking.09.jpg"
|
IDR_LOADING_09 JPEG "xLoading_Linking.09.jpg"
|
||||||
IDR_LOADING_10 JPEG "xLoading_Linking.10.jpg"
|
IDR_LOADING_10 JPEG "xLoading_Linking.10.jpg"
|
||||||
IDR_LOADING_11 JPEG "xLoading_Linking.11.jpg"
|
IDR_LOADING_11 JPEG "xLoading_Linking.11.jpg"
|
||||||
IDR_LOADING_12 JPEG "xLoading_Linking.12.jpg"
|
IDR_LOADING_12 JPEG "xLoading_Linking.12.jpg"
|
||||||
IDR_LOADING_13 JPEG "xLoading_Linking.13.jpg"
|
IDR_LOADING_13 JPEG "xLoading_Linking.13.jpg"
|
||||||
IDR_LOADING_14 JPEG "xLoading_Linking.14.jpg"
|
IDR_LOADING_14 JPEG "xLoading_Linking.14.jpg"
|
||||||
IDR_LOADING_15 JPEG "xLoading_Linking.15.jpg"
|
IDR_LOADING_15 JPEG "xLoading_Linking.15.jpg"
|
||||||
IDR_LOADING_16 JPEG "xLoading_Linking.16.jpg"
|
IDR_LOADING_16 JPEG "xLoading_Linking.16.jpg"
|
||||||
IDR_LOADING_17 JPEG "xLoading_Linking.17.jpg"
|
IDR_LOADING_17 JPEG "xLoading_Linking.17.jpg"
|
||||||
IDR_LOADING_18 JPEG "xLoading_Linking.18.jpg"
|
IDR_LOADING_18 JPEG "xLoading_Linking.18.jpg"
|
||||||
IDR_LOADING_LINKTEXT JPEG "xLoading_Linking_Text.jpg"
|
IDR_LOADING_LINKTEXT JPEG "xLoading_Linking_Text.jpg"
|
||||||
IDR_LOADING_UPDATETEXT JPEG "xLoading_Updating_Text.jpg"
|
IDR_LOADING_UPDATETEXT JPEG "xLoading_Updating_Text.jpg"
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
#define _AFX_NO_SPLITTER_RESOURCES
|
#define _AFX_NO_SPLITTER_RESOURCES
|
||||||
#define _AFX_NO_OLE_RESOURCES
|
#define _AFX_NO_OLE_RESOURCES
|
||||||
#define _AFX_NO_TRACKER_RESOURCES
|
#define _AFX_NO_TRACKER_RESOURCES
|
||||||
#define _AFX_NO_PROPERTY_RESOURCES
|
#define _AFX_NO_PROPERTY_RESOURCES
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -1,103 +1,103 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Visual C++ generated include file.
|
// Microsoft Visual C++ generated include file.
|
||||||
// Used by plClient.rc
|
// Used by plClient.rc
|
||||||
//
|
//
|
||||||
#define IDB_CURSOR_UP 112
|
#define IDB_CURSOR_UP 112
|
||||||
#define IDB_CURSOR_DOWN 113
|
#define IDB_CURSOR_DOWN 113
|
||||||
#define IDB_CURSOR_RIGHT 114
|
#define IDB_CURSOR_RIGHT 114
|
||||||
#define IDB_CURSOR_LEFT 115
|
#define IDB_CURSOR_LEFT 115
|
||||||
#define IDB_CURSOR_OPEN 116
|
#define IDB_CURSOR_OPEN 116
|
||||||
#define IDB_CURSOR_GRAB 117
|
#define IDB_CURSOR_GRAB 117
|
||||||
#define IDB_CURSOR_CLICKED 118
|
#define IDB_CURSOR_CLICKED 118
|
||||||
#define IDB_CURSOR_POISED 119
|
#define IDB_CURSOR_POISED 119
|
||||||
#define IDB_MICROPHONE 121
|
#define IDB_MICROPHONE 121
|
||||||
#define IDB_TALKING 122
|
#define IDB_TALKING 122
|
||||||
#define IDB_CURSOR_ARROW 123
|
#define IDB_CURSOR_ARROW 123
|
||||||
#define IDB_CURSOR_4WAYOPEN 124
|
#define IDB_CURSOR_4WAYOPEN 124
|
||||||
#define IDB_CURSOR_UPDOWNCLOSED 125
|
#define IDB_CURSOR_UPDOWNCLOSED 125
|
||||||
#define IDB_CURSOR_UPDOWNOPEN 126
|
#define IDB_CURSOR_UPDOWNOPEN 126
|
||||||
#define IDB_CURSOR_4WAYCLOSED 127
|
#define IDB_CURSOR_4WAYCLOSED 127
|
||||||
#define IDB_CURSOR_LEFTRIGHTCLOSED 128
|
#define IDB_CURSOR_LEFTRIGHTCLOSED 128
|
||||||
#define IDB_CURSOR_LEFTRIGHTOPEN 129
|
#define IDB_CURSOR_LEFTRIGHTOPEN 129
|
||||||
#define IDI_ICON_DIRT 135
|
#define IDI_ICON_DIRT 135
|
||||||
#define IDD_LOADING 136
|
#define IDD_LOADING 136
|
||||||
#define IDD_EXCEPTION 138
|
#define IDD_EXCEPTION 138
|
||||||
#define IDR_CNSL1 139
|
#define IDR_CNSL1 139
|
||||||
#define IDB_CURSOR_BOOK_HIGHLIGHT 141
|
#define IDB_CURSOR_BOOK_HIGHLIGHT 141
|
||||||
#define IDB_CURSOR_BOOK 142
|
#define IDB_CURSOR_BOOK 142
|
||||||
#define IDB_CURSOR_BOOK_CLICKED 143
|
#define IDB_CURSOR_BOOK_CLICKED 143
|
||||||
#define IDB_CURSOR_DISABLED 144
|
#define IDB_CURSOR_DISABLED 144
|
||||||
#define IDB_CURSOR_HAND 145
|
#define IDB_CURSOR_HAND 145
|
||||||
#define IDB_CURSOR_UPWARD 147
|
#define IDB_CURSOR_UPWARD 147
|
||||||
#define IDD_URUTAP_LOGIN 148
|
#define IDD_URUTAP_LOGIN 148
|
||||||
#define IDD_URU_LOGIN 149
|
#define IDD_URU_LOGIN 149
|
||||||
#define IDB_BANNER 151
|
#define IDB_BANNER 151
|
||||||
#define IDD_URU_EULA 152
|
#define IDD_URU_EULA 152
|
||||||
#define IDD_URULOGIN_MAIN 153
|
#define IDD_URULOGIN_MAIN 153
|
||||||
#define IDD_URULOGIN_EULA 154
|
#define IDD_URULOGIN_EULA 154
|
||||||
#define IDD_AUTHFAILED 155
|
#define IDD_AUTHFAILED 155
|
||||||
#define IDD_AUTHENTICATING 156
|
#define IDD_AUTHENTICATING 156
|
||||||
#define IDR_LOADING_01 177
|
#define IDR_LOADING_01 177
|
||||||
#define IDR_LOADING_02 178
|
#define IDR_LOADING_02 178
|
||||||
#define IDR_LOADING_03 179
|
#define IDR_LOADING_03 179
|
||||||
#define IDR_LOADING_04 180
|
#define IDR_LOADING_04 180
|
||||||
#define IDR_LOADING_05 181
|
#define IDR_LOADING_05 181
|
||||||
#define IDR_LOADING_06 182
|
#define IDR_LOADING_06 182
|
||||||
#define IDR_LOADING_07 183
|
#define IDR_LOADING_07 183
|
||||||
#define IDR_LOADING_08 184
|
#define IDR_LOADING_08 184
|
||||||
#define IDR_LOADING_09 185
|
#define IDR_LOADING_09 185
|
||||||
#define IDR_LOADING_10 186
|
#define IDR_LOADING_10 186
|
||||||
#define IDR_LOADING_11 187
|
#define IDR_LOADING_11 187
|
||||||
#define IDR_LOADING_12 188
|
#define IDR_LOADING_12 188
|
||||||
#define IDR_LOADING_13 189
|
#define IDR_LOADING_13 189
|
||||||
#define IDR_LOADING_14 190
|
#define IDR_LOADING_14 190
|
||||||
#define IDR_LOADING_15 191
|
#define IDR_LOADING_15 191
|
||||||
#define IDR_LOADING_16 192
|
#define IDR_LOADING_16 192
|
||||||
#define IDR_LOADING_17 193
|
#define IDR_LOADING_17 193
|
||||||
#define IDR_LOADING_18 194
|
#define IDR_LOADING_18 194
|
||||||
#define IDR_LOADING_LINKTEXT 195
|
#define IDR_LOADING_LINKTEXT 195
|
||||||
#define IDR_LOADING_UPDATETEXT 196
|
#define IDR_LOADING_UPDATETEXT 196
|
||||||
#define IDC_CRASHINFO 1001
|
#define IDC_CRASHINFO 1001
|
||||||
#define IDC_COPY 1002
|
#define IDC_COPY 1002
|
||||||
#define IDC_MSG 1003
|
#define IDC_MSG 1003
|
||||||
#define IDC_STARTING_TEXT 1004
|
#define IDC_STARTING_TEXT 1004
|
||||||
#define IDC_URUTAP_USERNAME 1005
|
#define IDC_URUTAP_USERNAME 1005
|
||||||
#define IDC_URUTAP_PASSWORD 1006
|
#define IDC_URUTAP_PASSWORD 1006
|
||||||
#define IDC_URUTAP_SERVER 1008
|
#define IDC_URUTAP_SERVER 1008
|
||||||
#define IDC_URUTAP_DESTROY 1009
|
#define IDC_URUTAP_DESTROY 1009
|
||||||
#define IDC_USERNAME 1010
|
#define IDC_USERNAME 1010
|
||||||
#define IDC_PASSWORD 1011
|
#define IDC_PASSWORD 1011
|
||||||
#define IDC_REMEMBER_PASS 1012
|
#define IDC_REMEMBER_PASS 1012
|
||||||
#define IDC_IMAGE_BANNER 1013
|
#define IDC_IMAGE_BANNER 1013
|
||||||
#define IDC_BOX_01 1014
|
#define IDC_BOX_01 1014
|
||||||
#define IDC_BOX_02 1015
|
#define IDC_BOX_02 1015
|
||||||
#define IDC_TEXT_WELCOME 1016
|
#define IDC_TEXT_WELCOME 1016
|
||||||
#define IDC_TEXT_USER 1017
|
#define IDC_TEXT_USER 1017
|
||||||
#define IDC_TEXT_PASS 1018
|
#define IDC_TEXT_PASS 1018
|
||||||
#define IDC_CUSTOM1 1019
|
#define IDC_CUSTOM1 1019
|
||||||
#define IDC_DYN_EULA 1019
|
#define IDC_DYN_EULA 1019
|
||||||
#define IDC_BOX_03 1020
|
#define IDC_BOX_03 1020
|
||||||
#define IDC_TEXT_TERMS 1021
|
#define IDC_TEXT_TERMS 1021
|
||||||
#define IDC_URULOGIN_REMEMBERPASS 1022
|
#define IDC_URULOGIN_REMEMBERPASS 1022
|
||||||
#define IDC_URULOGIN_USERNAME 1023
|
#define IDC_URULOGIN_USERNAME 1023
|
||||||
#define IDC_URULOGIN_PASSWORD 1024
|
#define IDC_URULOGIN_PASSWORD 1024
|
||||||
#define IDC_URULOGIN_EULATEXT 1025
|
#define IDC_URULOGIN_EULATEXT 1025
|
||||||
#define IDC_RICHEDIT22 1028
|
#define IDC_RICHEDIT22 1028
|
||||||
#define IDC_AUTH_TEXT 1029
|
#define IDC_AUTH_TEXT 1029
|
||||||
#define IDC_BUTTON1 1030
|
#define IDC_BUTTON1 1030
|
||||||
#define IDC_URULOGIN_GAMETAPLINK 1030
|
#define IDC_URULOGIN_GAMETAPLINK 1030
|
||||||
#define IDC_AUTH_MESSAGE 1031
|
#define IDC_AUTH_MESSAGE 1031
|
||||||
#define IDC_PRODUCTSTRING 1033
|
#define IDC_PRODUCTSTRING 1033
|
||||||
#define IDC_STATUS_TEXT 1034
|
#define IDC_STATUS_TEXT 1034
|
||||||
#define IDC_HOTKEY1 1035
|
#define IDC_HOTKEY1 1035
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 197
|
#define _APS_NEXT_RESOURCE_VALUE 197
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1036
|
#define _APS_NEXT_CONTROL_VALUE 1036
|
||||||
#define _APS_NEXT_SYMED_VALUE 103
|
#define _APS_NEXT_SYMED_VALUE 103
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
@ -1,35 +1,35 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
__declspec(dllexport) const unsigned long* GetKey()
|
__declspec(dllexport) const unsigned long* GetKey()
|
||||||
{
|
{
|
||||||
// So the crackers know who the tard is
|
// So the crackers know who the tard is
|
||||||
static const char* tauntText = "My copy protection is uncrackable! -Brice";
|
static const char* tauntText = "My copy protection is uncrackable! -Brice";
|
||||||
|
|
||||||
static const unsigned long kDefaultKey[4] = { 0x6c0a5452, 0x3827d0f, 0x3a170b92, 0x16db7fc2 };
|
static const unsigned long kDefaultKey[4] = { 0x6c0a5452, 0x3827d0f, 0x3a170b92, 0x16db7fc2 };
|
||||||
return kDefaultKey;
|
return kDefaultKey;
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "plClientKey.h"
|
#include "plClientKey.h"
|
||||||
#include "hsWindows.h"
|
#include "hsWindows.h"
|
||||||
|
|
||||||
typedef const UInt32* (*GETKEY)();
|
typedef const UInt32* (*GETKEY)();
|
||||||
|
|
||||||
const UInt32* plClientKey::GetKey()
|
const UInt32* plClientKey::GetKey()
|
||||||
{
|
{
|
||||||
HMODULE hDll = LoadLibrary("sp.dll");
|
HMODULE hDll = LoadLibrary("sp.dll");
|
||||||
if (hDll)
|
if (hDll)
|
||||||
{
|
{
|
||||||
GETKEY getKey = (GETKEY)GetProcAddress(hDll, "GetKey");
|
GETKEY getKey = (GETKEY)GetProcAddress(hDll, "GetKey");
|
||||||
if (getKey)
|
if (getKey)
|
||||||
{
|
{
|
||||||
static UInt32 key[4];
|
static UInt32 key[4];
|
||||||
memcpy(key, getKey(), sizeof(key));
|
memcpy(key, getKey(), sizeof(key));
|
||||||
FreeLibrary(hDll);
|
FreeLibrary(hDll);
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
LIBRARY
|
LIBRARY
|
||||||
EXPORTS
|
EXPORTS
|
||||||
GetKey @1
|
GetKey @1
|
||||||
SECTIONS
|
SECTIONS
|
||||||
.data READ WRITE
|
.data READ WRITE
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plClientKey_h_inc
|
#ifndef plClientKey_h_inc
|
||||||
#define plClientKey_h_inc
|
#define plClientKey_h_inc
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// For getting the "SafeDisc protected" encryption key in single player mode
|
// For getting the "SafeDisc protected" encryption key in single player mode
|
||||||
//
|
//
|
||||||
// Include plClientKey.cpp/h in your project and call plClientKey::GetKey
|
// Include plClientKey.cpp/h in your project and call plClientKey::GetKey
|
||||||
// It will load the Dll and get the key for you
|
// It will load the Dll and get the key for you
|
||||||
// Returns nil if it fails
|
// Returns nil if it fails
|
||||||
//
|
//
|
||||||
namespace plClientKey
|
namespace plClientKey
|
||||||
{
|
{
|
||||||
const UInt32* GetKey();
|
const UInt32* GetKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // plClientKey_h_inc
|
#endif // plClientKey_h_inc
|
@ -1,23 +1,23 @@
|
|||||||
add_definitions(-D_LIB)
|
add_definitions(-D_LIB)
|
||||||
|
|
||||||
include_directories("../../CoreLib")
|
include_directories("../../CoreLib")
|
||||||
include_directories("../../NucleusLib/inc")
|
include_directories("../../NucleusLib/inc")
|
||||||
include_directories("../../NucleusLib")
|
include_directories("../../NucleusLib")
|
||||||
include_directories("../../PubUtilLib")
|
include_directories("../../PubUtilLib")
|
||||||
|
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
set(plClientPatcher_HEADERS
|
set(plClientPatcher_HEADERS
|
||||||
Intern.h
|
Intern.h
|
||||||
Pch.h
|
Pch.h
|
||||||
UruPlayer.h
|
UruPlayer.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plClientPatcher_SOURCES
|
set(plClientPatcher_SOURCES
|
||||||
UruPlayer.cpp
|
UruPlayer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES})
|
add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES})
|
||||||
|
|
||||||
source_group("Header Files" FILES ${plClientPatcher_HEADERS})
|
source_group("Header Files" FILES ${plClientPatcher_HEADERS})
|
||||||
source_group("Source Files" FILES ${plClientPatcher_SOURCES})
|
source_group("Source Files" FILES ${plClientPatcher_SOURCES})
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h
|
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* SelfPatcher.cpp
|
* SelfPatcher.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h
|
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
||||||
|
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "pnUtils/pnUtils.h"
|
#include "pnUtils/pnUtils.h"
|
||||||
#include "pnNetBase/pnNetBase.h"
|
#include "pnNetBase/pnNetBase.h"
|
||||||
#include "pnAsyncCore/pnAsyncCore.h"
|
#include "pnAsyncCore/pnAsyncCore.h"
|
||||||
#include "pnProduct/pnProduct.h"
|
#include "pnProduct/pnProduct.h"
|
||||||
#include "pnNetCli/pnNetCli.h"
|
#include "pnNetCli/pnNetCli.h"
|
||||||
#include "plNetGameLib/plNetGameLib.h"
|
#include "plNetGameLib/plNetGameLib.h"
|
||||||
#include "plEncryption/plChecksum.h"
|
#include "plEncryption/plChecksum.h"
|
||||||
#include "plAgeDescription/plAgeManifest.h"
|
#include "plAgeDescription/plAgeManifest.h"
|
||||||
#include "plAudioCore/plAudioFileReader.h"
|
#include "plAudioCore/plAudioFileReader.h"
|
||||||
|
|
||||||
#define USES_PROTOCOL_CLI2AUTH
|
#define USES_PROTOCOL_CLI2AUTH
|
||||||
#include "pnNetProtocol/pnNetProtocol.h"
|
#include "pnNetProtocol/pnNetProtocol.h"
|
||||||
|
|
||||||
#include "UruPlayer.h"
|
#include "UruPlayer.h"
|
||||||
|
|
||||||
#include "plCompression/plZlibStream.h"
|
#include "plCompression/plZlibStream.h"
|
||||||
#include "Intern.h"
|
#include "Intern.h"
|
||||||
#include "../plUruLauncher/plLauncherInfo.h"
|
#include "../plUruLauncher/plLauncherInfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h
|
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* UruPlayer.cpp
|
* UruPlayer.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
void InitAsyncCore ();
|
void InitAsyncCore ();
|
||||||
void ShutdownAsyncCore () ;
|
void ShutdownAsyncCore () ;
|
||||||
void UruPrepProc (void * param);
|
void UruPrepProc (void * param);
|
||||||
void UruStartProc (void * param);
|
void UruStartProc (void * param);
|
||||||
void PlayerTerminateProc (void * param);
|
void PlayerTerminateProc (void * param);
|
||||||
void PlayerStopProc (void * param);
|
void PlayerStopProc (void * param);
|
||||||
|
|
||||||
extern const wchar kPatcherExeFilename[];
|
extern const wchar kPatcherExeFilename[];
|
||||||
|
@ -1,49 +1,49 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h
|
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||||
|
|
||||||
enum EStatus {
|
enum EStatus {
|
||||||
kStatusOk,
|
kStatusOk,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*launcherCallback)(int status, void *param);
|
typedef void (*launcherCallback)(int status, void *param);
|
||||||
struct plLauncherCallback {
|
struct plLauncherCallback {
|
||||||
launcherCallback prepCallback;
|
launcherCallback prepCallback;
|
||||||
launcherCallback initCallback;
|
launcherCallback initCallback;
|
||||||
launcherCallback startCallback;
|
launcherCallback startCallback;
|
||||||
launcherCallback stopCallback;
|
launcherCallback stopCallback;
|
||||||
launcherCallback terminateCallback;
|
launcherCallback terminateCallback;
|
||||||
|
|
||||||
};
|
};
|
@ -1,109 +1,109 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "../plFile/hsFiles.h"
|
#include "../plFile/hsFiles.h"
|
||||||
#include "../plFile/plEncryptedStream.h"
|
#include "../plFile/plEncryptedStream.h"
|
||||||
#include "../pnUtils/pnUtils.h"
|
#include "../pnUtils/pnUtils.h"
|
||||||
#include "../pnProduct/pnProduct.h"
|
#include "../pnProduct/pnProduct.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
|
|
||||||
void EncryptFiles(const char* dir, const char* ext, bool encrypt);
|
void EncryptFiles(const char* dir, const char* ext, bool encrypt);
|
||||||
|
|
||||||
void print_version(){
|
void print_version(){
|
||||||
wchar productString[256];
|
wchar productString[256];
|
||||||
ProductString(productString, arrsize(productString));
|
ProductString(productString, arrsize(productString));
|
||||||
printf("%S\n\n", productString);
|
printf("%S\n\n", productString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_help() {
|
void print_help() {
|
||||||
printf("plFileEncrypt - Encrypts and Decrypts Uru Files.\n\n");
|
printf("plFileEncrypt - Encrypts and Decrypts Uru Files.\n\n");
|
||||||
print_version();
|
print_version();
|
||||||
printf("Usage: plFileEncrypt \t[(encrypt|-e)|(decrypt|-d|)|(--help|-h|-?|/h)|(-v)]\n");
|
printf("Usage: plFileEncrypt \t[(encrypt|-e)|(decrypt|-d|)|(--help|-h|-?|/h)|(-v)]\n");
|
||||||
printf("\tencrypt|-e\t - Encrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
printf("\tencrypt|-e\t - Encrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
||||||
printf("\tdecrypt|-d\t - Decrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
printf("\tdecrypt|-d\t - Decrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
||||||
printf("\t--help|-h|-?|/h\t - Prints Help. This Screen.\n");
|
printf("\t--help|-h|-?|/h\t - Prints Help. This Screen.\n");
|
||||||
printf("\t-v|--version\t - Prints build version information\n");
|
printf("\t-v|--version\t - Prints build version information\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
bool encrypt = true;
|
bool encrypt = true;
|
||||||
const char* dir = ".";
|
const char* dir = ".";
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
if (hsStrEQ(argv[1], "encrypt") || hsStrEQ(argv[1], "-e") )
|
if (hsStrEQ(argv[1], "encrypt") || hsStrEQ(argv[1], "-e") )
|
||||||
{
|
{
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
dir = argv[2];
|
dir = argv[2];
|
||||||
encrypt = true;
|
encrypt = true;
|
||||||
}
|
}
|
||||||
else if (hsStrEQ(argv[1], "decrypt") || hsStrEQ(argv[1], "-d"))
|
else if (hsStrEQ(argv[1], "decrypt") || hsStrEQ(argv[1], "-d"))
|
||||||
{
|
{
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
dir = argv[2];
|
dir = argv[2];
|
||||||
encrypt = false;
|
encrypt = false;
|
||||||
}
|
}
|
||||||
else if(hsStrEQ(argv[1], "--help") || hsStrEQ(argv[1], "-h") || hsStrEQ(argv[1], "-?") || hsStrEQ(argv[1], "/?"))
|
else if(hsStrEQ(argv[1], "--help") || hsStrEQ(argv[1], "-h") || hsStrEQ(argv[1], "-?") || hsStrEQ(argv[1], "/?"))
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (hsStrEQ(argv[1], "-v") || hsStrEQ(argv[1], "--version"))
|
else if (hsStrEQ(argv[1], "-v") || hsStrEQ(argv[1], "--version"))
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EncryptFiles(dir, ".age", encrypt);
|
EncryptFiles(dir, ".age", encrypt);
|
||||||
EncryptFiles(dir, ".fni", encrypt);
|
EncryptFiles(dir, ".fni", encrypt);
|
||||||
EncryptFiles(dir, ".ini", encrypt);
|
EncryptFiles(dir, ".ini", encrypt);
|
||||||
EncryptFiles(dir, ".sdl", encrypt);
|
EncryptFiles(dir, ".sdl", encrypt);
|
||||||
EncryptFiles(dir, ".csv", encrypt);
|
EncryptFiles(dir, ".csv", encrypt);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EncryptFiles(const char* dir, const char* ext, bool encrypt)
|
void EncryptFiles(const char* dir, const char* ext, bool encrypt)
|
||||||
{
|
{
|
||||||
char filePath[256];
|
char filePath[256];
|
||||||
|
|
||||||
hsFolderIterator folder(dir);
|
hsFolderIterator folder(dir);
|
||||||
while (folder.NextFileSuffix(ext))
|
while (folder.NextFileSuffix(ext))
|
||||||
{
|
{
|
||||||
folder.GetPathAndName(filePath);
|
folder.GetPathAndName(filePath);
|
||||||
if (encrypt)
|
if (encrypt)
|
||||||
{
|
{
|
||||||
printf("encrypting: %s\n", folder.GetFileName());
|
printf("encrypting: %s\n", folder.GetFileName());
|
||||||
plEncryptedStream::FileEncrypt(filePath);
|
plEncryptedStream::FileEncrypt(filePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("decrypting: %s\n", folder.GetFileName());
|
printf("decrypting: %s\n", folder.GetFileName());
|
||||||
plEncryptedStream::FileDecrypt(filePath);
|
plEncryptedStream::FileDecrypt(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,196 +1,196 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "../plFile/hsFiles.h"
|
#include "../plFile/hsFiles.h"
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
#include "../plFile/plSecureStream.h"
|
#include "../plFile/plSecureStream.h"
|
||||||
#include "../pnUtils/pnUtils.h"
|
#include "../pnUtils/pnUtils.h"
|
||||||
#include "../pnProduct/pnProduct.h"
|
#include "../pnProduct/pnProduct.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
void print_version() {
|
void print_version() {
|
||||||
wchar productString[256];
|
wchar productString[256];
|
||||||
ProductString(productString, arrsize(productString));
|
ProductString(productString, arrsize(productString));
|
||||||
printf("%S\n\n", productString);
|
printf("%S\n\n", productString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_help() {
|
void print_help() {
|
||||||
printf("plFileSecure - Secures Uru files and generates encryption.key files.\n\n");
|
printf("plFileSecure - Secures Uru files and generates encryption.key files.\n\n");
|
||||||
print_version();
|
print_version();
|
||||||
printf("Usage:\n");
|
printf("Usage:\n");
|
||||||
printf("\tplFileSecure (<directory> <ext>)|[/generate /default]\n");
|
printf("\tplFileSecure (<directory> <ext>)|[/generate /default]\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("<directory> <ext> : The directory and extension of files to secure. Cannot\n");
|
printf("<directory> <ext> : The directory and extension of files to secure. Cannot\n");
|
||||||
printf(" be used with /generate. Uses the %s file in\n", plFileUtils::kKeyFilename);
|
printf(" be used with /generate. Uses the %s file in\n", plFileUtils::kKeyFilename);
|
||||||
printf(" the current directory (or default key if no file exists)\n");
|
printf(" the current directory (or default key if no file exists)\n");
|
||||||
printf("/generate : Generates a random key and writes it to a %s\n", plFileUtils::kKeyFilename);
|
printf("/generate : Generates a random key and writes it to a %s\n", plFileUtils::kKeyFilename);
|
||||||
printf(" file in the current directory. Cannot be used with\n");
|
printf(" file in the current directory. Cannot be used with\n");
|
||||||
printf(" <directory> <ext>\n");
|
printf(" <directory> <ext>\n");
|
||||||
printf("/default : If used with /generate, creates a %s file\n", plFileUtils::kKeyFilename);
|
printf("/default : If used with /generate, creates a %s file\n", plFileUtils::kKeyFilename);
|
||||||
printf(" with the default key. If used with <directory> <ext>, it\n");
|
printf(" with the default key. If used with <directory> <ext>, it\n");
|
||||||
printf(" secures with the default key instead of the\n");
|
printf(" secures with the default key instead of the\n");
|
||||||
printf(" %s file's key\n", plFileUtils::kKeyFilename);
|
printf(" %s file's key\n", plFileUtils::kKeyFilename);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateKey(bool useDefault)
|
void GenerateKey(bool useDefault)
|
||||||
{
|
{
|
||||||
UInt32 key[4];
|
UInt32 key[4];
|
||||||
if (useDefault)
|
if (useDefault)
|
||||||
{
|
{
|
||||||
unsigned memSize = min(arrsize(key), arrsize(plSecureStream::kDefaultKey));
|
unsigned memSize = min(arrsize(key), arrsize(plSecureStream::kDefaultKey));
|
||||||
memSize *= sizeof(UInt32);
|
memSize *= sizeof(UInt32);
|
||||||
memcpy(key, plSecureStream::kDefaultKey, memSize);
|
memcpy(key, plSecureStream::kDefaultKey, memSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
srand((unsigned)time(nil));
|
srand((unsigned)time(nil));
|
||||||
double randNum = (double)rand() / (double)RAND_MAX; // converts to 0..1
|
double randNum = (double)rand() / (double)RAND_MAX; // converts to 0..1
|
||||||
UInt32 keyNum = (UInt32)(randNum * (double)0xFFFFFFFF); // multiply it by the max unsigned 32-bit int
|
UInt32 keyNum = (UInt32)(randNum * (double)0xFFFFFFFF); // multiply it by the max unsigned 32-bit int
|
||||||
key[0] = keyNum;
|
key[0] = keyNum;
|
||||||
|
|
||||||
randNum = (double)rand() / (double)RAND_MAX;
|
randNum = (double)rand() / (double)RAND_MAX;
|
||||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||||
key[1] = keyNum;
|
key[1] = keyNum;
|
||||||
|
|
||||||
randNum = (double)rand() / (double)RAND_MAX;
|
randNum = (double)rand() / (double)RAND_MAX;
|
||||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||||
key[2] = keyNum;
|
key[2] = keyNum;
|
||||||
|
|
||||||
randNum = (double)rand() / (double)RAND_MAX;
|
randNum = (double)rand() / (double)RAND_MAX;
|
||||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||||
key[3] = keyNum;
|
key[3] = keyNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
hsUNIXStream out;
|
hsUNIXStream out;
|
||||||
out.Open(plFileUtils::kKeyFilename, "wb");
|
out.Open(plFileUtils::kKeyFilename, "wb");
|
||||||
out.Write(sizeof(UInt32) * arrsize(key), (void*)key);
|
out.Write(sizeof(UInt32) * arrsize(key), (void*)key);
|
||||||
out.Close();
|
out.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecureFiles(std::string dir, std::string ext, UInt32* key)
|
void SecureFiles(std::string dir, std::string ext, UInt32* key)
|
||||||
{
|
{
|
||||||
char filePath[256];
|
char filePath[256];
|
||||||
|
|
||||||
hsFolderIterator folder(dir.c_str());
|
hsFolderIterator folder(dir.c_str());
|
||||||
while (folder.NextFileSuffix(ext.c_str()))
|
while (folder.NextFileSuffix(ext.c_str()))
|
||||||
{
|
{
|
||||||
folder.GetPathAndName(filePath);
|
folder.GetPathAndName(filePath);
|
||||||
printf("securing: %s\n", folder.GetFileName());
|
printf("securing: %s\n", folder.GetFileName());
|
||||||
plSecureStream::FileEncrypt(filePath, key);
|
plSecureStream::FileEncrypt(filePath, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
bool generatingKey = false;
|
bool generatingKey = false;
|
||||||
bool useDefault = false;
|
bool useDefault = false;
|
||||||
std::string directory;
|
std::string directory;
|
||||||
std::string ext;
|
std::string ext;
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
for (int i = 1; i < argc; i++)
|
for (int i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
std::string arg = argv[i];
|
std::string arg = argv[i];
|
||||||
if ((arg[0] == '-')||(arg[0] == '/'))
|
if ((arg[0] == '-')||(arg[0] == '/'))
|
||||||
{
|
{
|
||||||
// this arg is a flag of some kind
|
// this arg is a flag of some kind
|
||||||
arg = arg.substr(1, arg.length()); // trim the dash or slash
|
arg = arg.substr(1, arg.length()); // trim the dash or slash
|
||||||
if ((stricmp(arg.c_str(), "g") == 0) || (stricmp(arg.c_str(), "generate") == 0))
|
if ((stricmp(arg.c_str(), "g") == 0) || (stricmp(arg.c_str(), "generate") == 0))
|
||||||
{
|
{
|
||||||
if (!generatingKey)
|
if (!generatingKey)
|
||||||
generatingKey = true;
|
generatingKey = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((stricmp(arg.c_str(), "d") == 0) || (stricmp(arg.c_str(), "default") == 0))
|
else if ((stricmp(arg.c_str(), "d") == 0) || (stricmp(arg.c_str(), "default") == 0))
|
||||||
{
|
{
|
||||||
if (!useDefault)
|
if (!useDefault)
|
||||||
useDefault = true;
|
useDefault = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// else it is a directory or extension
|
// else it is a directory or extension
|
||||||
if (directory == "")
|
if (directory == "")
|
||||||
directory = argv[i];
|
directory = argv[i];
|
||||||
else if (ext == "")
|
else if (ext == "")
|
||||||
ext = argv[i];
|
ext = argv[i];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generatingKey && ((directory != "") || (ext != "")))
|
if (generatingKey && ((directory != "") || (ext != "")))
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generatingKey)
|
if (generatingKey)
|
||||||
{
|
{
|
||||||
GenerateKey(useDefault);
|
GenerateKey(useDefault);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ext[0] != '.')
|
if (ext[0] != '.')
|
||||||
ext = "." + ext; // tack on the dot if necessary
|
ext = "." + ext; // tack on the dot if necessary
|
||||||
|
|
||||||
if (useDefault)
|
if (useDefault)
|
||||||
SecureFiles(directory, ext, nil);
|
SecureFiles(directory, ext, nil);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UInt32 key[4];
|
UInt32 key[4];
|
||||||
plFileUtils::GetSecureEncryptionKey(plFileUtils::kKeyFilename, key, arrsize(key));
|
plFileUtils::GetSecureEncryptionKey(plFileUtils::kKeyFilename, key, arrsize(key));
|
||||||
SecureFiles(directory, ext, key);
|
SecureFiles(directory, ext, key);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,110 +1,110 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* plLogDecrypt - Used by mantis to decrypt log files
|
* plLogDecrypt - Used by mantis to decrypt log files
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "../plStatusLog/plEncryptLogLine.h"
|
#include "../plStatusLog/plEncryptLogLine.h"
|
||||||
|
|
||||||
void IProcessFile(const char *path)
|
void IProcessFile(const char *path)
|
||||||
{
|
{
|
||||||
char out_path[512];
|
char out_path[512];
|
||||||
strcpy(out_path, path);
|
strcpy(out_path, path);
|
||||||
strcat(out_path, ".decrypt");
|
strcat(out_path, ".decrypt");
|
||||||
|
|
||||||
FILE * fpIn = fopen(path, "rb");
|
FILE * fpIn = fopen(path, "rb");
|
||||||
FILE * fpOut = fopen(out_path, "w");
|
FILE * fpOut = fopen(out_path, "w");
|
||||||
|
|
||||||
if( fpIn != nil && fpOut != nil)
|
if( fpIn != nil && fpOut != nil)
|
||||||
{
|
{
|
||||||
UInt8 line[ 2048 ];
|
UInt8 line[ 2048 ];
|
||||||
while( !feof( fpIn ) )
|
while( !feof( fpIn ) )
|
||||||
{
|
{
|
||||||
// Read next string
|
// Read next string
|
||||||
long pos = ftell(fpIn);
|
long pos = ftell(fpIn);
|
||||||
if( pos == -1L )
|
if( pos == -1L )
|
||||||
break;
|
break;
|
||||||
UInt8 hint = (UInt8)pos;
|
UInt8 hint = (UInt8)pos;
|
||||||
UInt16 sizeHint = (UInt16)pos;
|
UInt16 sizeHint = (UInt16)pos;
|
||||||
UInt16 size;
|
UInt16 size;
|
||||||
|
|
||||||
if( stricmp( path + strlen( path ) - 4, ".log" ) == 0 )
|
if( stricmp( path + strlen( path ) - 4, ".log" ) == 0 )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for( i = 0; i < 511; i++ )
|
for( i = 0; i < 511; i++ )
|
||||||
{
|
{
|
||||||
int c = fgetc( fpIn );
|
int c = fgetc( fpIn );
|
||||||
if( c == EOF || c == hint )
|
if( c == EOF || c == hint )
|
||||||
break;
|
break;
|
||||||
line[ i ] = (UInt8)c;
|
line[ i ] = (UInt8)c;
|
||||||
}
|
}
|
||||||
line[ i ] = 0;
|
line[ i ] = 0;
|
||||||
size = i;
|
size = i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// UInt16 line length is encoded first
|
// UInt16 line length is encoded first
|
||||||
int c = fgetc( fpIn );
|
int c = fgetc( fpIn );
|
||||||
if( c == EOF )
|
if( c == EOF )
|
||||||
break;
|
break;
|
||||||
size = ( c & 0xff ) | ( fgetc( fpIn ) << 8 );
|
size = ( c & 0xff ) | ( fgetc( fpIn ) << 8 );
|
||||||
|
|
||||||
size = size ^ sizeHint;
|
size = size ^ sizeHint;
|
||||||
|
|
||||||
if( size > sizeof( line ) )
|
if( size > sizeof( line ) )
|
||||||
{
|
{
|
||||||
hsAssert( size <= sizeof( line ) - 1, "Invalid line size" );
|
hsAssert( size <= sizeof( line ) - 1, "Invalid line size" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread( line, 1, size, fpIn );
|
fread( line, 1, size, fpIn );
|
||||||
line[ size ] = 0;
|
line[ size ] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
plStatusEncrypt::Decrypt( line, size, hint );
|
plStatusEncrypt::Decrypt( line, size, hint );
|
||||||
fprintf(fpOut, "%s\n", (const char *)line);
|
fprintf(fpOut, "%s\n", (const char *)line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fpIn)
|
if (fpIn)
|
||||||
fclose(fpIn);
|
fclose(fpIn);
|
||||||
if (fpOut)
|
if (fpOut)
|
||||||
fclose(fpOut);
|
fclose(fpOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char * argv[])
|
int main(int argc, const char * argv[])
|
||||||
{
|
{
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
{
|
{
|
||||||
IProcessFile(argv[1]);
|
IProcessFile(argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h
|
* $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Main.cpp
|
* $/Plasma20/Sources/Plasma/Apps/plMD5/Main.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#include "Pch.h"
|
#include "Pch.h"
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Exports
|
* Exports
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int __cdecl main (int argc, char ** argv) {
|
int __cdecl main (int argc, char ** argv) {
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "ERROR: Please specify filename.\n");
|
fprintf(stderr, "ERROR: Please specify filename.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
plMD5Checksum md5(argv[1]);
|
plMD5Checksum md5(argv[1]);
|
||||||
if (!md5.IsValid()) {
|
if (!md5.IsValid()) {
|
||||||
fprintf(stderr, "ERROR: MD5 failed.\n");
|
fprintf(stderr, "ERROR: MD5 failed.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stdout, "%s\n", md5.GetAsHexString());
|
fprintf(stdout, "%s\n", md5.GetAsHexString());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h
|
* $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
||||||
|
|
||||||
#include "pnUtils/pnUtils.h"
|
#include "pnUtils/pnUtils.h"
|
||||||
#include "pnProduct/pnProduct.h"
|
#include "pnProduct/pnProduct.h"
|
||||||
#include "plEncryption/plChecksum.h"
|
#include "plEncryption/plChecksum.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
|
|
||||||
#include "../pnFactory/plCreator.h"
|
#include "../pnFactory/plCreator.h"
|
||||||
|
|
||||||
#include "plAudible.h"
|
#include "plAudible.h"
|
||||||
REGISTER_NONCREATABLE( plAudible );
|
REGISTER_NONCREATABLE( plAudible );
|
||||||
|
|
||||||
#include "plDrawable.h"
|
#include "plDrawable.h"
|
||||||
REGISTER_NONCREATABLE( plDrawable );
|
REGISTER_NONCREATABLE( plDrawable );
|
||||||
|
|
||||||
#include "plPhysical.h"
|
#include "plPhysical.h"
|
||||||
REGISTER_NONCREATABLE( plPhysical );
|
REGISTER_NONCREATABLE( plPhysical );
|
||||||
|
|
||||||
#include "plgDispatch.h"
|
#include "plgDispatch.h"
|
||||||
REGISTER_NONCREATABLE( plDispatchBase );
|
REGISTER_NONCREATABLE( plDispatchBase );
|
||||||
|
|
||||||
#include "../pnDispatch/pnDispatchCreatable.h"
|
#include "../pnDispatch/pnDispatchCreatable.h"
|
||||||
#include "../pnKeyedObject/pnKeyedObjectCreatable.h"
|
#include "../pnKeyedObject/pnKeyedObjectCreatable.h"
|
||||||
#include "../pnMessage/pnMessageCreatable.h"
|
#include "../pnMessage/pnMessageCreatable.h"
|
||||||
#include "../pnModifier/pnModifierCreatable.h"
|
#include "../pnModifier/pnModifierCreatable.h"
|
||||||
#include "../pnNetCommon/pnNetCommonCreatable.h"
|
#include "../pnNetCommon/pnNetCommonCreatable.h"
|
||||||
#include "../pnTimer/pnTimerCreatable.h"
|
#include "../pnTimer/pnTimerCreatable.h"
|
||||||
|
|
||||||
#include "../plResMgr/plResMgrCreatable.h"
|
#include "../plResMgr/plResMgrCreatable.h"
|
||||||
|
|
||||||
#include "../plMessage/plResMgrHelperMsg.h"
|
#include "../plMessage/plResMgrHelperMsg.h"
|
||||||
REGISTER_CREATABLE(plResMgrHelperMsg);
|
REGISTER_CREATABLE(plResMgrHelperMsg);
|
||||||
|
|
||||||
#include "../plAudioCore/plAudioCoreCreatable.h"
|
#include "../plAudioCore/plAudioCoreCreatable.h"
|
||||||
|
@ -1,254 +1,254 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
#include "hsTimer.h"
|
#include "hsTimer.h"
|
||||||
#include "../plFile/hsFiles.h"
|
#include "../plFile/hsFiles.h"
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
#include "../plResMgr/plResManager.h"
|
#include "../plResMgr/plResManager.h"
|
||||||
#include "../plResMgr/plResMgrSettings.h"
|
#include "../plResMgr/plResMgrSettings.h"
|
||||||
|
|
||||||
#include "../plAgeDescription/plAgeManifest.h"
|
#include "../plAgeDescription/plAgeManifest.h"
|
||||||
|
|
||||||
#include "../plResMgr/plRegistryHelpers.h"
|
#include "../plResMgr/plRegistryHelpers.h"
|
||||||
#include "../plResMgr/plRegistryNode.h"
|
#include "../plResMgr/plRegistryNode.h"
|
||||||
|
|
||||||
#include "../plAudioCore/plSoundBuffer.h"
|
#include "../plAudioCore/plSoundBuffer.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
|
|
||||||
#include "../pnUtils/pnUtils.h"
|
#include "../pnUtils/pnUtils.h"
|
||||||
#include "../pnProduct/pnProduct.h"
|
#include "../pnProduct/pnProduct.h"
|
||||||
|
|
||||||
|
|
||||||
//// Globals /////////////////////////////////////////////////////////////////
|
//// Globals /////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
plResManager* gResMgr = nil;
|
plResManager* gResMgr = nil;
|
||||||
|
|
||||||
bool DumpStats(const char* patchDir);
|
bool DumpStats(const char* patchDir);
|
||||||
bool DumpSounds();
|
bool DumpSounds();
|
||||||
|
|
||||||
//// PrintVersion ///////////////////////////////////////////////////////////////
|
//// PrintVersion ///////////////////////////////////////////////////////////////
|
||||||
void PrintVersion()
|
void PrintVersion()
|
||||||
{
|
{
|
||||||
wchar productString[256];
|
wchar productString[256];
|
||||||
ProductString(productString, arrsize(productString));
|
ProductString(productString, arrsize(productString));
|
||||||
_putws(productString);
|
_putws(productString);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// PrintHelp ///////////////////////////////////////////////////////////////
|
//// PrintHelp ///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int PrintHelp( void )
|
int PrintHelp( void )
|
||||||
{
|
{
|
||||||
puts("");
|
puts("");
|
||||||
PrintVersion();
|
PrintVersion();
|
||||||
puts("");
|
puts("");
|
||||||
puts("Usage: plPageInfo [-s -i] pageFile");
|
puts("Usage: plPageInfo [-s -i] pageFile");
|
||||||
puts(" plPageInfo -v");
|
puts(" plPageInfo -v");
|
||||||
puts("Where:" );
|
puts("Where:" );
|
||||||
puts(" -v print version and exit.");
|
puts(" -v print version and exit.");
|
||||||
puts(" -s dump sounds in page to the console");
|
puts(" -s dump sounds in page to the console");
|
||||||
puts(" -i dump object size info to .csv files");
|
puts(" -i dump object size info to .csv files");
|
||||||
puts(" pageFile is the path to the .prp file");
|
puts(" pageFile is the path to the .prp file");
|
||||||
puts("");
|
puts("");
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//// main ////////////////////////////////////////////////////////////////////
|
//// main ////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc >= 1 && hsStrEQ(argv[1], "-v"))
|
if (argc >= 1 && hsStrEQ(argv[1], "-v"))
|
||||||
{
|
{
|
||||||
PrintVersion();
|
PrintVersion();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
return PrintHelp();
|
return PrintHelp();
|
||||||
|
|
||||||
bool sounds = false;
|
bool sounds = false;
|
||||||
bool stats = false;
|
bool stats = false;
|
||||||
|
|
||||||
int arg = 1;
|
int arg = 1;
|
||||||
for (arg = 1; arg < argc; arg++)
|
for (arg = 1; arg < argc; arg++)
|
||||||
{
|
{
|
||||||
if (hsStrEQ(argv[arg], "-s"))
|
if (hsStrEQ(argv[arg], "-s"))
|
||||||
sounds = true;
|
sounds = true;
|
||||||
else if (hsStrEQ(argv[arg], "-i"))
|
else if (hsStrEQ(argv[arg], "-i"))
|
||||||
stats = true;
|
stats = true;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we have 1 arg left after getting the options
|
// Make sure we have 1 arg left after getting the options
|
||||||
char* pageFile = nil;
|
char* pageFile = nil;
|
||||||
if (arg < argc)
|
if (arg < argc)
|
||||||
pageFile = argv[arg];
|
pageFile = argv[arg];
|
||||||
else
|
else
|
||||||
return PrintHelp();
|
return PrintHelp();
|
||||||
|
|
||||||
// Init our special resMgr
|
// Init our special resMgr
|
||||||
plResMgrSettings::Get().SetFilterNewerPageVersions(false);
|
plResMgrSettings::Get().SetFilterNewerPageVersions(false);
|
||||||
plResMgrSettings::Get().SetFilterOlderPageVersions(false);
|
plResMgrSettings::Get().SetFilterOlderPageVersions(false);
|
||||||
plResMgrSettings::Get().SetLoadPagesOnInit(false);
|
plResMgrSettings::Get().SetLoadPagesOnInit(false);
|
||||||
gResMgr = TRACKED_NEW plResManager;
|
gResMgr = TRACKED_NEW plResManager;
|
||||||
hsgResMgr::Init(gResMgr);
|
hsgResMgr::Init(gResMgr);
|
||||||
gResMgr->AddSinglePage(pageFile);
|
gResMgr->AddSinglePage(pageFile);
|
||||||
|
|
||||||
if (sounds)
|
if (sounds)
|
||||||
DumpSounds();
|
DumpSounds();
|
||||||
if (stats)
|
if (stats)
|
||||||
{
|
{
|
||||||
char path[256];
|
char path[256];
|
||||||
strcpy(path, pageFile);
|
strcpy(path, pageFile);
|
||||||
plFileUtils::StripFile(path);
|
plFileUtils::StripFile(path);
|
||||||
DumpStats(path);
|
DumpStats(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
hsgResMgr::Shutdown();
|
hsgResMgr::Shutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//// plSoundBufferCollector //////////////////////////////////////////////////
|
//// plSoundBufferCollector //////////////////////////////////////////////////
|
||||||
// Page iterator that collects all the plSoundBuffers in all of our pages
|
// Page iterator that collects all the plSoundBuffers in all of our pages
|
||||||
|
|
||||||
class plSoundBufferCollector : public plRegistryPageIterator, public plKeyCollector
|
class plSoundBufferCollector : public plRegistryPageIterator, public plKeyCollector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
plSoundBufferCollector(hsTArray<plKey>& keyArray)
|
plSoundBufferCollector(hsTArray<plKey>& keyArray)
|
||||||
: plKeyCollector(keyArray) {}
|
: plKeyCollector(keyArray) {}
|
||||||
|
|
||||||
hsBool EatPage(plRegistryPageNode* page)
|
hsBool EatPage(plRegistryPageNode* page)
|
||||||
{
|
{
|
||||||
page->LoadKeys();
|
page->LoadKeys();
|
||||||
return page->IterateKeys(this, plSoundBuffer::Index());
|
return page->IterateKeys(this, plSoundBuffer::Index());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool DumpSounds()
|
bool DumpSounds()
|
||||||
{
|
{
|
||||||
hsTArray<plKey> soundKeys;
|
hsTArray<plKey> soundKeys;
|
||||||
|
|
||||||
plSoundBufferCollector soundCollector(soundKeys);
|
plSoundBufferCollector soundCollector(soundKeys);
|
||||||
gResMgr->IterateAllPages(&soundCollector);
|
gResMgr->IterateAllPages(&soundCollector);
|
||||||
|
|
||||||
for (int i = 0; i < soundKeys.GetCount(); i++)
|
for (int i = 0; i < soundKeys.GetCount(); i++)
|
||||||
{
|
{
|
||||||
plSoundBuffer* buffer = plSoundBuffer::ConvertNoRef(soundKeys[i]->VerifyLoaded());
|
plSoundBuffer* buffer = plSoundBuffer::ConvertNoRef(soundKeys[i]->VerifyLoaded());
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
// Ref it...
|
// Ref it...
|
||||||
buffer->GetKey()->RefObject();
|
buffer->GetKey()->RefObject();
|
||||||
|
|
||||||
// Get the filename from it and add that file if necessary
|
// Get the filename from it and add that file if necessary
|
||||||
const char* filename = buffer->GetFileName();
|
const char* filename = buffer->GetFileName();
|
||||||
if (filename)
|
if (filename)
|
||||||
{
|
{
|
||||||
UInt32 flags = 0;
|
UInt32 flags = 0;
|
||||||
|
|
||||||
if (stricmp(plFileUtils::GetFileExt(filename), "wav") != 0)
|
if (stricmp(plFileUtils::GetFileExt(filename), "wav") != 0)
|
||||||
{
|
{
|
||||||
if (buffer->HasFlag(plSoundBuffer::kOnlyLeftChannel) ||
|
if (buffer->HasFlag(plSoundBuffer::kOnlyLeftChannel) ||
|
||||||
buffer->HasFlag(plSoundBuffer::kOnlyRightChannel))
|
buffer->HasFlag(plSoundBuffer::kOnlyRightChannel))
|
||||||
hsSetBits(flags, plManifestFile::kSndFlagCacheSplit);
|
hsSetBits(flags, plManifestFile::kSndFlagCacheSplit);
|
||||||
else if (buffer->HasFlag(plSoundBuffer::kStreamCompressed))
|
else if (buffer->HasFlag(plSoundBuffer::kStreamCompressed))
|
||||||
hsSetBits(flags, plManifestFile::kSndFlagStreamCompressed);
|
hsSetBits(flags, plManifestFile::kSndFlagStreamCompressed);
|
||||||
else
|
else
|
||||||
hsSetBits(flags, plManifestFile::kSndFlagCacheStereo);
|
hsSetBits(flags, plManifestFile::kSndFlagCacheStereo);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s,%u\n", filename, flags);
|
printf("%s,%u\n", filename, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unref the object so it goes away
|
// Unref the object so it goes away
|
||||||
buffer->GetKey()->UnRefObject();
|
buffer->GetKey()->UnRefObject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
soundKeys.Reset();
|
soundKeys.Reset();
|
||||||
plIndirectUnloadIterator iter;
|
plIndirectUnloadIterator iter;
|
||||||
gResMgr->IterateAllPages(&iter);
|
gResMgr->IterateAllPages(&iter);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "../pnKeyedObject/plKeyImp.h"
|
#include "../pnKeyedObject/plKeyImp.h"
|
||||||
|
|
||||||
class plStatDumpIterator : public plRegistryPageIterator, public plRegistryKeyIterator
|
class plStatDumpIterator : public plRegistryPageIterator, public plRegistryKeyIterator
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
const char* fOutputDir;
|
const char* fOutputDir;
|
||||||
hsUNIXStream fStream;
|
hsUNIXStream fStream;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plStatDumpIterator(const char* outputDir) : fOutputDir(outputDir) {}
|
plStatDumpIterator(const char* outputDir) : fOutputDir(outputDir) {}
|
||||||
|
|
||||||
hsBool EatKey(const plKey& key)
|
hsBool EatKey(const plKey& key)
|
||||||
{
|
{
|
||||||
plKeyImp* imp = (plKey)key;
|
plKeyImp* imp = (plKey)key;
|
||||||
|
|
||||||
fStream.WriteString(imp->GetName());
|
fStream.WriteString(imp->GetName());
|
||||||
fStream.WriteString(",");
|
fStream.WriteString(",");
|
||||||
|
|
||||||
fStream.WriteString(plFactory::GetNameOfClass(imp->GetUoid().GetClassType()));
|
fStream.WriteString(plFactory::GetNameOfClass(imp->GetUoid().GetClassType()));
|
||||||
fStream.WriteString(",");
|
fStream.WriteString(",");
|
||||||
|
|
||||||
char buf[30];
|
char buf[30];
|
||||||
sprintf(buf, "%u", imp->GetDataLen());
|
sprintf(buf, "%u", imp->GetDataLen());
|
||||||
fStream.WriteString(buf);
|
fStream.WriteString(buf);
|
||||||
fStream.WriteString("\n");
|
fStream.WriteString("\n");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
hsBool EatPage(plRegistryPageNode* page)
|
hsBool EatPage(plRegistryPageNode* page)
|
||||||
{
|
{
|
||||||
const plPageInfo& info = page->GetPageInfo();
|
const plPageInfo& info = page->GetPageInfo();
|
||||||
|
|
||||||
char fileName[256];
|
char fileName[256];
|
||||||
sprintf(fileName, "%s%s_%s.csv", fOutputDir, info.GetAge(), info.GetPage());
|
sprintf(fileName, "%s%s_%s.csv", fOutputDir, info.GetAge(), info.GetPage());
|
||||||
fStream.Open(fileName, "wt");
|
fStream.Open(fileName, "wt");
|
||||||
|
|
||||||
page->LoadKeys();
|
page->LoadKeys();
|
||||||
page->IterateKeys(this);
|
page->IterateKeys(this);
|
||||||
|
|
||||||
fStream.Close();
|
fStream.Close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool DumpStats(const char* patchDir)
|
bool DumpStats(const char* patchDir)
|
||||||
{
|
{
|
||||||
plStatDumpIterator statDump(patchDir);
|
plStatDumpIterator statDump(patchDir);
|
||||||
gResMgr->IterateAllPages(&statDump);
|
gResMgr->IterateAllPages(&statDump);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
@ -1,105 +1,105 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "../plResMgr/plResManager.h"
|
#include "../plResMgr/plResManager.h"
|
||||||
#include "../pfPython/plPythonFileMod.h"
|
#include "../pfPython/plPythonFileMod.h"
|
||||||
#include "../plGImage/plFontCache.h"
|
#include "../plGImage/plFontCache.h"
|
||||||
#include "../plPhysX/plSimulationMgr.h"
|
#include "../plPhysX/plSimulationMgr.h"
|
||||||
#include "../plAvatar/plAvatarMgr.h"
|
#include "../plAvatar/plAvatarMgr.h"
|
||||||
|
|
||||||
#include "plPageOptimizer.h"
|
#include "plPageOptimizer.h"
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
printf("plPageOptimizer: wrong number of arguments");
|
printf("plPageOptimizer: wrong number of arguments");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Optimizing %s...", plFileUtils::GetFileName(argv[1]));
|
printf("Optimizing %s...", plFileUtils::GetFileName(argv[1]));
|
||||||
|
|
||||||
plFontCache* fontCache;
|
plFontCache* fontCache;
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
plResManager* resMgr = TRACKED_NEW plResManager;
|
plResManager* resMgr = TRACKED_NEW plResManager;
|
||||||
hsgResMgr::Init(resMgr);
|
hsgResMgr::Init(resMgr);
|
||||||
|
|
||||||
// Setup all the crap that needs to be around to load
|
// Setup all the crap that needs to be around to load
|
||||||
plSimulationMgr::Init();
|
plSimulationMgr::Init();
|
||||||
fontCache = TRACKED_NEW plFontCache;
|
fontCache = TRACKED_NEW plFontCache;
|
||||||
plPythonFileMod::SetAtConvertTime();
|
plPythonFileMod::SetAtConvertTime();
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
} catch (...)
|
} catch (...)
|
||||||
{
|
{
|
||||||
printf(" ***crashed on init");
|
printf(" ***crashed on init");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
try
|
try
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
plPageOptimizer optimizer(argv[1]);
|
plPageOptimizer optimizer(argv[1]);
|
||||||
optimizer.Optimize();
|
optimizer.Optimize();
|
||||||
}
|
}
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
printf(" ***crashed on optimizing");
|
printf(" ***crashed on optimizing");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
// Deinit the crap
|
// Deinit the crap
|
||||||
fontCache->UnRegisterAs(kFontCache_KEY);
|
fontCache->UnRegisterAs(kFontCache_KEY);
|
||||||
fontCache = nil;
|
fontCache = nil;
|
||||||
plSimulationMgr::Shutdown();
|
plSimulationMgr::Shutdown();
|
||||||
|
|
||||||
// Reading in objects may have generated dirty state which we're obviously
|
// Reading in objects may have generated dirty state which we're obviously
|
||||||
// not sending out. Clear it so that we don't have leaked keys before the
|
// not sending out. Clear it so that we don't have leaked keys before the
|
||||||
// ResMgr goes away.
|
// ResMgr goes away.
|
||||||
std::vector<plSynchedObject::StateDefn> carryOvers;
|
std::vector<plSynchedObject::StateDefn> carryOvers;
|
||||||
plSynchedObject::ClearDirtyState(carryOvers);
|
plSynchedObject::ClearDirtyState(carryOvers);
|
||||||
|
|
||||||
hsgResMgr::Shutdown();
|
hsgResMgr::Shutdown();
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
} catch (...)
|
} catch (...)
|
||||||
{
|
{
|
||||||
printf(" ***crashed on shutdown");
|
printf(" ***crashed on shutdown");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "../pfCharacter/pfCharacterCreatable.h"
|
#include "../pfCharacter/pfCharacterCreatable.h"
|
||||||
#include "../pfCamera/pfCameraCreatable.h"
|
#include "../pfCamera/pfCameraCreatable.h"
|
||||||
#include "../pfAnimation/pfAnimationCreatable.h"
|
#include "../pfAnimation/pfAnimationCreatable.h"
|
||||||
#include "../pfConditional/plConditionalObjectCreatable.h"
|
#include "../pfConditional/plConditionalObjectCreatable.h"
|
||||||
//#include "../pfConsole/pfConsoleCreatable.h"
|
//#include "../pfConsole/pfConsoleCreatable.h"
|
||||||
#include "../pfSurface/pfSurfaceCreatable.h"
|
#include "../pfSurface/pfSurfaceCreatable.h"
|
||||||
#include "../pfMessage/pfMessageCreatable.h"
|
#include "../pfMessage/pfMessageCreatable.h"
|
||||||
#include "../pfAudio/pfAudioCreatable.h"
|
#include "../pfAudio/pfAudioCreatable.h"
|
||||||
#include "../pfPython/pfPythonCreatable.h"
|
#include "../pfPython/pfPythonCreatable.h"
|
||||||
#include "../pfGameGUIMgr/pfGameGUIMgrCreatable.h"
|
#include "../pfGameGUIMgr/pfGameGUIMgrCreatable.h"
|
||||||
#include "../pfCCR/plCCRCreatable.h"
|
#include "../pfCCR/plCCRCreatable.h"
|
||||||
#include "../pfJournalBook/pfJournalBookCreatable.h"
|
#include "../pfJournalBook/pfJournalBookCreatable.h"
|
||||||
#include "../pfGameMgr/pfGameMgrCreatables.h"
|
#include "../pfGameMgr/pfGameMgrCreatables.h"
|
||||||
|
@ -1,269 +1,269 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "plPageOptimizer.h"
|
#include "plPageOptimizer.h"
|
||||||
|
|
||||||
#include "../pnKeyedObject/plUoid.h"
|
#include "../pnKeyedObject/plUoid.h"
|
||||||
#include "../plResMgr/plResManager.h"
|
#include "../plResMgr/plResManager.h"
|
||||||
#include "../plResMgr/plRegistryHelpers.h"
|
#include "../plResMgr/plRegistryHelpers.h"
|
||||||
#include "../plResMgr/plKeyFinder.h"
|
#include "../plResMgr/plKeyFinder.h"
|
||||||
#include "../plResMgr/plRegistryNode.h"
|
#include "../plResMgr/plRegistryNode.h"
|
||||||
|
|
||||||
#include "../pnFactory/plFactory.h"
|
#include "../pnFactory/plFactory.h"
|
||||||
#include "../pnKeyedObject/plKeyImp.h"
|
#include "../pnKeyedObject/plKeyImp.h"
|
||||||
|
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
|
|
||||||
plPageOptimizer* plPageOptimizer::fInstance = nil;
|
plPageOptimizer* plPageOptimizer::fInstance = nil;
|
||||||
|
|
||||||
plPageOptimizer::plPageOptimizer(const char* pagePath) :
|
plPageOptimizer::plPageOptimizer(const char* pagePath) :
|
||||||
fOptimized(true),
|
fOptimized(true),
|
||||||
fPageNode(nil),
|
fPageNode(nil),
|
||||||
fPagePath(pagePath)
|
fPagePath(pagePath)
|
||||||
{
|
{
|
||||||
fInstance = this;
|
fInstance = this;
|
||||||
|
|
||||||
strcpy(fTempPagePath, fPagePath);
|
strcpy(fTempPagePath, fPagePath);
|
||||||
plFileUtils::StripExt(fTempPagePath);
|
plFileUtils::StripExt(fTempPagePath);
|
||||||
strcat(fTempPagePath, "_opt.prp");
|
strcat(fTempPagePath, "_opt.prp");
|
||||||
|
|
||||||
fResMgr = (plResManager*)hsgResMgr::ResMgr();
|
fResMgr = (plResManager*)hsgResMgr::ResMgr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPageOptimizer::IFindLoc()
|
void plPageOptimizer::IFindLoc()
|
||||||
{
|
{
|
||||||
class plPageIt : public plRegistryPageIterator
|
class plPageIt : public plRegistryPageIterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
plLocation fLoc;
|
plLocation fLoc;
|
||||||
|
|
||||||
virtual hsBool EatPage(plRegistryPageNode* keyNode)
|
virtual hsBool EatPage(plRegistryPageNode* keyNode)
|
||||||
{
|
{
|
||||||
fLoc = keyNode->GetPageInfo().GetLocation();
|
fLoc = keyNode->GetPageInfo().GetLocation();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
plPageIt it;
|
plPageIt it;
|
||||||
fResMgr->IterateAllPages(&it);
|
fResMgr->IterateAllPages(&it);
|
||||||
fLoc = it.fLoc;
|
fLoc = it.fLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPageOptimizer::Optimize()
|
void plPageOptimizer::Optimize()
|
||||||
{
|
{
|
||||||
fResMgr->AddSinglePage(fPagePath);
|
fResMgr->AddSinglePage(fPagePath);
|
||||||
|
|
||||||
// Get the location of the page we're optimizing
|
// Get the location of the page we're optimizing
|
||||||
IFindLoc();
|
IFindLoc();
|
||||||
|
|
||||||
hsBool loaded = true;
|
hsBool loaded = true;
|
||||||
|
|
||||||
// Get the key for the scene node, we'll load it to force a load on all the objects
|
// Get the key for the scene node, we'll load it to force a load on all the objects
|
||||||
plKey snKey = plKeyFinder::Instance().FindSceneNodeKey(fLoc);
|
plKey snKey = plKeyFinder::Instance().FindSceneNodeKey(fLoc);
|
||||||
if (snKey)
|
if (snKey)
|
||||||
{
|
{
|
||||||
// Load all the keys
|
// Load all the keys
|
||||||
fPageNode = fResMgr->FindPage(fLoc);
|
fPageNode = fResMgr->FindPage(fLoc);
|
||||||
fResMgr->LoadPageKeys(fPageNode);
|
fResMgr->LoadPageKeys(fPageNode);
|
||||||
|
|
||||||
// Put all the keys in a vector, so they won't get unreffed
|
// Put all the keys in a vector, so they won't get unreffed
|
||||||
class plVecKeyCollector : public plRegistryKeyIterator
|
class plVecKeyCollector : public plRegistryKeyIterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KeyVec& fKeys;
|
KeyVec& fKeys;
|
||||||
plVecKeyCollector(KeyVec& keys) : fKeys(keys) {}
|
plVecKeyCollector(KeyVec& keys) : fKeys(keys) {}
|
||||||
virtual hsBool EatKey(const plKey& key) { fKeys.push_back(key); return true; }
|
virtual hsBool EatKey(const plKey& key) { fKeys.push_back(key); return true; }
|
||||||
};
|
};
|
||||||
plVecKeyCollector keyIt(fAllKeys);
|
plVecKeyCollector keyIt(fAllKeys);
|
||||||
fResMgr->IterateKeys(&keyIt);
|
fResMgr->IterateKeys(&keyIt);
|
||||||
|
|
||||||
// Set our load proc, which will track the order that objects are loaded
|
// Set our load proc, which will track the order that objects are loaded
|
||||||
fResMgr->SetProgressBarProc(KeyedObjectProc);
|
fResMgr->SetProgressBarProc(KeyedObjectProc);
|
||||||
|
|
||||||
// Load the page
|
// Load the page
|
||||||
snKey->VerifyLoaded();
|
snKey->VerifyLoaded();
|
||||||
|
|
||||||
// Unload everything
|
// Unload everything
|
||||||
snKey->RefObject();
|
snKey->RefObject();
|
||||||
snKey->UnRefObject();
|
snKey->UnRefObject();
|
||||||
snKey = nil;
|
snKey = nil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loaded = false;
|
loaded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loaded)
|
if (loaded)
|
||||||
IRewritePage();
|
IRewritePage();
|
||||||
|
|
||||||
UInt32 oldSize = plFileUtils::GetFileSize(fPagePath);
|
UInt32 oldSize = plFileUtils::GetFileSize(fPagePath);
|
||||||
UInt32 newSize = plFileUtils::GetFileSize(fTempPagePath);
|
UInt32 newSize = plFileUtils::GetFileSize(fTempPagePath);
|
||||||
|
|
||||||
if (!loaded)
|
if (!loaded)
|
||||||
{
|
{
|
||||||
printf("no scene node.\n");
|
printf("no scene node.\n");
|
||||||
}
|
}
|
||||||
else if (fOptimized)
|
else if (fOptimized)
|
||||||
{
|
{
|
||||||
plFileUtils::RemoveFile(fTempPagePath);
|
plFileUtils::RemoveFile(fTempPagePath);
|
||||||
printf("already optimized.\n");
|
printf("already optimized.\n");
|
||||||
}
|
}
|
||||||
else if (oldSize == newSize)
|
else if (oldSize == newSize)
|
||||||
{
|
{
|
||||||
plFileUtils::RemoveFile(fPagePath, true);
|
plFileUtils::RemoveFile(fPagePath, true);
|
||||||
plFileUtils::FileMove(fTempPagePath, fPagePath);
|
plFileUtils::FileMove(fTempPagePath, fPagePath);
|
||||||
|
|
||||||
printf("complete\n");
|
printf("complete\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
plFileUtils::RemoveFile(fTempPagePath);
|
plFileUtils::RemoveFile(fTempPagePath);
|
||||||
printf("failed. File sizes different\n");
|
printf("failed. File sizes different\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPageOptimizer::KeyedObjectProc(plKey key)
|
void plPageOptimizer::KeyedObjectProc(plKey key)
|
||||||
{
|
{
|
||||||
const char* keyName = key->GetName();
|
const char* keyName = key->GetName();
|
||||||
const char* className = plFactory::GetNameOfClass(key->GetUoid().GetClassType());
|
const char* className = plFactory::GetNameOfClass(key->GetUoid().GetClassType());
|
||||||
|
|
||||||
// For now, ignore any key that isn't in the location we're looking at. That means stuff like textures.
|
// For now, ignore any key that isn't in the location we're looking at. That means stuff like textures.
|
||||||
if (fInstance->fLoc != key->GetUoid().GetLocation())
|
if (fInstance->fLoc != key->GetUoid().GetLocation())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KeySet& loadedKeys = fInstance->fLoadedKeys;
|
KeySet& loadedKeys = fInstance->fLoadedKeys;
|
||||||
KeyVec& loadOrder = fInstance->fKeyLoadOrder;
|
KeyVec& loadOrder = fInstance->fKeyLoadOrder;
|
||||||
|
|
||||||
KeySet::iterator it = loadedKeys.lower_bound(key);
|
KeySet::iterator it = loadedKeys.lower_bound(key);
|
||||||
if (it != loadedKeys.end() && *it == key)
|
if (it != loadedKeys.end() && *it == key)
|
||||||
{
|
{
|
||||||
printf("Keyed object %s(%s) loaded more than once\n", keyName, className);
|
printf("Keyed object %s(%s) loaded more than once\n", keyName, className);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loadedKeys.insert(it, key);
|
loadedKeys.insert(it, key);
|
||||||
loadOrder.push_back(key);
|
loadOrder.push_back(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPageOptimizer::IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key)
|
void plPageOptimizer::IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key)
|
||||||
{
|
{
|
||||||
class plUpdateKeyImp : public plKeyImp
|
class plUpdateKeyImp : public plKeyImp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void SetStartPos(UInt32 startPos) { fStartPos = startPos; }
|
void SetStartPos(UInt32 startPos) { fStartPos = startPos; }
|
||||||
};
|
};
|
||||||
|
|
||||||
plUpdateKeyImp* keyImp = (plUpdateKeyImp*)(plKeyImp*)key;
|
plUpdateKeyImp* keyImp = (plUpdateKeyImp*)(plKeyImp*)key;
|
||||||
UInt32 startPos = keyImp->GetStartPos();
|
UInt32 startPos = keyImp->GetStartPos();
|
||||||
UInt32 len = keyImp->GetDataLen();
|
UInt32 len = keyImp->GetDataLen();
|
||||||
|
|
||||||
oldPage->SetPosition(startPos);
|
oldPage->SetPosition(startPos);
|
||||||
if (len > fBuf.size())
|
if (len > fBuf.size())
|
||||||
fBuf.resize(len);
|
fBuf.resize(len);
|
||||||
oldPage->Read(len, &fBuf[0]);
|
oldPage->Read(len, &fBuf[0]);
|
||||||
|
|
||||||
UInt32 newStartPos = newPage->GetPosition();
|
UInt32 newStartPos = newPage->GetPosition();
|
||||||
|
|
||||||
// If we move any buffers, this page wasn't optimized already
|
// If we move any buffers, this page wasn't optimized already
|
||||||
if (newStartPos != startPos)
|
if (newStartPos != startPos)
|
||||||
fOptimized = false;
|
fOptimized = false;
|
||||||
|
|
||||||
keyImp->SetStartPos(newStartPos);
|
keyImp->SetStartPos(newStartPos);
|
||||||
newPage->Write(len, &fBuf[0]);
|
newPage->Write(len, &fBuf[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPageOptimizer::IRewritePage()
|
void plPageOptimizer::IRewritePage()
|
||||||
{
|
{
|
||||||
hsUNIXStream newPage;
|
hsUNIXStream newPage;
|
||||||
|
|
||||||
if (newPage.Open(fTempPagePath, "wb"))
|
if (newPage.Open(fTempPagePath, "wb"))
|
||||||
{
|
{
|
||||||
hsUNIXStream oldPage;
|
hsUNIXStream oldPage;
|
||||||
oldPage.Open(fPagePath);
|
oldPage.Open(fPagePath);
|
||||||
|
|
||||||
const plPageInfo& pageInfo = fPageNode->GetPageInfo();
|
const plPageInfo& pageInfo = fPageNode->GetPageInfo();
|
||||||
|
|
||||||
UInt32 dataStart = pageInfo.GetDataStart();
|
UInt32 dataStart = pageInfo.GetDataStart();
|
||||||
|
|
||||||
fBuf.resize(dataStart);
|
fBuf.resize(dataStart);
|
||||||
|
|
||||||
oldPage.Read(dataStart, &fBuf[0]);
|
oldPage.Read(dataStart, &fBuf[0]);
|
||||||
newPage.Write(dataStart, &fBuf[0]);
|
newPage.Write(dataStart, &fBuf[0]);
|
||||||
|
|
||||||
int size = (int)fKeyLoadOrder.size();
|
int size = (int)fKeyLoadOrder.size();
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
IWriteKeyData(&oldPage, &newPage, fKeyLoadOrder[i]);
|
IWriteKeyData(&oldPage, &newPage, fKeyLoadOrder[i]);
|
||||||
|
|
||||||
// If there are any objects that we didn't write (because they didn't load for
|
// If there are any objects that we didn't write (because they didn't load for
|
||||||
// some reason), put them at the end
|
// some reason), put them at the end
|
||||||
for (int i = 0; i < fAllKeys.size(); i++)
|
for (int i = 0; i < fAllKeys.size(); i++)
|
||||||
{
|
{
|
||||||
hsBool found = (fLoadedKeys.find(fAllKeys[i]) != fLoadedKeys.end());
|
hsBool found = (fLoadedKeys.find(fAllKeys[i]) != fLoadedKeys.end());
|
||||||
if (!found)
|
if (!found)
|
||||||
IWriteKeyData(&oldPage, &newPage, fAllKeys[i]);
|
IWriteKeyData(&oldPage, &newPage, fAllKeys[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
UInt32 newKeyStart = newPage.GetPosition();
|
UInt32 newKeyStart = newPage.GetPosition();
|
||||||
UInt32 oldKeyStart = pageInfo.GetIndexStart();
|
UInt32 oldKeyStart = pageInfo.GetIndexStart();
|
||||||
oldPage.SetPosition(oldKeyStart);
|
oldPage.SetPosition(oldKeyStart);
|
||||||
|
|
||||||
UInt32 numTypes = oldPage.ReadSwap32();
|
UInt32 numTypes = oldPage.ReadSwap32();
|
||||||
newPage.WriteSwap32(numTypes);
|
newPage.WriteSwap32(numTypes);
|
||||||
|
|
||||||
for (UInt32 i = 0; i < numTypes; i++)
|
for (UInt32 i = 0; i < numTypes; i++)
|
||||||
{
|
{
|
||||||
UInt16 classType = oldPage.ReadSwap16();
|
UInt16 classType = oldPage.ReadSwap16();
|
||||||
UInt32 len = oldPage.ReadSwap32();
|
UInt32 len = oldPage.ReadSwap32();
|
||||||
UInt8 flags = oldPage.ReadByte();
|
UInt8 flags = oldPage.ReadByte();
|
||||||
UInt32 numKeys = oldPage.ReadSwap32();
|
UInt32 numKeys = oldPage.ReadSwap32();
|
||||||
|
|
||||||
newPage.WriteSwap16(classType);
|
newPage.WriteSwap16(classType);
|
||||||
newPage.WriteSwap32(len);
|
newPage.WriteSwap32(len);
|
||||||
newPage.WriteByte(flags);
|
newPage.WriteByte(flags);
|
||||||
newPage.WriteSwap32(numKeys);
|
newPage.WriteSwap32(numKeys);
|
||||||
|
|
||||||
for (UInt32 j = 0; j < numKeys; j++)
|
for (UInt32 j = 0; j < numKeys; j++)
|
||||||
{
|
{
|
||||||
plUoid uoid;
|
plUoid uoid;
|
||||||
uoid.Read(&oldPage);
|
uoid.Read(&oldPage);
|
||||||
UInt32 startPos = oldPage.ReadSwap32();
|
UInt32 startPos = oldPage.ReadSwap32();
|
||||||
UInt32 dataLen = oldPage.ReadSwap32();
|
UInt32 dataLen = oldPage.ReadSwap32();
|
||||||
|
|
||||||
// Get the new start pos
|
// Get the new start pos
|
||||||
plKeyImp* key = (plKeyImp*)fResMgr->FindKey(uoid);
|
plKeyImp* key = (plKeyImp*)fResMgr->FindKey(uoid);
|
||||||
startPos = key->GetStartPos();
|
startPos = key->GetStartPos();
|
||||||
|
|
||||||
uoid.Write(&newPage);
|
uoid.Write(&newPage);
|
||||||
newPage.WriteSwap32(startPos);
|
newPage.WriteSwap32(startPos);
|
||||||
newPage.WriteSwap32(dataLen);
|
newPage.WriteSwap32(dataLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newPage.Close();
|
newPage.Close();
|
||||||
oldPage.Close();
|
oldPage.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,70 +1,70 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plPageOptimizer_h_inc
|
#ifndef plPageOptimizer_h_inc
|
||||||
#define plPageOptimizer_h_inc
|
#define plPageOptimizer_h_inc
|
||||||
|
|
||||||
#include "../pnKeyedObject/plKey.h"
|
#include "../pnKeyedObject/plKey.h"
|
||||||
#include "../pnKeyedObject/plUoid.h"
|
#include "../pnKeyedObject/plUoid.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
class plRegistryPageNode;
|
class plRegistryPageNode;
|
||||||
class plResManager;
|
class plResManager;
|
||||||
|
|
||||||
class plPageOptimizer
|
class plPageOptimizer
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
typedef std::vector<plKey> KeyVec;
|
typedef std::vector<plKey> KeyVec;
|
||||||
typedef std::set<plKey> KeySet;
|
typedef std::set<plKey> KeySet;
|
||||||
|
|
||||||
KeyVec fKeyLoadOrder; // The order objects were loaded in
|
KeyVec fKeyLoadOrder; // The order objects were loaded in
|
||||||
KeySet fLoadedKeys; // Keys we've loaded objects for, for quick lookup
|
KeySet fLoadedKeys; // Keys we've loaded objects for, for quick lookup
|
||||||
KeyVec fAllKeys; // All the keys in the page
|
KeyVec fAllKeys; // All the keys in the page
|
||||||
std::vector<UInt8> fBuf;
|
std::vector<UInt8> fBuf;
|
||||||
|
|
||||||
bool fOptimized; // True after optimization if the page was already optimized
|
bool fOptimized; // True after optimization if the page was already optimized
|
||||||
|
|
||||||
const char* fPagePath; // Path to our page
|
const char* fPagePath; // Path to our page
|
||||||
char fTempPagePath[512]; // Path to the temp output page
|
char fTempPagePath[512]; // Path to the temp output page
|
||||||
plLocation fLoc; // Location of our page
|
plLocation fLoc; // Location of our page
|
||||||
plRegistryPageNode* fPageNode; // PageNode for our page
|
plRegistryPageNode* fPageNode; // PageNode for our page
|
||||||
|
|
||||||
plResManager* fResMgr;
|
plResManager* fResMgr;
|
||||||
|
|
||||||
static plPageOptimizer* fInstance;
|
static plPageOptimizer* fInstance;
|
||||||
static void KeyedObjectProc(plKey key);
|
static void KeyedObjectProc(plKey key);
|
||||||
|
|
||||||
void IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key);
|
void IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key);
|
||||||
void IFindLoc();
|
void IFindLoc();
|
||||||
void IRewritePage();
|
void IRewritePage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plPageOptimizer(const char* pagePath);
|
plPageOptimizer(const char* pagePath);
|
||||||
|
|
||||||
void Optimize();
|
void Optimize();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // plPageOptimizer_h_inc
|
#endif // plPageOptimizer_h_inc
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@ -1,47 +1,47 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plPlasmaInstaller.h"
|
#include "plPlasmaInstaller.h"
|
||||||
#include "jvCoreUtil.h"
|
#include "jvCoreUtil.h"
|
||||||
|
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
jvCoreUtil::SetHInstance(hInstance);
|
jvCoreUtil::SetHInstance(hInstance);
|
||||||
plPlasmaInstaller installer;
|
plPlasmaInstaller installer;
|
||||||
installer.Create();
|
installer.Create();
|
||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (GetMessage(&msg, NULL, 0, 0))
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
{
|
{
|
||||||
if (!IsDialogMessage(installer.GetHWnd(), &msg))
|
if (!IsDialogMessage(installer.GetHWnd(), &msg))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return msg.wParam;
|
return msg.wParam;
|
||||||
}
|
}
|
||||||
|
@ -1,97 +1,97 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plInstallerReg.h"
|
#include "plInstallerReg.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
static HKEY GetInstallerKey()
|
static HKEY GetInstallerKey()
|
||||||
{
|
{
|
||||||
HKEY hSoftKey = NULL;
|
HKEY hSoftKey = NULL;
|
||||||
HKEY hCompanyKey = NULL;
|
HKEY hCompanyKey = NULL;
|
||||||
HKEY hAppKey = NULL;
|
HKEY hAppKey = NULL;
|
||||||
|
|
||||||
if(RegOpenKeyEx(HKEY_CURRENT_USER, "software", 0, KEY_WRITE|KEY_READ,
|
if(RegOpenKeyEx(HKEY_CURRENT_USER, "software", 0, KEY_WRITE|KEY_READ,
|
||||||
&hSoftKey) == ERROR_SUCCESS)
|
&hSoftKey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DWORD dw;
|
DWORD dw;
|
||||||
if(RegCreateKeyEx(hSoftKey, "Cyan", 0, REG_NONE,
|
if(RegCreateKeyEx(hSoftKey, "Cyan", 0, REG_NONE,
|
||||||
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
||||||
&hCompanyKey, &dw) == ERROR_SUCCESS)
|
&hCompanyKey, &dw) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
RegCreateKeyEx(hCompanyKey, "PlasmaInstaller", 0, REG_NONE,
|
RegCreateKeyEx(hCompanyKey, "PlasmaInstaller", 0, REG_NONE,
|
||||||
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
||||||
&hAppKey, &dw);
|
&hAppKey, &dw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hSoftKey != NULL)
|
if (hSoftKey != NULL)
|
||||||
RegCloseKey(hSoftKey);
|
RegCloseKey(hSoftKey);
|
||||||
if (hCompanyKey != NULL)
|
if (hCompanyKey != NULL)
|
||||||
RegCloseKey(hCompanyKey);
|
RegCloseKey(hCompanyKey);
|
||||||
|
|
||||||
return hAppKey;
|
return hAppKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteRegString(const char* valueName, const char* value)
|
static void WriteRegString(const char* valueName, const char* value)
|
||||||
{
|
{
|
||||||
HKEY installKey = GetInstallerKey();
|
HKEY installKey = GetInstallerKey();
|
||||||
RegSetValueEx(installKey, valueName, 0, REG_SZ, (const BYTE*)value, strlen(value)+1);
|
RegSetValueEx(installKey, valueName, 0, REG_SZ, (const BYTE*)value, strlen(value)+1);
|
||||||
RegCloseKey(installKey);
|
RegCloseKey(installKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadRegString(const char* valueName, char* value, DWORD size)
|
static bool ReadRegString(const char* valueName, char* value, DWORD size)
|
||||||
{
|
{
|
||||||
HKEY installKey = GetInstallerKey();
|
HKEY installKey = GetInstallerKey();
|
||||||
bool ret = (RegQueryValueEx(installKey, valueName, NULL, NULL, (LPBYTE)value, &size) == ERROR_SUCCESS);
|
bool ret = (RegQueryValueEx(installKey, valueName, NULL, NULL, (LPBYTE)value, &size) == ERROR_SUCCESS);
|
||||||
RegCloseKey(installKey);
|
RegCloseKey(installKey);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plInstallerReg::SetClientDir(const char* dir)
|
void plInstallerReg::SetClientDir(const char* dir)
|
||||||
{
|
{
|
||||||
WriteRegString("Client", dir);
|
WriteRegString("Client", dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plInstallerReg::SetMaxDir(const char* dir)
|
void plInstallerReg::SetMaxDir(const char* dir)
|
||||||
{
|
{
|
||||||
WriteRegString("3dsmax", dir);
|
WriteRegString("3dsmax", dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* plInstallerReg::GetClientDir()
|
const char* plInstallerReg::GetClientDir()
|
||||||
{
|
{
|
||||||
static char dir[MAX_PATH];
|
static char dir[MAX_PATH];
|
||||||
if (!ReadRegString("Client", dir, sizeof(dir)))
|
if (!ReadRegString("Client", dir, sizeof(dir)))
|
||||||
strcpy(dir, "C:\\PlasmaClient");
|
strcpy(dir, "C:\\PlasmaClient");
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* plInstallerReg::GetMaxDir()
|
const char* plInstallerReg::GetMaxDir()
|
||||||
{
|
{
|
||||||
static char dir[MAX_PATH];
|
static char dir[MAX_PATH];
|
||||||
dir[0] = '\0';
|
dir[0] = '\0';
|
||||||
ReadRegString("3dsmax", dir, sizeof(dir));
|
ReadRegString("3dsmax", dir, sizeof(dir));
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
|
|
||||||
namespace plInstallerReg
|
namespace plInstallerReg
|
||||||
{
|
{
|
||||||
void SetClientDir(const char* dir);
|
void SetClientDir(const char* dir);
|
||||||
void SetMaxDir(const char* dir);
|
void SetMaxDir(const char* dir);
|
||||||
|
|
||||||
const char* GetClientDir();
|
const char* GetClientDir();
|
||||||
const char* GetMaxDir();
|
const char* GetMaxDir();
|
||||||
}
|
}
|
@ -1,392 +1,392 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plPlasmaInstaller.h"
|
#include "plPlasmaInstaller.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
|
|
||||||
#include "../plFile/hsFiles.h"
|
#include "../plFile/hsFiles.h"
|
||||||
#include "plUnzip.h"
|
#include "plUnzip.h"
|
||||||
#include "plInstallerReg.h"
|
#include "plInstallerReg.h"
|
||||||
#include "../plFile/plBrowseFolder.h"
|
#include "../plFile/plBrowseFolder.h"
|
||||||
#include "plSetPlasmaPath.h"
|
#include "plSetPlasmaPath.h"
|
||||||
|
|
||||||
plPlasmaInstaller::plPlasmaInstaller()
|
plPlasmaInstaller::plPlasmaInstaller()
|
||||||
{
|
{
|
||||||
fDailyDir[0] = '\0';
|
fDailyDir[0] = '\0';
|
||||||
fDidGet = false;
|
fDidGet = false;
|
||||||
fStatusList = nil;
|
fStatusList = nil;
|
||||||
|
|
||||||
INITCOMMONCONTROLSEX icc = {0};
|
INITCOMMONCONTROLSEX icc = {0};
|
||||||
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||||
icc.dwICC = ICC_DATE_CLASSES;
|
icc.dwICC = ICC_DATE_CLASSES;
|
||||||
InitCommonControlsEx(&icc);
|
InitCommonControlsEx(&icc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::Create()
|
void plPlasmaInstaller::Create()
|
||||||
{
|
{
|
||||||
ICreateDialog(IDD_INSTALLER, NULL);
|
ICreateDialog(IDD_INSTALLER, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* kAllClientExes = "AllClientExes.zip";
|
static const char* kAllClientExes = "AllClientExes.zip";
|
||||||
static const char* kAllDllsRelease = "AllDllsRelease.zip";
|
static const char* kAllDllsRelease = "AllDllsRelease.zip";
|
||||||
static const char* kScripts = "Scripts.zip";
|
static const char* kScripts = "Scripts.zip";
|
||||||
static const char* kTools = "AllToolsRelease.zip";
|
static const char* kTools = "AllToolsRelease.zip";
|
||||||
|
|
||||||
bool FileExists(const char* path, const char* filename)
|
bool FileExists(const char* path, const char* filename)
|
||||||
{
|
{
|
||||||
char fullpath[MAX_PATH];
|
char fullpath[MAX_PATH];
|
||||||
sprintf(fullpath, "%s%s", path, filename);
|
sprintf(fullpath, "%s%s", path, filename);
|
||||||
HANDLE hFile = CreateFile(fullpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
HANDLE hFile = CreateFile(fullpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if (hFile != INVALID_HANDLE_VALUE)
|
if (hFile != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plPlasmaInstaller::IGetDailyDir()
|
bool plPlasmaInstaller::IGetDailyDir()
|
||||||
{
|
{
|
||||||
// Get the branch
|
// Get the branch
|
||||||
HWND hBuild = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
HWND hBuild = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||||
int idx = ComboBox_GetCurSel(hBuild);
|
int idx = ComboBox_GetCurSel(hBuild);
|
||||||
int buildServer = ComboBox_GetItemData(hBuild, idx);
|
int buildServer = ComboBox_GetItemData(hBuild, idx);
|
||||||
|
|
||||||
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
||||||
idx = ComboBox_GetCurSel(hTime);
|
idx = ComboBox_GetCurSel(hTime);
|
||||||
int time = ComboBox_GetItemData(hTime, idx);
|
int time = ComboBox_GetItemData(hTime, idx);
|
||||||
|
|
||||||
// Get the build date
|
// Get the build date
|
||||||
SYSTEMTIME date;
|
SYSTEMTIME date;
|
||||||
DateTime_GetSystemtime(GetDlgItem(fDlg, IDC_BRANCH_DATE), &date);
|
DateTime_GetSystemtime(GetDlgItem(fDlg, IDC_BRANCH_DATE), &date);
|
||||||
char dateStr[] = "xx-xx-xxxx";
|
char dateStr[] = "xx-xx-xxxx";
|
||||||
sprintf(dateStr, "%02d-%02d-%04d", date.wMonth, date.wDay, date.wYear);
|
sprintf(dateStr, "%02d-%02d-%04d", date.wMonth, date.wDay, date.wYear);
|
||||||
|
|
||||||
fDailyDir[0] = '\0';
|
fDailyDir[0] = '\0';
|
||||||
|
|
||||||
IAddStatusLine("Searching for %s build...", dateStr);
|
IAddStatusLine("Searching for %s build...", dateStr);
|
||||||
|
|
||||||
|
|
||||||
char buildDir[MAX_PATH];
|
char buildDir[MAX_PATH];
|
||||||
|
|
||||||
static const char* kMainBuild = "\\\\Plasmabuild\\Output\\";
|
static const char* kMainBuild = "\\\\Plasmabuild\\Output\\";
|
||||||
static const char* kBranchBuild = "\\\\Branchbuild\\Output\\";
|
static const char* kBranchBuild = "\\\\Branchbuild\\Output\\";
|
||||||
static const char* kActiveBuild = "\\\\Activebuild\\Output\\";
|
static const char* kActiveBuild = "\\\\Activebuild\\Output\\";
|
||||||
static const char* kInternalMain = "Main-Internal\\";
|
static const char* kInternalMain = "Main-Internal\\";
|
||||||
static const char* kInternalBranch = "Branch-Internal\\";
|
static const char* kInternalBranch = "Branch-Internal\\";
|
||||||
static const char* kInternalActive = "Active-Internal\\";
|
static const char* kInternalActive = "Active-Internal\\";
|
||||||
|
|
||||||
switch (buildServer)
|
switch (buildServer)
|
||||||
{
|
{
|
||||||
case kBuildMain: strcpy(buildDir, kMainBuild); break;
|
case kBuildMain: strcpy(buildDir, kMainBuild); break;
|
||||||
case kBuildBranch: strcpy(buildDir, kBranchBuild); break;
|
case kBuildBranch: strcpy(buildDir, kBranchBuild); break;
|
||||||
case kBuildActive: strcpy(buildDir, kActiveBuild); break;
|
case kBuildActive: strcpy(buildDir, kActiveBuild); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (time)
|
switch (time)
|
||||||
{
|
{
|
||||||
case kNightly:
|
case kNightly:
|
||||||
strcat(buildDir, "Nightly\\");
|
strcat(buildDir, "Nightly\\");
|
||||||
break;
|
break;
|
||||||
case kAfternoon:
|
case kAfternoon:
|
||||||
strcat(buildDir, "Afternoon\\");
|
strcat(buildDir, "Afternoon\\");
|
||||||
break;
|
break;
|
||||||
case kEvening:
|
case kEvening:
|
||||||
strcat(buildDir, "Evening\\");
|
strcat(buildDir, "Evening\\");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(buildDir, dateStr);
|
strcat(buildDir, dateStr);
|
||||||
strcat(buildDir, "\\");
|
strcat(buildDir, "\\");
|
||||||
|
|
||||||
switch (buildServer)
|
switch (buildServer)
|
||||||
{
|
{
|
||||||
case kBuildMain: strcat(buildDir, kInternalMain); break;
|
case kBuildMain: strcat(buildDir, kInternalMain); break;
|
||||||
case kBuildBranch: strcat(buildDir, kInternalBranch); break;
|
case kBuildBranch: strcat(buildDir, kInternalBranch); break;
|
||||||
case kBuildActive: strcat(buildDir, kInternalActive); break;
|
case kBuildActive: strcat(buildDir, kInternalActive); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FileExists(buildDir, kAllClientExes) && FileExists(buildDir, kAllDllsRelease) && FileExists(buildDir, kScripts))
|
if (FileExists(buildDir, kAllClientExes) && FileExists(buildDir, kAllDllsRelease) && FileExists(buildDir, kScripts))
|
||||||
{
|
{
|
||||||
strcpy(fDailyDir, buildDir);
|
strcpy(fDailyDir, buildDir);
|
||||||
|
|
||||||
const char* serverName = nil;
|
const char* serverName = nil;
|
||||||
switch (buildServer)
|
switch (buildServer)
|
||||||
{
|
{
|
||||||
case kBuildMain: serverName = "Main"; break;
|
case kBuildMain: serverName = "Main"; break;
|
||||||
case kBuildBranch: serverName = "Branch"; break;
|
case kBuildBranch: serverName = "Branch"; break;
|
||||||
case kBuildActive: serverName = "Active"; break;
|
case kBuildActive: serverName = "Active"; break;
|
||||||
}
|
}
|
||||||
IAddStatusLine("Found %s at %s", serverName, fDailyDir);
|
IAddStatusLine("Found %s at %s", serverName, fDailyDir);
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), TRUE);
|
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), TRUE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IAddStatusLine("Couldn't find build");
|
IAddStatusLine("Couldn't find build");
|
||||||
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), FALSE);
|
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), FALSE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::IInit()
|
void plPlasmaInstaller::IInit()
|
||||||
{
|
{
|
||||||
const char* clientDir = plInstallerReg::GetClientDir();
|
const char* clientDir = plInstallerReg::GetClientDir();
|
||||||
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, clientDir);
|
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, clientDir);
|
||||||
|
|
||||||
const char* maxDir = plInstallerReg::GetMaxDir();
|
const char* maxDir = plInstallerReg::GetMaxDir();
|
||||||
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, maxDir);
|
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, maxDir);
|
||||||
|
|
||||||
fStatusList = GetDlgItem(fDlg, IDC_STATUS_LIST);
|
fStatusList = GetDlgItem(fDlg, IDC_STATUS_LIST);
|
||||||
|
|
||||||
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||||
int idx = ComboBox_AddString(hCombo, "Main");
|
int idx = ComboBox_AddString(hCombo, "Main");
|
||||||
ComboBox_SetItemData(hCombo, idx, kBuildMain);
|
ComboBox_SetItemData(hCombo, idx, kBuildMain);
|
||||||
ComboBox_SetCurSel(hCombo, idx);
|
ComboBox_SetCurSel(hCombo, idx);
|
||||||
idx = ComboBox_AddString(hCombo, "Branch");
|
idx = ComboBox_AddString(hCombo, "Branch");
|
||||||
ComboBox_SetItemData(hCombo, idx, kBuildBranch);
|
ComboBox_SetItemData(hCombo, idx, kBuildBranch);
|
||||||
idx = ComboBox_AddString(hCombo, "Active");
|
idx = ComboBox_AddString(hCombo, "Active");
|
||||||
ComboBox_SetItemData(hCombo, idx, kBuildActive);
|
ComboBox_SetItemData(hCombo, idx, kBuildActive);
|
||||||
|
|
||||||
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
||||||
idx = ComboBox_AddString(hTime, "Nightly");
|
idx = ComboBox_AddString(hTime, "Nightly");
|
||||||
ComboBox_SetItemData(hTime, idx, kNightly);
|
ComboBox_SetItemData(hTime, idx, kNightly);
|
||||||
ComboBox_SetCurSel(hTime, idx);
|
ComboBox_SetCurSel(hTime, idx);
|
||||||
idx = ComboBox_AddString(hTime, "Afternoon");
|
idx = ComboBox_AddString(hTime, "Afternoon");
|
||||||
ComboBox_SetItemData(hTime, idx, kAfternoon);
|
ComboBox_SetItemData(hTime, idx, kAfternoon);
|
||||||
idx = ComboBox_AddString(hTime, "Evening");
|
idx = ComboBox_AddString(hTime, "Evening");
|
||||||
ComboBox_SetItemData(hTime, idx, kEvening);
|
ComboBox_SetItemData(hTime, idx, kEvening);
|
||||||
|
|
||||||
CheckDlgButton(fDlg, IDC_CLIENT_CHECK, BST_CHECKED);
|
CheckDlgButton(fDlg, IDC_CLIENT_CHECK, BST_CHECKED);
|
||||||
CheckDlgButton(fDlg, IDC_SCRIPTS_CHECK, BST_CHECKED);
|
CheckDlgButton(fDlg, IDC_SCRIPTS_CHECK, BST_CHECKED);
|
||||||
CheckDlgButton(fDlg, IDC_PLUGINS_CHECK, BST_CHECKED);
|
CheckDlgButton(fDlg, IDC_PLUGINS_CHECK, BST_CHECKED);
|
||||||
|
|
||||||
ShowWindow(fDlg, SW_SHOW);
|
ShowWindow(fDlg, SW_SHOW);
|
||||||
|
|
||||||
IGetDailyDir();
|
IGetDailyDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL plPlasmaInstaller::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
BOOL plPlasmaInstaller::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
IInit();
|
IInit();
|
||||||
SetFocus(GetDlgItem(fDlg, IDC_GET_BUTTON));
|
SetFocus(GetDlgItem(fDlg, IDC_GET_BUTTON));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
DestroyWindow(hDlg);
|
DestroyWindow(hDlg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (HIWORD(wParam) == BN_CLICKED)
|
if (HIWORD(wParam) == BN_CLICKED)
|
||||||
{
|
{
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case IDC_BROWSE_3DSMAX:
|
case IDC_BROWSE_3DSMAX:
|
||||||
case IDC_BROWSE_CLIENT:
|
case IDC_BROWSE_CLIENT:
|
||||||
IGetFolder(LOWORD(wParam) == IDC_BROWSE_CLIENT);
|
IGetFolder(LOWORD(wParam) == IDC_BROWSE_CLIENT);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case IDC_GET_BUTTON:
|
case IDC_GET_BUTTON:
|
||||||
if (fDidGet)
|
if (fDidGet)
|
||||||
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
||||||
else
|
else
|
||||||
IGet();
|
IGet();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (HIWORD(wParam) == CBN_SELCHANGE && (LOWORD(wParam) == IDC_TIME_COMBO || LOWORD(wParam) == IDC_BUILD_COMBO))
|
else if (HIWORD(wParam) == CBN_SELCHANGE && (LOWORD(wParam) == IDC_TIME_COMBO || LOWORD(wParam) == IDC_BUILD_COMBO))
|
||||||
{
|
{
|
||||||
IGetDailyDir();
|
IGetDailyDir();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
{
|
{
|
||||||
NMHDR* nmhdr = (NMHDR*)lParam;
|
NMHDR* nmhdr = (NMHDR*)lParam;
|
||||||
if (nmhdr->idFrom == IDC_BRANCH_DATE && nmhdr->code == DTN_CLOSEUP/*DTN_DATETIMECHANGE*/)
|
if (nmhdr->idFrom == IDC_BRANCH_DATE && nmhdr->code == DTN_CLOSEUP/*DTN_DATETIMECHANGE*/)
|
||||||
{
|
{
|
||||||
IGetDailyDir();
|
IGetDailyDir();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::IExtractZip(const char* filename, const char* dest)
|
void plPlasmaInstaller::IExtractZip(const char* filename, const char* dest)
|
||||||
{
|
{
|
||||||
plUnzip unzip;
|
plUnzip unzip;
|
||||||
if (unzip.Open(filename))
|
if (unzip.Open(filename))
|
||||||
{
|
{
|
||||||
IAddStatusLine("Extracting %s...", filename);
|
IAddStatusLine("Extracting %s...", filename);
|
||||||
|
|
||||||
char buf[MAX_PATH];
|
char buf[MAX_PATH];
|
||||||
while (unzip.ExtractNext(dest, buf))
|
while (unzip.ExtractNext(dest, buf))
|
||||||
IAddStatusLine(" %s", buf);
|
IAddStatusLine(" %s", buf);
|
||||||
IAddStatusLine(" %s", buf);
|
IAddStatusLine(" %s", buf);
|
||||||
|
|
||||||
unzip.Close();
|
unzip.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::IGet()
|
void plPlasmaInstaller::IGet()
|
||||||
{
|
{
|
||||||
bool getClient = (IsDlgButtonChecked(fDlg, IDC_CLIENT_CHECK) == BST_CHECKED);
|
bool getClient = (IsDlgButtonChecked(fDlg, IDC_CLIENT_CHECK) == BST_CHECKED);
|
||||||
bool getScripts = (IsDlgButtonChecked(fDlg, IDC_SCRIPTS_CHECK) == BST_CHECKED);
|
bool getScripts = (IsDlgButtonChecked(fDlg, IDC_SCRIPTS_CHECK) == BST_CHECKED);
|
||||||
bool getPlugins = (IsDlgButtonChecked(fDlg, IDC_PLUGINS_CHECK) == BST_CHECKED);
|
bool getPlugins = (IsDlgButtonChecked(fDlg, IDC_PLUGINS_CHECK) == BST_CHECKED);
|
||||||
bool getTools = (IsDlgButtonChecked(fDlg, IDC_TOOLS_CHECK) == BST_CHECKED);
|
bool getTools = (IsDlgButtonChecked(fDlg, IDC_TOOLS_CHECK) == BST_CHECKED);
|
||||||
|
|
||||||
const char* clientDir = plInstallerReg::GetClientDir();
|
const char* clientDir = plInstallerReg::GetClientDir();
|
||||||
if (*clientDir == '\0' && (getClient || getScripts))
|
if (*clientDir == '\0' && (getClient || getScripts))
|
||||||
{
|
{
|
||||||
MessageBox(fDlg, "You need to set your client directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
MessageBox(fDlg, "You need to set your client directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* maxDir = plInstallerReg::GetMaxDir();
|
const char* maxDir = plInstallerReg::GetMaxDir();
|
||||||
if (*maxDir == '\0' && getPlugins)
|
if (*maxDir == '\0' && getPlugins)
|
||||||
{
|
{
|
||||||
MessageBox(fDlg, "You need to set your 3dsmax directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
MessageBox(fDlg, "You need to set your 3dsmax directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND hGetButton = GetDlgItem(fDlg, IDC_GET_BUTTON);
|
HWND hGetButton = GetDlgItem(fDlg, IDC_GET_BUTTON);
|
||||||
EnableWindow(hGetButton, FALSE);
|
EnableWindow(hGetButton, FALSE);
|
||||||
HCURSOR hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
|
HCURSOR hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
|
||||||
|
|
||||||
char buf[MAX_PATH];
|
char buf[MAX_PATH];
|
||||||
|
|
||||||
if (getScripts)
|
if (getScripts)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%s%s", fDailyDir, kScripts);
|
sprintf(buf, "%s%s", fDailyDir, kScripts);
|
||||||
IExtractZip(buf, clientDir);
|
IExtractZip(buf, clientDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getClient)
|
if (getClient)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%s%s", fDailyDir, kAllClientExes);
|
sprintf(buf, "%s%s", fDailyDir, kAllClientExes);
|
||||||
IExtractZip(buf, clientDir);
|
IExtractZip(buf, clientDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPlugins)
|
if (getPlugins)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%s%s", fDailyDir, kAllDllsRelease);
|
sprintf(buf, "%s%s", fDailyDir, kAllDllsRelease);
|
||||||
char pluginDir[MAX_PATH];
|
char pluginDir[MAX_PATH];
|
||||||
sprintf(pluginDir, "%s\\plugins", maxDir);
|
sprintf(pluginDir, "%s\\plugins", maxDir);
|
||||||
IExtractZip(buf, pluginDir);
|
IExtractZip(buf, pluginDir);
|
||||||
|
|
||||||
IAddStatusLine("Updating PlasmaMAX2.ini...");
|
IAddStatusLine("Updating PlasmaMAX2.ini...");
|
||||||
sprintf(buf, "%s\\plugcfg\\PlasmaMAX2.ini", maxDir);
|
sprintf(buf, "%s\\plugcfg\\PlasmaMAX2.ini", maxDir);
|
||||||
WritePrivateProfileString("SceneViewer", "Directory", clientDir, buf);
|
WritePrivateProfileString("SceneViewer", "Directory", clientDir, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getTools)
|
if (getTools)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%s%s", fDailyDir, kTools);
|
sprintf(buf, "%s%s", fDailyDir, kTools);
|
||||||
|
|
||||||
char toolBuf[MAX_PATH];
|
char toolBuf[MAX_PATH];
|
||||||
sprintf(toolBuf, "%s\\Tools", clientDir);
|
sprintf(toolBuf, "%s\\Tools", clientDir);
|
||||||
IExtractZip(buf, toolBuf);
|
IExtractZip(buf, toolBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
IAddStatusLine("Updating path...");
|
IAddStatusLine("Updating path...");
|
||||||
SetPlasmaPath(clientDir);
|
SetPlasmaPath(clientDir);
|
||||||
|
|
||||||
IAddStatusLine("Done");
|
IAddStatusLine("Done");
|
||||||
|
|
||||||
SetCursor(hOldCursor);
|
SetCursor(hOldCursor);
|
||||||
|
|
||||||
fDidGet = true;
|
fDidGet = true;
|
||||||
SetWindowText(hGetButton, "Close");
|
SetWindowText(hGetButton, "Close");
|
||||||
EnableWindow(hGetButton, TRUE);
|
EnableWindow(hGetButton, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::IGetFolder(bool client)
|
void plPlasmaInstaller::IGetFolder(bool client)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
if (client)
|
if (client)
|
||||||
strcpy(path, plInstallerReg::GetClientDir());
|
strcpy(path, plInstallerReg::GetClientDir());
|
||||||
else
|
else
|
||||||
strcpy(path, plInstallerReg::GetMaxDir());
|
strcpy(path, plInstallerReg::GetMaxDir());
|
||||||
|
|
||||||
if (plBrowseFolder::GetFolder(path, path))
|
if (plBrowseFolder::GetFolder(path, path))
|
||||||
{
|
{
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, path);
|
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, path);
|
||||||
plInstallerReg::SetClientDir(path);
|
plInstallerReg::SetClientDir(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, path);
|
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, path);
|
||||||
plInstallerReg::SetMaxDir(path);
|
plInstallerReg::SetMaxDir(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaInstaller::IAddStatusLine(const char* format, ...)
|
void plPlasmaInstaller::IAddStatusLine(const char* format, ...)
|
||||||
{
|
{
|
||||||
if (!format || *format == '\0')
|
if (!format || *format == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
|
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
int numWritten = _vsnprintf(buf, sizeof(buf), format, args);
|
int numWritten = _vsnprintf(buf, sizeof(buf), format, args);
|
||||||
hsAssert(numWritten > 0, "Buffer too small");
|
hsAssert(numWritten > 0, "Buffer too small");
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
int idx = ListBox_AddString(fStatusList, buf);
|
int idx = ListBox_AddString(fStatusList, buf);
|
||||||
ListBox_SetCurSel(fStatusList, idx);
|
ListBox_SetCurSel(fStatusList, idx);
|
||||||
|
|
||||||
// Pump the message queue
|
// Pump the message queue
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
{
|
{
|
||||||
if (!IsDialogMessage(&msg))
|
if (!IsDialogMessage(&msg))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "jvBaseDlg.h"
|
#include "jvBaseDlg.h"
|
||||||
|
|
||||||
class plPlasmaInstaller : public jvBaseDlg
|
class plPlasmaInstaller : public jvBaseDlg
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
char fDailyDir[MAX_PATH];
|
char fDailyDir[MAX_PATH];
|
||||||
bool fDidGet;
|
bool fDidGet;
|
||||||
|
|
||||||
HWND fStatusList;
|
HWND fStatusList;
|
||||||
|
|
||||||
enum { kBuildMain, kBuildBranch, kBuildActive };
|
enum { kBuildMain, kBuildBranch, kBuildActive };
|
||||||
enum { kNightly, kAfternoon, kEvening };
|
enum { kNightly, kAfternoon, kEvening };
|
||||||
|
|
||||||
virtual BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
virtual BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
bool IGetDailyDir();
|
bool IGetDailyDir();
|
||||||
void IGetFolder(bool client);
|
void IGetFolder(bool client);
|
||||||
|
|
||||||
void IGet();
|
void IGet();
|
||||||
|
|
||||||
void IInit();
|
void IInit();
|
||||||
void IExtractZip(const char* filename, const char* dest);
|
void IExtractZip(const char* filename, const char* dest);
|
||||||
|
|
||||||
void IAddStatusLine(const char* format, ...);
|
void IAddStatusLine(const char* format, ...);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plPlasmaInstaller();
|
plPlasmaInstaller();
|
||||||
|
|
||||||
void Create();
|
void Create();
|
||||||
|
|
||||||
HWND GetHWnd() { return fDlg; }
|
HWND GetHWnd() { return fDlg; }
|
||||||
};
|
};
|
@ -1,129 +1,129 @@
|
|||||||
//Microsoft Developer Studio generated resource script.
|
//Microsoft Developer Studio generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include "afxres.h"
|
#include "afxres.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_INSTALLER DIALOG DISCARDABLE 0, 0, 241, 170
|
IDD_INSTALLER DIALOG DISCARDABLE 0, 0, 241, 170
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
|
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
|
||||||
WS_SYSMENU
|
WS_SYSMENU
|
||||||
CAPTION "Plasma Installer"
|
CAPTION "Plasma Installer"
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Build:",IDC_STATIC,7,8,18,8
|
LTEXT "Build:",IDC_STATIC,7,8,18,8
|
||||||
COMBOBOX IDC_TIME_COMBO,27,6,46,167,CBS_DROPDOWNLIST | WS_VSCROLL |
|
COMBOBOX IDC_TIME_COMBO,27,6,46,167,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
LTEXT "3dsmax Directory:",IDC_STATIC,7,26,57,8
|
LTEXT "3dsmax Directory:",IDC_STATIC,7,26,57,8
|
||||||
EDITTEXT IDC_3DSMAX_EDIT,7,36,173,12,ES_AUTOHSCROLL | ES_READONLY
|
EDITTEXT IDC_3DSMAX_EDIT,7,36,173,12,ES_AUTOHSCROLL | ES_READONLY
|
||||||
PUSHBUTTON "Browse...",IDC_BROWSE_3DSMAX,183,35,50,14
|
PUSHBUTTON "Browse...",IDC_BROWSE_3DSMAX,183,35,50,14
|
||||||
LTEXT "Client Directory:",IDC_STATIC,7,53,50,8
|
LTEXT "Client Directory:",IDC_STATIC,7,53,50,8
|
||||||
EDITTEXT IDC_CLIENT_EDIT,7,63,173,12,ES_AUTOHSCROLL | ES_READONLY
|
EDITTEXT IDC_CLIENT_EDIT,7,63,173,12,ES_AUTOHSCROLL | ES_READONLY
|
||||||
PUSHBUTTON "Browse...",IDC_BROWSE_CLIENT,183,62,50,14
|
PUSHBUTTON "Browse...",IDC_BROWSE_CLIENT,183,62,50,14
|
||||||
DEFPUSHBUTTON "Get",IDC_GET_BUTTON,93,146,56,16,WS_DISABLED
|
DEFPUSHBUTTON "Get",IDC_GET_BUTTON,93,146,56,16,WS_DISABLED
|
||||||
LISTBOX IDC_STATUS_LIST,7,85,226,54,LBS_NOSEL | WS_VSCROLL |
|
LISTBOX IDC_STATUS_LIST,7,85,226,54,LBS_NOSEL | WS_VSCROLL |
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
CONTROL "DateTimePicker1",IDC_BRANCH_DATE,"SysDateTimePick32",
|
CONTROL "DateTimePicker1",IDC_BRANCH_DATE,"SysDateTimePick32",
|
||||||
DTS_RIGHTALIGN | WS_TABSTOP,125,6,55,12
|
DTS_RIGHTALIGN | WS_TABSTOP,125,6,55,12
|
||||||
COMBOBOX IDC_BUILD_COMBO,76,6,46,167,CBS_DROPDOWNLIST |
|
COMBOBOX IDC_BUILD_COMBO,76,6,46,167,CBS_DROPDOWNLIST |
|
||||||
WS_VSCROLL | WS_TABSTOP
|
WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "Client",IDC_CLIENT_CHECK,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Client",IDC_CLIENT_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,159,144,33,10
|
WS_TABSTOP,159,144,33,10
|
||||||
CONTROL "Scripts",IDC_SCRIPTS_CHECK,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Scripts",IDC_SCRIPTS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,159,154,37,10
|
WS_TABSTOP,159,154,37,10
|
||||||
CONTROL "Plugins",IDC_PLUGINS_CHECK,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Plugins",IDC_PLUGINS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,197,144,39,10
|
WS_TABSTOP,197,144,39,10
|
||||||
CONTROL "Tools",IDC_TOOLS_CHECK,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Tools",IDC_TOOLS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,197,154,33,10
|
WS_TABSTOP,197,154,33,10
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DESIGNINFO
|
// DESIGNINFO
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO DISCARDABLE
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_INSTALLER, DIALOG
|
IDD_INSTALLER, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 234
|
RIGHTMARGIN, 234
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 163
|
BOTTOMMARGIN, 163
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE DISCARDABLE
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE DISCARDABLE
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""afxres.h""\r\n"
|
"#include ""afxres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE DISCARDABLE
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
//
|
//
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON1 ICON DISCARDABLE "Dirt.ICO"
|
IDI_ICON1 ICON DISCARDABLE "Dirt.ICO"
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -1,104 +1,104 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
static HKEY GetEnvironKey()
|
static HKEY GetEnvironKey()
|
||||||
{
|
{
|
||||||
HKEY hSystemKey = NULL;
|
HKEY hSystemKey = NULL;
|
||||||
HKEY hControlSetKey = NULL;
|
HKEY hControlSetKey = NULL;
|
||||||
HKEY hControlKey = NULL;
|
HKEY hControlKey = NULL;
|
||||||
HKEY hSessionKey = NULL;
|
HKEY hSessionKey = NULL;
|
||||||
HKEY hEnvironKey = NULL;
|
HKEY hEnvironKey = NULL;
|
||||||
|
|
||||||
if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM", 0, KEY_READ, &hSystemKey) == ERROR_SUCCESS) &&
|
if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM", 0, KEY_READ, &hSystemKey) == ERROR_SUCCESS) &&
|
||||||
(RegOpenKeyEx(hSystemKey, "CurrentControlSet", 0, KEY_READ, &hControlSetKey) == ERROR_SUCCESS) &&
|
(RegOpenKeyEx(hSystemKey, "CurrentControlSet", 0, KEY_READ, &hControlSetKey) == ERROR_SUCCESS) &&
|
||||||
(RegOpenKeyEx(hControlSetKey, "Control", 0, KEY_READ, &hControlKey) == ERROR_SUCCESS) &&
|
(RegOpenKeyEx(hControlSetKey, "Control", 0, KEY_READ, &hControlKey) == ERROR_SUCCESS) &&
|
||||||
(RegOpenKeyEx(hControlKey, "Session Manager", 0, KEY_READ, &hSessionKey) == ERROR_SUCCESS))
|
(RegOpenKeyEx(hControlKey, "Session Manager", 0, KEY_READ, &hSessionKey) == ERROR_SUCCESS))
|
||||||
{
|
{
|
||||||
RegOpenKeyEx(hSessionKey, "Environment", 0, KEY_READ | KEY_WRITE, &hEnvironKey);
|
RegOpenKeyEx(hSessionKey, "Environment", 0, KEY_READ | KEY_WRITE, &hEnvironKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hSystemKey != NULL)
|
if (hSystemKey != NULL)
|
||||||
RegCloseKey(hSystemKey);
|
RegCloseKey(hSystemKey);
|
||||||
if (hControlSetKey != NULL)
|
if (hControlSetKey != NULL)
|
||||||
RegCloseKey(hControlSetKey);
|
RegCloseKey(hControlSetKey);
|
||||||
if (hControlKey != NULL)
|
if (hControlKey != NULL)
|
||||||
RegCloseKey(hControlKey);
|
RegCloseKey(hControlKey);
|
||||||
if (hSessionKey != NULL)
|
if (hSessionKey != NULL)
|
||||||
RegCloseKey(hSessionKey);
|
RegCloseKey(hSessionKey);
|
||||||
|
|
||||||
return hEnvironKey;
|
return hEnvironKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetPlasmaPath(const char* plasmaPath)
|
void SetPlasmaPath(const char* plasmaPath)
|
||||||
{
|
{
|
||||||
bool pathSet = false;
|
bool pathSet = false;
|
||||||
|
|
||||||
HKEY hEnvironKey = GetEnvironKey();
|
HKEY hEnvironKey = GetEnvironKey();
|
||||||
if (hEnvironKey)
|
if (hEnvironKey)
|
||||||
{
|
{
|
||||||
// Make sure the PlasmaGameDir var is in the path
|
// Make sure the PlasmaGameDir var is in the path
|
||||||
DWORD size = 0;
|
DWORD size = 0;
|
||||||
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, NULL, &size))
|
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, NULL, &size))
|
||||||
{
|
{
|
||||||
char* oldPath = new char[size];
|
char* oldPath = new char[size];
|
||||||
static const char* kPlasmaVar = "%PlasmaGameDir%";
|
static const char* kPlasmaVar = "%PlasmaGameDir%";
|
||||||
|
|
||||||
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, (BYTE*)oldPath, &size))
|
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, (BYTE*)oldPath, &size))
|
||||||
{
|
{
|
||||||
pathSet = (strstr(oldPath, kPlasmaVar) != NULL);
|
pathSet = (strstr(oldPath, kPlasmaVar) != NULL);
|
||||||
|
|
||||||
if (!pathSet)
|
if (!pathSet)
|
||||||
{
|
{
|
||||||
char* newPath = new char[size+strlen(kPlasmaVar)+1];
|
char* newPath = new char[size+strlen(kPlasmaVar)+1];
|
||||||
strcpy(newPath, oldPath);
|
strcpy(newPath, oldPath);
|
||||||
strcat(newPath, ";");
|
strcat(newPath, ";");
|
||||||
strcat(newPath, kPlasmaVar);
|
strcat(newPath, kPlasmaVar);
|
||||||
|
|
||||||
RegSetValueEx(hEnvironKey, "Path", 0, REG_EXPAND_SZ, (BYTE*)newPath, strlen(newPath)+1);
|
RegSetValueEx(hEnvironKey, "Path", 0, REG_EXPAND_SZ, (BYTE*)newPath, strlen(newPath)+1);
|
||||||
|
|
||||||
delete [] newPath;
|
delete [] newPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] oldPath;
|
delete [] oldPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the PlasmaGameDir var
|
// Set the PlasmaGameDir var
|
||||||
RegSetValueEx(hEnvironKey, "PlasmaGameDir", 0, REG_SZ, (BYTE*)plasmaPath, strlen(plasmaPath)+1);
|
RegSetValueEx(hEnvironKey, "PlasmaGameDir", 0, REG_SZ, (BYTE*)plasmaPath, strlen(plasmaPath)+1);
|
||||||
|
|
||||||
// Notify command prompts and stuff that environ changed
|
// Notify command prompts and stuff that environ changed
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
SendMessageTimeout(HWND_BROADCAST,
|
SendMessageTimeout(HWND_BROADCAST,
|
||||||
WM_SETTINGCHANGE,
|
WM_SETTINGCHANGE,
|
||||||
0,
|
0,
|
||||||
(LPARAM)"Environment",
|
(LPARAM)"Environment",
|
||||||
SMTO_ABORTIFHUNG,
|
SMTO_ABORTIFHUNG,
|
||||||
5000,
|
5000,
|
||||||
&ret);
|
&ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
void SetPlasmaPath(const char* plasmaPath);
|
void SetPlasmaPath(const char* plasmaPath);
|
||||||
|
@ -1,153 +1,153 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plUnzip.h"
|
#include "plUnzip.h"
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "hsWindows.h"
|
#include "hsWindows.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
|
|
||||||
plUnzip::plUnzip() : fFile(nil)
|
plUnzip::plUnzip() : fFile(nil)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plUnzip::Open(const char* filename)
|
bool plUnzip::Open(const char* filename)
|
||||||
{
|
{
|
||||||
fFile = unzOpen(filename);
|
fFile = unzOpen(filename);
|
||||||
return (fFile != nil);
|
return (fFile != nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plUnzip::Close()
|
bool plUnzip::Close()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (fFile != nil)
|
if (fFile != nil)
|
||||||
{
|
{
|
||||||
ret = (UNZ_OK == unzClose(fFile));
|
ret = (UNZ_OK == unzClose(fFile));
|
||||||
fFile = nil;
|
fFile = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plUnzip::IGetFullPath(const char* destDir, const char* filename, char* outFilename)
|
void plUnzip::IGetFullPath(const char* destDir, const char* filename, char* outFilename)
|
||||||
{
|
{
|
||||||
// Make sure the dest ends with a slash
|
// Make sure the dest ends with a slash
|
||||||
strcpy(outFilename, destDir);
|
strcpy(outFilename, destDir);
|
||||||
char lastChar = outFilename[strlen(outFilename)-1];
|
char lastChar = outFilename[strlen(outFilename)-1];
|
||||||
if (lastChar != '\\' && lastChar != '/')
|
if (lastChar != '\\' && lastChar != '/')
|
||||||
strcat(outFilename, "\\");
|
strcat(outFilename, "\\");
|
||||||
|
|
||||||
// Check if the output filename has any directories in it
|
// Check if the output filename has any directories in it
|
||||||
const char* forward = strrchr(filename, '/');
|
const char* forward = strrchr(filename, '/');
|
||||||
const char* backward = strrchr(filename, '\\');
|
const char* backward = strrchr(filename, '\\');
|
||||||
|
|
||||||
if (!forward && !backward)
|
if (!forward && !backward)
|
||||||
{
|
{
|
||||||
CreateDirectory(outFilename, NULL);
|
CreateDirectory(outFilename, NULL);
|
||||||
strcat(outFilename, filename);
|
strcat(outFilename, filename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char* fileOnly = (forward > backward) ? forward+1 : backward+1;
|
const char* fileOnly = (forward > backward) ? forward+1 : backward+1;
|
||||||
strncat(outFilename, filename, fileOnly-filename);
|
strncat(outFilename, filename, fileOnly-filename);
|
||||||
CreateDirectory(outFilename, NULL);
|
CreateDirectory(outFilename, NULL);
|
||||||
|
|
||||||
strcat(outFilename, fileOnly);
|
strcat(outFilename, fileOnly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plUnzip::IExtractCurrent(const char* destDir, char* fileName)
|
void plUnzip::IExtractCurrent(const char* destDir, char* fileName)
|
||||||
{
|
{
|
||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
if (unzGetCurrentFileInfo(fFile, nil, filename, sizeof(filename), nil, 0, nil, 0) == UNZ_OK)
|
if (unzGetCurrentFileInfo(fFile, nil, filename, sizeof(filename), nil, 0, nil, 0) == UNZ_OK)
|
||||||
{
|
{
|
||||||
strcpy(fileName, filename);
|
strcpy(fileName, filename);
|
||||||
|
|
||||||
if (unzOpenCurrentFile(fFile) == UNZ_OK)
|
if (unzOpenCurrentFile(fFile) == UNZ_OK)
|
||||||
{
|
{
|
||||||
char outFilename[MAX_PATH];
|
char outFilename[MAX_PATH];
|
||||||
IGetFullPath(destDir, filename, outFilename);
|
IGetFullPath(destDir, filename, outFilename);
|
||||||
|
|
||||||
// Make sure to take off the read-only flag if the file exists, and is RO
|
// Make sure to take off the read-only flag if the file exists, and is RO
|
||||||
DWORD attrs = GetFileAttributes(outFilename);
|
DWORD attrs = GetFileAttributes(outFilename);
|
||||||
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_READONLY))
|
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_READONLY))
|
||||||
SetFileAttributes(outFilename, attrs & ~FILE_ATTRIBUTE_READONLY);
|
SetFileAttributes(outFilename, attrs & ~FILE_ATTRIBUTE_READONLY);
|
||||||
|
|
||||||
hsUNIXStream outFile;
|
hsUNIXStream outFile;
|
||||||
if (outFile.Open(outFilename, "wb"))
|
if (outFile.Open(outFilename, "wb"))
|
||||||
{
|
{
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
int numRead;
|
int numRead;
|
||||||
while ((numRead = unzReadCurrentFile(fFile, buf, sizeof(buf))) > 0)
|
while ((numRead = unzReadCurrentFile(fFile, buf, sizeof(buf))) > 0)
|
||||||
{
|
{
|
||||||
outFile.Write(numRead, buf);
|
outFile.Write(numRead, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
outFile.Close();
|
outFile.Close();
|
||||||
|
|
||||||
unz_file_info_s info;
|
unz_file_info_s info;
|
||||||
unzGetCurrentFileInfo(fFile, &info, NULL, 0, NULL, 0, NULL, 0);
|
unzGetCurrentFileInfo(fFile, &info, NULL, 0, NULL, 0, NULL, 0);
|
||||||
|
|
||||||
SYSTEMTIME sysTime = {0};
|
SYSTEMTIME sysTime = {0};
|
||||||
sysTime.wDay = info.tmu_date.tm_mday;
|
sysTime.wDay = info.tmu_date.tm_mday;
|
||||||
sysTime.wMonth = info.tmu_date.tm_mon+1;
|
sysTime.wMonth = info.tmu_date.tm_mon+1;
|
||||||
sysTime.wYear = info.tmu_date.tm_year;
|
sysTime.wYear = info.tmu_date.tm_year;
|
||||||
sysTime.wHour = info.tmu_date.tm_hour;
|
sysTime.wHour = info.tmu_date.tm_hour;
|
||||||
sysTime.wMinute = info.tmu_date.tm_min;
|
sysTime.wMinute = info.tmu_date.tm_min;
|
||||||
sysTime.wSecond = info.tmu_date.tm_sec;
|
sysTime.wSecond = info.tmu_date.tm_sec;
|
||||||
|
|
||||||
FILETIME localFileTime, utcFileTime;
|
FILETIME localFileTime, utcFileTime;
|
||||||
SystemTimeToFileTime(&sysTime, &localFileTime);
|
SystemTimeToFileTime(&sysTime, &localFileTime);
|
||||||
|
|
||||||
LocalFileTimeToFileTime(&localFileTime, &utcFileTime);
|
LocalFileTimeToFileTime(&localFileTime, &utcFileTime);
|
||||||
|
|
||||||
HANDLE hFile = CreateFile(outFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
HANDLE hFile = CreateFile(outFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
SetFileTime(hFile, NULL, NULL, &utcFileTime);
|
SetFileTime(hFile, NULL, NULL, &utcFileTime);
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
unzCloseCurrentFile(fFile);
|
unzCloseCurrentFile(fFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plUnzip::ExtractAll(const char* destDir)
|
void plUnzip::ExtractAll(const char* destDir)
|
||||||
{
|
{
|
||||||
if (unzGoToFirstFile(fFile) != UNZ_OK)
|
if (unzGoToFirstFile(fFile) != UNZ_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
IExtractCurrent(destDir);
|
IExtractCurrent(destDir);
|
||||||
}
|
}
|
||||||
while (unzGoToNextFile(fFile) == UNZ_OK);
|
while (unzGoToNextFile(fFile) == UNZ_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plUnzip::ExtractNext(const char* destDir, char* fileName)
|
bool plUnzip::ExtractNext(const char* destDir, char* fileName)
|
||||||
{
|
{
|
||||||
IExtractCurrent(destDir, fileName);
|
IExtractCurrent(destDir, fileName);
|
||||||
return (unzGoToNextFile(fFile) == UNZ_OK);
|
return (unzGoToNextFile(fFile) == UNZ_OK);
|
||||||
}
|
}
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plUnzip_h_inc
|
#ifndef plUnzip_h_inc
|
||||||
#define plUnzip_h_inc
|
#define plUnzip_h_inc
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "../src/contrib/minizip/unzip.h"
|
#include "../src/contrib/minizip/unzip.h"
|
||||||
|
|
||||||
class plUnzip
|
class plUnzip
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
unzFile fFile;
|
unzFile fFile;
|
||||||
|
|
||||||
void IGetFullPath(const char* destDir, const char* filename, char* outFilename);
|
void IGetFullPath(const char* destDir, const char* filename, char* outFilename);
|
||||||
void IExtractCurrent(const char* destDir, char* fileName=nil);
|
void IExtractCurrent(const char* destDir, char* fileName=nil);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plUnzip();
|
plUnzip();
|
||||||
|
|
||||||
bool Open(const char* filename);
|
bool Open(const char* filename);
|
||||||
bool Close();
|
bool Close();
|
||||||
|
|
||||||
void ExtractAll(const char* destDir);
|
void ExtractAll(const char* destDir);
|
||||||
bool ExtractNext(const char* destDir, char* fileName);
|
bool ExtractNext(const char* destDir, char* fileName);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // plUnzip_h_inc
|
#endif // plUnzip_h_inc
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Developer Studio generated include file.
|
// Microsoft Developer Studio generated include file.
|
||||||
// Used by plPlasmaInstaller.rc
|
// Used by plPlasmaInstaller.rc
|
||||||
//
|
//
|
||||||
#define IDD_INSTALLER 101
|
#define IDD_INSTALLER 101
|
||||||
#define IDI_ICON1 102
|
#define IDI_ICON1 102
|
||||||
#define IDC_3DSMAX_EDIT 1000
|
#define IDC_3DSMAX_EDIT 1000
|
||||||
#define IDC_BROWSE_3DSMAX 1001
|
#define IDC_BROWSE_3DSMAX 1001
|
||||||
#define IDC_TIME_COMBO 1002
|
#define IDC_TIME_COMBO 1002
|
||||||
#define IDC_CLIENT_EDIT 1003
|
#define IDC_CLIENT_EDIT 1003
|
||||||
#define IDC_BROWSE_CLIENT 1004
|
#define IDC_BROWSE_CLIENT 1004
|
||||||
#define IDC_GET_BUTTON 1005
|
#define IDC_GET_BUTTON 1005
|
||||||
#define IDC_STATUS_LIST 1006
|
#define IDC_STATUS_LIST 1006
|
||||||
#define IDC_BRANCH_DATE 1007
|
#define IDC_BRANCH_DATE 1007
|
||||||
#define IDC_BUILD_COMBO 1008
|
#define IDC_BUILD_COMBO 1008
|
||||||
#define IDC_CLIENT_CHECK 1009
|
#define IDC_CLIENT_CHECK 1009
|
||||||
#define IDC_SCRIPTS_CHECK 1010
|
#define IDC_SCRIPTS_CHECK 1010
|
||||||
#define IDC_PLUGINS_CHECK 1011
|
#define IDC_PLUGINS_CHECK 1011
|
||||||
#define IDC_TOOLS_CHECK 1012
|
#define IDC_TOOLS_CHECK 1012
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1013
|
#define _APS_NEXT_CONTROL_VALUE 1013
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@ -1,52 +1,52 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plPlasmaUpdate.h"
|
#include "plPlasmaUpdate.h"
|
||||||
#include "jvCoreUtil.h"
|
#include "jvCoreUtil.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
|
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
jvCoreUtil::SetHInstance(hInstance);
|
jvCoreUtil::SetHInstance(hInstance);
|
||||||
plPlasmaUpdate installer;
|
plPlasmaUpdate installer;
|
||||||
if (!installer.Create())
|
if (!installer.Create())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!stricmp(lpCmdLine, "AutoDownload"))
|
if (!stricmp(lpCmdLine, "AutoDownload"))
|
||||||
installer.SetAutoDownload();
|
installer.SetAutoDownload();
|
||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (GetMessage(&msg, NULL, 0, 0))
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
{
|
{
|
||||||
if (!jvBaseDlg::IsDialogMessage(&msg))
|
if (!jvBaseDlg::IsDialogMessage(&msg))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,170 +1,170 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "plFileGrabber.h"
|
#include "plFileGrabber.h"
|
||||||
|
|
||||||
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
||||||
plHttpFileGrabber::plHttpFileGrabber()
|
plHttpFileGrabber::plHttpFileGrabber()
|
||||||
{
|
{
|
||||||
fRequestMgr.SetHostname("");
|
fRequestMgr.SetHostname("");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plHttpFileGrabber::FileToStream(const char* path, hsStream* stream)
|
bool plHttpFileGrabber::FileToStream(const char* path, hsStream* stream)
|
||||||
{
|
{
|
||||||
std::string pathStr(path);
|
std::string pathStr(path);
|
||||||
bool retVal = fRequestMgr.GetFileToStream(path, stream);
|
bool retVal = fRequestMgr.GetFileToStream(path, stream);
|
||||||
stream->SetPosition(0);
|
stream->SetPosition(0);
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plHttpFileGrabber::SetServer(const char* server)
|
void plHttpFileGrabber::SetServer(const char* server)
|
||||||
{
|
{
|
||||||
std::string serverPath(server);
|
std::string serverPath(server);
|
||||||
|
|
||||||
fRequestMgr.SetHostname(serverPath);
|
fRequestMgr.SetHostname(serverPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plHttpFileGrabber::MakeProperPath(char* path)
|
void plHttpFileGrabber::MakeProperPath(char* path)
|
||||||
{
|
{
|
||||||
char* slash = NULL;
|
char* slash = NULL;
|
||||||
do {
|
do {
|
||||||
slash = strchr(path, '\\');
|
slash = strchr(path, '\\');
|
||||||
if (slash)
|
if (slash)
|
||||||
*slash = '/';
|
*slash = '/';
|
||||||
} while(slash != NULL);
|
} while(slash != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plHttpFileGrabber::SetUsernamePassword(const std::string& username, const std::string& password)
|
void plHttpFileGrabber::SetUsernamePassword(const std::string& username, const std::string& password)
|
||||||
{
|
{
|
||||||
fRequestMgr.SetUsername(username);
|
fRequestMgr.SetUsername(username);
|
||||||
fRequestMgr.SetPassword(password);
|
fRequestMgr.SetPassword(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plHttpFileGrabber::IsServerAvailable(const char* serverName)
|
bool plHttpFileGrabber::IsServerAvailable(const char* serverName)
|
||||||
{
|
{
|
||||||
bool retVal = false;
|
bool retVal = false;
|
||||||
|
|
||||||
HINTERNET hInternet = InternetOpen("Parable Patcher",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
|
HINTERNET hInternet = InternetOpen("Parable Patcher",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
|
||||||
if (hInternet)
|
if (hInternet)
|
||||||
{
|
{
|
||||||
HINTERNET hHttp = InternetConnect(hInternet,serverName,8080,fUserName.c_str(),fPassword.c_str(),INTERNET_SERVICE_HTTP,0,0);
|
HINTERNET hHttp = InternetConnect(hInternet,serverName,8080,fUserName.c_str(),fPassword.c_str(),INTERNET_SERVICE_HTTP,0,0);
|
||||||
if (hHttp)
|
if (hHttp)
|
||||||
{
|
{
|
||||||
HINTERNET hRequest = HttpOpenRequest(hHttp, "GET", "/Current/Current.txt", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_KEEP_CONNECTION, 0);
|
HINTERNET hRequest = HttpOpenRequest(hHttp, "GET", "/Current/Current.txt", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_KEEP_CONNECTION, 0);
|
||||||
if (hRequest)
|
if (hRequest)
|
||||||
{
|
{
|
||||||
DWORD dwCode;
|
DWORD dwCode;
|
||||||
DWORD dwSize = sizeof(dwCode);
|
DWORD dwSize = sizeof(dwCode);
|
||||||
HttpSendRequest(hRequest, NULL, 0, NULL, 0);
|
HttpSendRequest(hRequest, NULL, 0, NULL, 0);
|
||||||
HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwCode, &dwSize, NULL);
|
HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwCode, &dwSize, NULL);
|
||||||
if (dwCode >= 200 && dwCode < 300)
|
if (dwCode >= 200 && dwCode < 300)
|
||||||
{
|
{
|
||||||
retVal = true;
|
retVal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
InternetCloseHandle(hRequest);
|
InternetCloseHandle(hRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
InternetCloseHandle(hHttp);
|
InternetCloseHandle(hHttp);
|
||||||
}
|
}
|
||||||
InternetCloseHandle(hInternet);
|
InternetCloseHandle(hInternet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plNetShareFileGrabber::plNetShareFileGrabber()
|
plNetShareFileGrabber::plNetShareFileGrabber()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BUFFER_SIZE 1024*1024
|
#define BUFFER_SIZE 1024*1024
|
||||||
bool plNetShareFileGrabber::FileToStream(const char* path, hsStream* stream)
|
bool plNetShareFileGrabber::FileToStream(const char* path, hsStream* stream)
|
||||||
{
|
{
|
||||||
hsUNIXStream fileStream;
|
hsUNIXStream fileStream;
|
||||||
std::string filePath = fServerName + path;
|
std::string filePath = fServerName + path;
|
||||||
|
|
||||||
if (fileStream.Open(filePath.c_str()))
|
if (fileStream.Open(filePath.c_str()))
|
||||||
{
|
{
|
||||||
char* buffer = new char[BUFFER_SIZE];
|
char* buffer = new char[BUFFER_SIZE];
|
||||||
UInt32 streamSize = fileStream.GetSizeLeft();
|
UInt32 streamSize = fileStream.GetSizeLeft();
|
||||||
while (streamSize > (BUFFER_SIZE))
|
while (streamSize > (BUFFER_SIZE))
|
||||||
{
|
{
|
||||||
fileStream.Read(BUFFER_SIZE, buffer);
|
fileStream.Read(BUFFER_SIZE, buffer);
|
||||||
stream->Write(BUFFER_SIZE, buffer);
|
stream->Write(BUFFER_SIZE, buffer);
|
||||||
|
|
||||||
streamSize = fileStream.GetSizeLeft();
|
streamSize = fileStream.GetSizeLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamSize > 0)
|
if (streamSize > 0)
|
||||||
{
|
{
|
||||||
fileStream.Read(streamSize, buffer);
|
fileStream.Read(streamSize, buffer);
|
||||||
stream->Write(streamSize, buffer);
|
stream->Write(streamSize, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream->Rewind();
|
stream->Rewind();
|
||||||
|
|
||||||
fileStream.Close();
|
fileStream.Close();
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plNetShareFileGrabber::SetServer(const char* server)
|
void plNetShareFileGrabber::SetServer(const char* server)
|
||||||
{
|
{
|
||||||
fServerName = "\\\\";
|
fServerName = "\\\\";
|
||||||
fServerName += server;
|
fServerName += server;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plNetShareFileGrabber::MakeProperPath(char* path)
|
void plNetShareFileGrabber::MakeProperPath(char* path)
|
||||||
{
|
{
|
||||||
char* slash = NULL;
|
char* slash = NULL;
|
||||||
do {
|
do {
|
||||||
slash = strchr(path, '/');
|
slash = strchr(path, '/');
|
||||||
if (slash)
|
if (slash)
|
||||||
*slash = '\\';
|
*slash = '\\';
|
||||||
} while(slash != NULL);
|
} while(slash != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plNetShareFileGrabber::IsServerAvailable(const char* serverName, const char* currentDir)
|
bool plNetShareFileGrabber::IsServerAvailable(const char* serverName, const char* currentDir)
|
||||||
{
|
{
|
||||||
bool retVal = false;
|
bool retVal = false;
|
||||||
|
|
||||||
char serverPath[MAX_PATH];
|
char serverPath[MAX_PATH];
|
||||||
sprintf(serverPath, "\\\\%s\\%s\\Current.txt", serverName, currentDir);
|
sprintf(serverPath, "\\\\%s\\%s\\Current.txt", serverName, currentDir);
|
||||||
|
|
||||||
hsUNIXStream si;
|
hsUNIXStream si;
|
||||||
if (si.Open(serverPath, "rb"))
|
if (si.Open(serverPath, "rb"))
|
||||||
{
|
{
|
||||||
retVal = true;
|
retVal = true;
|
||||||
si.Close();
|
si.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
@ -1,73 +1,73 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plFileGrabber_h_inc
|
#ifndef plFileGrabber_h_inc
|
||||||
#define plFileGrabber_h_inc
|
#define plFileGrabber_h_inc
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
|
|
||||||
class plFileGrabber
|
class plFileGrabber
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual bool IsServerAvailable(const char* serverName, const char* currentDir) = 0;
|
virtual bool IsServerAvailable(const char* serverName, const char* currentDir) = 0;
|
||||||
virtual bool FileToStream(const char* path, hsStream* stream) = 0;
|
virtual bool FileToStream(const char* path, hsStream* stream) = 0;
|
||||||
virtual void SetServer(const char* server) = 0;
|
virtual void SetServer(const char* server) = 0;
|
||||||
virtual void MakeProperPath(char* path) = 0;
|
virtual void MakeProperPath(char* path) = 0;
|
||||||
virtual bool NeedsAuth() { return false; }
|
virtual bool NeedsAuth() { return false; }
|
||||||
virtual void SetUsernamePassword(const std::string& username, const std::string& password) {}
|
virtual void SetUsernamePassword(const std::string& username, const std::string& password) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
||||||
class plHttpFileGrabber : public plFileGrabber
|
class plHttpFileGrabber : public plFileGrabber
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
plHttpDiverseRequestMgr fRequestMgr;
|
plHttpDiverseRequestMgr fRequestMgr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plHttpFileGrabber();
|
plHttpFileGrabber();
|
||||||
virtual bool IsServerAvailable(const char* serverName);
|
virtual bool IsServerAvailable(const char* serverName);
|
||||||
virtual bool FileToStream(const char* path, hsStream* stream);
|
virtual bool FileToStream(const char* path, hsStream* stream);
|
||||||
virtual void SetServer(const char* server);
|
virtual void SetServer(const char* server);
|
||||||
virtual void MakeProperPath(char* path);
|
virtual void MakeProperPath(char* path);
|
||||||
virtual bool NeedsAuth() { return true; }
|
virtual bool NeedsAuth() { return true; }
|
||||||
virtual void SetUsernamePassword(const std::string& username, const std::string& password);
|
virtual void SetUsernamePassword(const std::string& username, const std::string& password);
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class plNetShareFileGrabber : public plFileGrabber
|
class plNetShareFileGrabber : public plFileGrabber
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::string fServerName;
|
std::string fServerName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plNetShareFileGrabber();
|
plNetShareFileGrabber();
|
||||||
virtual bool IsServerAvailable(const char* serverName, const char* currentDir);
|
virtual bool IsServerAvailable(const char* serverName, const char* currentDir);
|
||||||
virtual bool FileToStream(const char* path, hsStream* stream);
|
virtual bool FileToStream(const char* path, hsStream* stream);
|
||||||
virtual void SetServer(const char* server);
|
virtual void SetServer(const char* server);
|
||||||
virtual void MakeProperPath(char* path);
|
virtual void MakeProperPath(char* path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -1,346 +1,346 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
#include "plManifest.h"
|
#include "plManifest.h"
|
||||||
|
|
||||||
#include "../plEncryption/plChecksum.h"
|
#include "../plEncryption/plChecksum.h"
|
||||||
#include "../plCompression/plZlibStream.h"
|
#include "../plCompression/plZlibStream.h"
|
||||||
#include "../plFile/plEncryptedStream.h"
|
#include "../plFile/plEncryptedStream.h"
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
#include "../plUnifiedTime/plUnifiedTime.h"
|
#include "../plUnifiedTime/plUnifiedTime.h"
|
||||||
|
|
||||||
class plManifestFile
|
class plManifestFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char* fFilename;
|
char* fFilename;
|
||||||
plMD5Checksum fSum;
|
plMD5Checksum fSum;
|
||||||
plMD5Checksum fLocalSum;
|
plMD5Checksum fLocalSum;
|
||||||
UInt32 fSize;
|
UInt32 fSize;
|
||||||
UInt32 fCompressedSize;
|
UInt32 fCompressedSize;
|
||||||
UInt32 fFlags;
|
UInt32 fFlags;
|
||||||
};
|
};
|
||||||
|
|
||||||
plManifest::plManifest(LogFunc log) :
|
plManifest::plManifest(LogFunc log) :
|
||||||
fDownloadFiles(0),
|
fDownloadFiles(0),
|
||||||
fDownloadBytes(0),
|
fDownloadBytes(0),
|
||||||
fDirtySums(false),
|
fDirtySums(false),
|
||||||
fLog(log)
|
fLog(log)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
plManifest::~plManifest()
|
plManifest::~plManifest()
|
||||||
{
|
{
|
||||||
if (fDirtySums)
|
if (fDirtySums)
|
||||||
IWriteCache();
|
IWriteCache();
|
||||||
|
|
||||||
delete [] fManifestName;
|
delete [] fManifestName;
|
||||||
|
|
||||||
for (int i = 0; i < fFiles.size(); i++)
|
for (int i = 0; i < fFiles.size(); i++)
|
||||||
{
|
{
|
||||||
delete [] fFiles[i]->fFilename;
|
delete [] fFiles[i]->fFilename;
|
||||||
delete fFiles[i];
|
delete fFiles[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plManifest::Read(hsStream* mfsStream, const char* basePath, const char* mfsName)
|
bool plManifest::Read(hsStream* mfsStream, const char* basePath, const char* mfsName)
|
||||||
{
|
{
|
||||||
fBasePath = basePath;
|
fBasePath = basePath;
|
||||||
fManifestName = hsStrcpy(mfsName);
|
fManifestName = hsStrcpy(mfsName);
|
||||||
|
|
||||||
fLog("--- Reading manifest for %s", fManifestName);
|
fLog("--- Reading manifest for %s", fManifestName);
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
while (mfsStream->ReadLn(buf, sizeof(buf)))
|
while (mfsStream->ReadLn(buf, sizeof(buf)))
|
||||||
{
|
{
|
||||||
plManifestFile* file = new plManifestFile;
|
plManifestFile* file = new plManifestFile;
|
||||||
|
|
||||||
char* tok = strtok(buf, "\t");
|
char* tok = strtok(buf, "\t");
|
||||||
file->fFilename = hsStrcpy(tok);
|
file->fFilename = hsStrcpy(tok);
|
||||||
|
|
||||||
tok = strtok(nil, "\t");
|
tok = strtok(nil, "\t");
|
||||||
file->fSum.SetFromHexString(tok);
|
file->fSum.SetFromHexString(tok);
|
||||||
|
|
||||||
tok = strtok(nil, "\t");
|
tok = strtok(nil, "\t");
|
||||||
file->fSize = atoi(tok);
|
file->fSize = atoi(tok);
|
||||||
|
|
||||||
tok = strtok(nil, "\t");
|
tok = strtok(nil, "\t");
|
||||||
file->fCompressedSize = atoi(tok);
|
file->fCompressedSize = atoi(tok);
|
||||||
|
|
||||||
tok = strtok(nil, "\t");
|
tok = strtok(nil, "\t");
|
||||||
file->fFlags = atoi(tok);
|
file->fFlags = atoi(tok);
|
||||||
|
|
||||||
fFiles.push_back(file);
|
fFiles.push_back(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plManifest::ValidateFiles(ProgressFunc progress)
|
void plManifest::ValidateFiles(ProgressFunc progress)
|
||||||
{
|
{
|
||||||
if (fFiles.empty())
|
if (fFiles.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fLog("--- Validating files for %s", fManifestName);
|
fLog("--- Validating files for %s", fManifestName);
|
||||||
|
|
||||||
IReadCache(progress);
|
IReadCache(progress);
|
||||||
|
|
||||||
fDownloadFiles = 0;
|
fDownloadFiles = 0;
|
||||||
fDownloadBytes = 0;
|
fDownloadBytes = 0;
|
||||||
|
|
||||||
for (int i = 0; i < fFiles.size(); i++)
|
for (int i = 0; i < fFiles.size(); i++)
|
||||||
{
|
{
|
||||||
plManifestFile* file = fFiles[i];
|
plManifestFile* file = fFiles[i];
|
||||||
|
|
||||||
// If the local checksum is invalid, this file wasn't in our cache.
|
// If the local checksum is invalid, this file wasn't in our cache.
|
||||||
// Get the sum, and update the progress bar.
|
// Get the sum, and update the progress bar.
|
||||||
if (!file->fLocalSum.IsValid())
|
if (!file->fLocalSum.IsValid())
|
||||||
{
|
{
|
||||||
fLog(" No sum for %s, calculating", file->fFilename);
|
fLog(" No sum for %s, calculating", file->fFilename);
|
||||||
file->fLocalSum.CalcFromFile(file->fFilename);
|
file->fLocalSum.CalcFromFile(file->fFilename);
|
||||||
fDirtySums = true;
|
fDirtySums = true;
|
||||||
progress(file->fFilename, 1);
|
progress(file->fFilename, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file->fLocalSum != file->fSum)
|
if (file->fLocalSum != file->fSum)
|
||||||
{
|
{
|
||||||
fLog(" Incorrect sum for %s", file->fFilename);
|
fLog(" Incorrect sum for %s", file->fFilename);
|
||||||
fDownloadFiles++;
|
fDownloadFiles++;
|
||||||
fDownloadBytes += file->fCompressedSize;
|
fDownloadBytes += file->fCompressedSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fLog("--- Need to download %d files, %.1f MB", fDownloadFiles, float(fDownloadBytes) / (1024.f*1024.f));
|
fLog("--- Need to download %d files, %.1f MB", fDownloadFiles, float(fDownloadBytes) / (1024.f*1024.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void plManifest::DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber)
|
void plManifest::DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < fFiles.size(); i++)
|
for (int i = 0; i < fFiles.size(); i++)
|
||||||
{
|
{
|
||||||
plManifestFile* file = fFiles[i];
|
plManifestFile* file = fFiles[i];
|
||||||
if (file->fLocalSum != file->fSum)
|
if (file->fLocalSum != file->fSum)
|
||||||
{
|
{
|
||||||
char serverPath[MAX_PATH];
|
char serverPath[MAX_PATH];
|
||||||
|
|
||||||
sprintf(serverPath, "%s%s.gz", fBasePath.c_str(), file->fFilename);
|
sprintf(serverPath, "%s%s.gz", fBasePath.c_str(), file->fFilename);
|
||||||
grabber->MakeProperPath(serverPath);
|
grabber->MakeProperPath(serverPath);
|
||||||
|
|
||||||
hsRAMStream serverStream;
|
hsRAMStream serverStream;
|
||||||
if (grabber->FileToStream(serverPath, &serverStream))
|
if (grabber->FileToStream(serverPath, &serverStream))
|
||||||
{
|
{
|
||||||
plFileUtils::EnsureFilePathExists(file->fFilename);
|
plFileUtils::EnsureFilePathExists(file->fFilename);
|
||||||
|
|
||||||
plFileUtils::RemoveFile(file->fFilename, true);
|
plFileUtils::RemoveFile(file->fFilename, true);
|
||||||
|
|
||||||
plZlibStream localStream;
|
plZlibStream localStream;
|
||||||
if (localStream.Open(file->fFilename, "wb"))
|
if (localStream.Open(file->fFilename, "wb"))
|
||||||
{
|
{
|
||||||
char dataBuf[1024];
|
char dataBuf[1024];
|
||||||
UInt32 sizeLeft = serverStream.GetSizeLeft();
|
UInt32 sizeLeft = serverStream.GetSizeLeft();
|
||||||
while (UInt32 amtRead = serverStream.Read( (sizeof(dataBuf) > sizeLeft) ? sizeLeft : sizeof(dataBuf), dataBuf))
|
while (UInt32 amtRead = serverStream.Read( (sizeof(dataBuf) > sizeLeft) ? sizeLeft : sizeof(dataBuf), dataBuf))
|
||||||
{
|
{
|
||||||
progress(file->fFilename, amtRead);
|
progress(file->fFilename, amtRead);
|
||||||
|
|
||||||
localStream.Write(amtRead, dataBuf);
|
localStream.Write(amtRead, dataBuf);
|
||||||
sizeLeft = serverStream.GetSizeLeft();
|
sizeLeft = serverStream.GetSizeLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
localStream.Close();
|
localStream.Close();
|
||||||
|
|
||||||
// FIXME - Should we recalc this?
|
// FIXME - Should we recalc this?
|
||||||
file->fLocalSum = file->fSum;
|
file->fLocalSum = file->fSum;
|
||||||
fDirtySums = true;
|
fDirtySums = true;
|
||||||
|
|
||||||
if (file->fFlags != 0)
|
if (file->fFlags != 0)
|
||||||
IDecompressSound(file);
|
IDecompressSound(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plManifestFile* plManifest::IFindFile(const char* name)
|
plManifestFile* plManifest::IFindFile(const char* name)
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
for (int i = 0; i < fFiles.size(); i++)
|
for (int i = 0; i < fFiles.size(); i++)
|
||||||
{
|
{
|
||||||
if (hsStrEQ(fFiles[i]->fFilename, name))
|
if (hsStrEQ(fFiles[i]->fFilename, name))
|
||||||
return fFiles[i];
|
return fFiles[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// KLUDGE - Put age checksums in the dat dir, for backwards compatability
|
// KLUDGE - Put age checksums in the dat dir, for backwards compatability
|
||||||
const char* plManifest::IGetCacheDir()
|
const char* plManifest::IGetCacheDir()
|
||||||
{
|
{
|
||||||
const char* prefix = "";
|
const char* prefix = "";
|
||||||
if (strncmp(fFiles[0]->fFilename, "dat\\", strlen("dat\\")) == 0)
|
if (strncmp(fFiles[0]->fFilename, "dat\\", strlen("dat\\")) == 0)
|
||||||
return "dat\\";
|
return "dat\\";
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#define kCacheFileVersion 1
|
#define kCacheFileVersion 1
|
||||||
|
|
||||||
void plManifest::IWriteCache()
|
void plManifest::IWriteCache()
|
||||||
{
|
{
|
||||||
plEncryptedStream s;
|
plEncryptedStream s;
|
||||||
|
|
||||||
bool openedFile = false;
|
bool openedFile = false;
|
||||||
|
|
||||||
UInt32 numFiles = 0;
|
UInt32 numFiles = 0;
|
||||||
for (int i = 0; i < fFiles.size(); i++)
|
for (int i = 0; i < fFiles.size(); i++)
|
||||||
{
|
{
|
||||||
plManifestFile* file = fFiles[i];
|
plManifestFile* file = fFiles[i];
|
||||||
|
|
||||||
plUnifiedTime modifiedTime;
|
plUnifiedTime modifiedTime;
|
||||||
if (file->fLocalSum.IsValid() &&
|
if (file->fLocalSum.IsValid() &&
|
||||||
plFileUtils::GetFileTimes(file->fFilename, nil, &modifiedTime))
|
plFileUtils::GetFileTimes(file->fFilename, nil, &modifiedTime))
|
||||||
{
|
{
|
||||||
if (!openedFile)
|
if (!openedFile)
|
||||||
{
|
{
|
||||||
openedFile = true;
|
openedFile = true;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
||||||
s.Open(buf, "wb");
|
s.Open(buf, "wb");
|
||||||
s.WriteSwap32(0);
|
s.WriteSwap32(0);
|
||||||
s.WriteSwap32(kCacheFileVersion);
|
s.WriteSwap32(kCacheFileVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
s.WriteSafeString(file->fFilename);
|
s.WriteSafeString(file->fFilename);
|
||||||
|
|
||||||
plMD5Checksum& checksum = file->fLocalSum;
|
plMD5Checksum& checksum = file->fLocalSum;
|
||||||
s.Write(checksum.GetSize(), checksum.GetValue());
|
s.Write(checksum.GetSize(), checksum.GetValue());
|
||||||
|
|
||||||
modifiedTime.Write(&s);
|
modifiedTime.Write(&s);
|
||||||
|
|
||||||
numFiles++;
|
numFiles++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (openedFile)
|
if (openedFile)
|
||||||
{
|
{
|
||||||
s.Rewind();
|
s.Rewind();
|
||||||
s.WriteSwap32(numFiles);
|
s.WriteSwap32(numFiles);
|
||||||
|
|
||||||
s.Close();
|
s.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plManifest::IReadCache(ProgressFunc progress)
|
void plManifest::IReadCache(ProgressFunc progress)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Load valid cached checksums
|
// Load valid cached checksums
|
||||||
//
|
//
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
||||||
hsStream* s = plEncryptedStream::OpenEncryptedFile(buf);
|
hsStream* s = plEncryptedStream::OpenEncryptedFile(buf);
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
UInt32 numCached = s->ReadSwap32();
|
UInt32 numCached = s->ReadSwap32();
|
||||||
UInt32 cacheFileVersion = s->ReadSwap32();
|
UInt32 cacheFileVersion = s->ReadSwap32();
|
||||||
|
|
||||||
if (cacheFileVersion != kCacheFileVersion)
|
if (cacheFileVersion != kCacheFileVersion)
|
||||||
{
|
{
|
||||||
s->Close();
|
s->Close();
|
||||||
delete s;
|
delete s;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fLog(" Reading cache...found %d cached sums", numCached);
|
fLog(" Reading cache...found %d cached sums", numCached);
|
||||||
|
|
||||||
for (int i = 0; i < numCached; i++)
|
for (int i = 0; i < numCached; i++)
|
||||||
{
|
{
|
||||||
char* name = s->ReadSafeString();
|
char* name = s->ReadSafeString();
|
||||||
|
|
||||||
UInt8 checksumBuf[MD5_DIGEST_LENGTH];
|
UInt8 checksumBuf[MD5_DIGEST_LENGTH];
|
||||||
s->Read(sizeof(checksumBuf), checksumBuf);
|
s->Read(sizeof(checksumBuf), checksumBuf);
|
||||||
plMD5Checksum checksum;
|
plMD5Checksum checksum;
|
||||||
checksum.SetValue(checksumBuf);
|
checksum.SetValue(checksumBuf);
|
||||||
|
|
||||||
plUnifiedTime modifiedTime;
|
plUnifiedTime modifiedTime;
|
||||||
modifiedTime.Read(s);
|
modifiedTime.Read(s);
|
||||||
|
|
||||||
plManifestFile* file = IFindFile(name);
|
plManifestFile* file = IFindFile(name);
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
plUnifiedTime curModifiedTime;
|
plUnifiedTime curModifiedTime;
|
||||||
if (plFileUtils::GetFileTimes(file->fFilename, nil, &curModifiedTime))
|
if (plFileUtils::GetFileTimes(file->fFilename, nil, &curModifiedTime))
|
||||||
{
|
{
|
||||||
if (curModifiedTime == modifiedTime)
|
if (curModifiedTime == modifiedTime)
|
||||||
file->fLocalSum = checksum;
|
file->fLocalSum = checksum;
|
||||||
else
|
else
|
||||||
fLog(" Invalid modified time for %s", name);
|
fLog(" Invalid modified time for %s", name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fLog(" Couldn't get modified time for %s", name);
|
fLog(" Couldn't get modified time for %s", name);
|
||||||
|
|
||||||
progress(file->fFilename, 1);
|
progress(file->fFilename, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fLog(" Couldn't find cached file '%s' in manifest, discarding", name);
|
fLog(" Couldn't find cached file '%s' in manifest, discarding", name);
|
||||||
|
|
||||||
|
|
||||||
delete [] name;
|
delete [] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->Close();
|
s->Close();
|
||||||
delete s;
|
delete s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "../plAudioCore/plAudioFileReader.h"
|
#include "../plAudioCore/plAudioFileReader.h"
|
||||||
#include "../plAudio/plOGGCodec.h"
|
#include "../plAudio/plOGGCodec.h"
|
||||||
#include "../plAudio/plWavFile.h"
|
#include "../plAudio/plWavFile.h"
|
||||||
|
|
||||||
|
|
||||||
bool plManifest::IDecompressSound(plManifestFile* file)
|
bool plManifest::IDecompressSound(plManifestFile* file)
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
kSndFlagCacheSplit = 1<<0,
|
kSndFlagCacheSplit = 1<<0,
|
||||||
kSndFlagCacheStereo = 1<<2,
|
kSndFlagCacheStereo = 1<<2,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit) ||
|
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit) ||
|
||||||
hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
||||||
{
|
{
|
||||||
plAudioFileReader* reader = plAudioFileReader::CreateReader(file->fFilename, plAudioCore::kAll, plAudioFileReader::kStreamNative);
|
plAudioFileReader* reader = plAudioFileReader::CreateReader(file->fFilename, plAudioCore::kAll, plAudioFileReader::kStreamNative);
|
||||||
if (!reader)
|
if (!reader)
|
||||||
return false;
|
return false;
|
||||||
UInt32 size = reader->GetDataSize();
|
UInt32 size = reader->GetDataSize();
|
||||||
delete reader;
|
delete reader;
|
||||||
|
|
||||||
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit))
|
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit))
|
||||||
plAudioFileReader::CacheFile(file->fFilename, true);
|
plAudioFileReader::CacheFile(file->fFilename, true);
|
||||||
if (hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
if (hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
||||||
plAudioFileReader::CacheFile(file->fFilename, false);
|
plAudioFileReader::CacheFile(file->fFilename, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,77 +1,77 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plManifest_h_inc
|
#ifndef plManifest_h_inc
|
||||||
#define plManifest_h_inc
|
#define plManifest_h_inc
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "plFileGrabber.h"
|
#include "plFileGrabber.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class plManifestFile;
|
class plManifestFile;
|
||||||
|
|
||||||
typedef void (*ProgressFunc)(const char* name, int progDelta);
|
typedef void (*ProgressFunc)(const char* name, int progDelta);
|
||||||
typedef void (*LogFunc)(const char* format, ...);
|
typedef void (*LogFunc)(const char* format, ...);
|
||||||
|
|
||||||
class plManifest
|
class plManifest
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::string fBasePath;
|
std::string fBasePath;
|
||||||
char* fManifestName;
|
char* fManifestName;
|
||||||
|
|
||||||
typedef std::vector<plManifestFile*> FileVec;
|
typedef std::vector<plManifestFile*> FileVec;
|
||||||
FileVec fFiles;
|
FileVec fFiles;
|
||||||
|
|
||||||
UInt32 fDownloadFiles;
|
UInt32 fDownloadFiles;
|
||||||
UInt32 fDownloadBytes;
|
UInt32 fDownloadBytes;
|
||||||
|
|
||||||
bool fDirtySums;
|
bool fDirtySums;
|
||||||
|
|
||||||
LogFunc fLog;
|
LogFunc fLog;
|
||||||
|
|
||||||
bool IDecompressSound(plManifestFile* file);
|
bool IDecompressSound(plManifestFile* file);
|
||||||
|
|
||||||
plManifestFile* IFindFile(const char* name);
|
plManifestFile* IFindFile(const char* name);
|
||||||
|
|
||||||
const char* IGetCacheDir();
|
const char* IGetCacheDir();
|
||||||
void IReadCache(ProgressFunc progress);
|
void IReadCache(ProgressFunc progress);
|
||||||
void IWriteCache();
|
void IWriteCache();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plManifest(LogFunc log);
|
plManifest(LogFunc log);
|
||||||
~plManifest();
|
~plManifest();
|
||||||
|
|
||||||
bool Read(hsStream* mfsStream, const char* basePath, const char* mfsName);
|
bool Read(hsStream* mfsStream, const char* basePath, const char* mfsName);
|
||||||
|
|
||||||
void ValidateFiles(ProgressFunc progress);
|
void ValidateFiles(ProgressFunc progress);
|
||||||
void DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber);
|
void DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber);
|
||||||
|
|
||||||
int NumFiles() { return fFiles.size(); }
|
int NumFiles() { return fFiles.size(); }
|
||||||
UInt32 NumDownloadFiles() { return fDownloadFiles; }
|
UInt32 NumDownloadFiles() { return fDownloadFiles; }
|
||||||
UInt32 DownloadSize() { return fDownloadBytes; }
|
UInt32 DownloadSize() { return fDownloadBytes; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // plManifest_h_inc
|
#endif // plManifest_h_inc
|
@ -1,79 +1,79 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "plPlasmaServers.h"
|
#include "plPlasmaServers.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
|
|
||||||
bool plPlasmaServers::GetServerInfo()
|
bool plPlasmaServers::GetServerInfo()
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
hsUNIXStream si;
|
hsUNIXStream si;
|
||||||
if (si.Open("\\\\dirtcake\\ServerInfo\\ServerInfo.txt", "rb"))
|
if (si.Open("\\\\dirtcake\\ServerInfo\\ServerInfo.txt", "rb"))
|
||||||
{
|
{
|
||||||
char line[256];
|
char line[256];
|
||||||
|
|
||||||
// Make sure we've got the latest version
|
// Make sure we've got the latest version
|
||||||
if (si.ReadLn(line, sizeof(line)))
|
if (si.ReadLn(line, sizeof(line)))
|
||||||
{
|
{
|
||||||
int version = atoi(line);
|
int version = atoi(line);
|
||||||
si.ReadLn(line, sizeof(line));
|
si.ReadLn(line, sizeof(line));
|
||||||
if (version != 4)
|
if (version != 4)
|
||||||
{
|
{
|
||||||
char errorMsg[512];
|
char errorMsg[512];
|
||||||
sprintf(errorMsg, "This installer is out of date.\nPlease get the latest version from:\n\n%s", line);
|
sprintf(errorMsg, "This installer is out of date.\nPlease get the latest version from:\n\n%s", line);
|
||||||
hsMessageBox(errorMsg, "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
hsMessageBox(errorMsg, "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret = false;
|
ret = false;
|
||||||
|
|
||||||
// Read in the servers, one per line
|
// Read in the servers, one per line
|
||||||
while (ret && si.ReadLn(line, sizeof(line)))
|
while (ret && si.ReadLn(line, sizeof(line)))
|
||||||
{
|
{
|
||||||
ServerInfo info;
|
ServerInfo info;
|
||||||
|
|
||||||
info.fServerAddress = strtok(line, ",");
|
info.fServerAddress = strtok(line, ",");
|
||||||
info.fServerName = strtok(nil, ",");
|
info.fServerName = strtok(nil, ",");
|
||||||
info.fURLBase = strtok(nil, ",");
|
info.fURLBase = strtok(nil, ",");
|
||||||
info.fOutputDir = strtok(nil, ",");
|
info.fOutputDir = strtok(nil, ",");
|
||||||
info.fCurrentDir = strtok(nil, ",");
|
info.fCurrentDir = strtok(nil, ",");
|
||||||
info.fCodeDir = strtok(nil, ",");
|
info.fCodeDir = strtok(nil, ",");
|
||||||
|
|
||||||
fServers.push_back(info);
|
fServers.push_back(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
si.Close();
|
si.Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hsMessageBox("Couldn't find server info", "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
hsMessageBox("Couldn't find server info", "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#ifndef plPlasmaServers_h_inc
|
#ifndef plPlasmaServers_h_inc
|
||||||
#define plPlasmaServers_h_inc
|
#define plPlasmaServers_h_inc
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class plPlasmaServers
|
class plPlasmaServers
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
class ServerInfo
|
class ServerInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string fServerAddress;
|
std::string fServerAddress;
|
||||||
std::string fServerName;
|
std::string fServerName;
|
||||||
std::string fURLBase;
|
std::string fURLBase;
|
||||||
std::string fOutputDir;
|
std::string fOutputDir;
|
||||||
std::string fCurrentDir;
|
std::string fCurrentDir;
|
||||||
std::string fCodeDir;
|
std::string fCodeDir;
|
||||||
};
|
};
|
||||||
std::vector<ServerInfo> fServers;
|
std::vector<ServerInfo> fServers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool GetServerInfo();
|
bool GetServerInfo();
|
||||||
|
|
||||||
int GetNumServers() { return fServers.size(); }
|
int GetNumServers() { return fServers.size(); }
|
||||||
std::string& GetServerAddress(int i) { return fServers[i].fServerAddress; }
|
std::string& GetServerAddress(int i) { return fServers[i].fServerAddress; }
|
||||||
std::string& GetServerName(int i) { return fServers[i].fServerName; }
|
std::string& GetServerName(int i) { return fServers[i].fServerName; }
|
||||||
std::string& GetServerURLBase(int i) { return fServers[i].fURLBase; }
|
std::string& GetServerURLBase(int i) { return fServers[i].fURLBase; }
|
||||||
std::string& GetServerOutputDir(int i) { return fServers[i].fOutputDir; }
|
std::string& GetServerOutputDir(int i) { return fServers[i].fOutputDir; }
|
||||||
std::string& GetServerCurrentDir(int i) { return fServers[i].fCurrentDir; }
|
std::string& GetServerCurrentDir(int i) { return fServers[i].fCurrentDir; }
|
||||||
std::string& GetServerCodeDir(int i) { return fServers[i].fCodeDir; }
|
std::string& GetServerCodeDir(int i) { return fServers[i].fCodeDir; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // plPlasmaServers_h_inc
|
#endif // plPlasmaServers_h_inc
|
||||||
|
@ -1,499 +1,499 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "plPlasmaUpdate.h"
|
#include "plPlasmaUpdate.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include "jvCoreUtil.h"
|
#include "jvCoreUtil.h"
|
||||||
#include "jvDialogResizer.h"
|
#include "jvDialogResizer.h"
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "../plFile/plFileUtils.h"
|
#include "../plFile/plFileUtils.h"
|
||||||
#include "../plUnifiedTime/plUnifiedTime.h"
|
#include "../plUnifiedTime/plUnifiedTime.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
#include "plManifest.h"
|
#include "plManifest.h"
|
||||||
#include "hsUtils.h"
|
#include "hsUtils.h"
|
||||||
#include "../plStatusLog/plStatusLog.h"
|
#include "../plStatusLog/plStatusLog.h"
|
||||||
|
|
||||||
static plPlasmaUpdate* gInst = nil;
|
static plPlasmaUpdate* gInst = nil;
|
||||||
|
|
||||||
#define WM_UPDATE_SERVER WM_APP+1
|
#define WM_UPDATE_SERVER WM_APP+1
|
||||||
|
|
||||||
std::string plPlasmaUpdate::fUserName = "dataserver";
|
std::string plPlasmaUpdate::fUserName = "dataserver";
|
||||||
std::string plPlasmaUpdate::fPassword = "parabledata";
|
std::string plPlasmaUpdate::fPassword = "parabledata";
|
||||||
|
|
||||||
plPlasmaUpdate::plPlasmaUpdate() : fCanExit(true), fProgressType(kValidating), fResizer(nil), fAutoDownload(false)
|
plPlasmaUpdate::plPlasmaUpdate() : fCanExit(true), fProgressType(kValidating), fResizer(nil), fAutoDownload(false)
|
||||||
{
|
{
|
||||||
INITCOMMONCONTROLSEX icc = {0};
|
INITCOMMONCONTROLSEX icc = {0};
|
||||||
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||||
icc.dwICC = ICC_PROGRESS_CLASS;
|
icc.dwICC = ICC_PROGRESS_CLASS;
|
||||||
InitCommonControlsEx(&icc);
|
InitCommonControlsEx(&icc);
|
||||||
gInst = this;
|
gInst = this;
|
||||||
|
|
||||||
_getcwd(fIniPath, sizeof(fIniPath));
|
_getcwd(fIniPath, sizeof(fIniPath));
|
||||||
char lastChar = fIniPath[strlen(fIniPath)];
|
char lastChar = fIniPath[strlen(fIniPath)];
|
||||||
if (lastChar != '\\' && lastChar != '/')
|
if (lastChar != '\\' && lastChar != '/')
|
||||||
strcat(fIniPath, "\\");
|
strcat(fIniPath, "\\");
|
||||||
strcat(fIniPath, "ParableUpdate.ini");
|
strcat(fIniPath, "ParableUpdate.ini");
|
||||||
|
|
||||||
fFileGrabber = new plNetShareFileGrabber;
|
fFileGrabber = new plNetShareFileGrabber;
|
||||||
}
|
}
|
||||||
|
|
||||||
plPlasmaUpdate::~plPlasmaUpdate()
|
plPlasmaUpdate::~plPlasmaUpdate()
|
||||||
{
|
{
|
||||||
delete fResizer;
|
delete fResizer;
|
||||||
if (fFileGrabber)
|
if (fFileGrabber)
|
||||||
delete fFileGrabber;
|
delete fFileGrabber;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plPlasmaUpdate::Create()
|
bool plPlasmaUpdate::Create()
|
||||||
{
|
{
|
||||||
if (!fServers.GetServerInfo())
|
if (!fServers.GetServerInfo())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ICreateDialog(IDD_UPDATE, NULL);
|
ICreateDialog(IDD_UPDATE, NULL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CALLBACK plPlasmaUpdate::ILoginWinProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
BOOL CALLBACK plPlasmaUpdate::ILoginWinProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch( msg )
|
switch( msg )
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
SetFocus(GetDlgItem(hDlg, IDC_USERNAME));
|
SetFocus(GetDlgItem(hDlg, IDC_USERNAME));
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL))
|
if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL))
|
||||||
{
|
{
|
||||||
bool ok = (LOWORD(wParam) == IDOK);
|
bool ok = (LOWORD(wParam) == IDOK);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
char username[25];
|
char username[25];
|
||||||
char password[25];
|
char password[25];
|
||||||
|
|
||||||
GetDlgItemText(hDlg, IDC_USERNAME, username, 25);
|
GetDlgItemText(hDlg, IDC_USERNAME, username, 25);
|
||||||
GetDlgItemText(hDlg, IDC_PASSWORD, password, 25);
|
GetDlgItemText(hDlg, IDC_PASSWORD, password, 25);
|
||||||
|
|
||||||
fUserName = username;
|
fUserName = username;
|
||||||
hsAssert(false, "who uses this program?");
|
hsAssert(false, "who uses this program?");
|
||||||
// plChallengeResponse::HashPassword(password, fPassword);
|
// plChallengeResponse::HashPassword(password, fPassword);
|
||||||
}
|
}
|
||||||
EndDialog(hDlg, ok);
|
EndDialog(hDlg, ok);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IInit()
|
void plPlasmaUpdate::IInit()
|
||||||
{
|
{
|
||||||
char curServerAddress[256];
|
char curServerAddress[256];
|
||||||
GetPrivateProfileString("PlasmaUpdate", "ServerAddress", "", curServerAddress, sizeof(curServerAddress), fIniPath);
|
GetPrivateProfileString("PlasmaUpdate", "ServerAddress", "", curServerAddress, sizeof(curServerAddress), fIniPath);
|
||||||
bool external = (GetPrivateProfileInt("PlasmaUpdate", "External", 0, fIniPath) != 0);
|
bool external = (GetPrivateProfileInt("PlasmaUpdate", "External", 0, fIniPath) != 0);
|
||||||
|
|
||||||
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||||
|
|
||||||
for (int i = 0; i < fServers.GetNumServers(); i++)
|
for (int i = 0; i < fServers.GetNumServers(); i++)
|
||||||
{
|
{
|
||||||
std::string& serverAddress = fServers.GetServerAddress(i);
|
std::string& serverAddress = fServers.GetServerAddress(i);
|
||||||
std::string& serverName = fServers.GetServerName(i);
|
std::string& serverName = fServers.GetServerName(i);
|
||||||
std::string& currentDir = fServers.GetServerCurrentDir(i);
|
std::string& currentDir = fServers.GetServerCurrentDir(i);
|
||||||
|
|
||||||
if (!fFileGrabber->IsServerAvailable(serverAddress.c_str(), currentDir.c_str()))
|
if (!fFileGrabber->IsServerAvailable(serverAddress.c_str(), currentDir.c_str()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool thisServer = (serverAddress == curServerAddress);
|
bool thisServer = (serverAddress == curServerAddress);
|
||||||
|
|
||||||
int idx = ComboBox_AddString(hCombo, serverName.c_str());
|
int idx = ComboBox_AddString(hCombo, serverName.c_str());
|
||||||
ComboBox_SetItemData(hCombo, idx, MAKELPARAM(i, 0));
|
ComboBox_SetItemData(hCombo, idx, MAKELPARAM(i, 0));
|
||||||
if (thisServer && !external)
|
if (thisServer && !external)
|
||||||
ComboBox_SetCurSel(hCombo, idx);
|
ComboBox_SetCurSel(hCombo, idx);
|
||||||
|
|
||||||
std::string extName = serverName + " (External)";
|
std::string extName = serverName + " (External)";
|
||||||
idx = ComboBox_AddString(hCombo, extName.c_str());
|
idx = ComboBox_AddString(hCombo, extName.c_str());
|
||||||
ComboBox_SetItemData(hCombo, idx, MAKELPARAM(i, 1));
|
ComboBox_SetItemData(hCombo, idx, MAKELPARAM(i, 1));
|
||||||
if (thisServer && external)
|
if (thisServer && external)
|
||||||
ComboBox_SetCurSel(hCombo, idx);
|
ComboBox_SetCurSel(hCombo, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ComboBox_GetCurSel(hCombo) == -1)
|
if (ComboBox_GetCurSel(hCombo) == -1)
|
||||||
ComboBox_SetCurSel(hCombo, 0);
|
ComboBox_SetCurSel(hCombo, 0);
|
||||||
|
|
||||||
SendMessage(fDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(jvCoreUtil::GetHInstance(), MAKEINTRESOURCE(IDI_ICON)));
|
SendMessage(fDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(jvCoreUtil::GetHInstance(), MAKEINTRESOURCE(IDI_ICON)));
|
||||||
SendMessage(fDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(jvCoreUtil::GetHInstance(), MAKEINTRESOURCE(IDI_ICON)));
|
SendMessage(fDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(jvCoreUtil::GetHInstance(), MAKEINTRESOURCE(IDI_ICON)));
|
||||||
|
|
||||||
fResizer = new jvDialogResizer(fDlg);
|
fResizer = new jvDialogResizer(fDlg);
|
||||||
fResizer->AddControl(IDC_BUILD_COMBO, jvDialogResizer::kResizeX);
|
fResizer->AddControl(IDC_BUILD_COMBO, jvDialogResizer::kResizeX);
|
||||||
fResizer->AddControl(IDC_STATUS_LIST, jvDialogResizer::kResizeX | jvDialogResizer::kResizeY);
|
fResizer->AddControl(IDC_STATUS_LIST, jvDialogResizer::kResizeX | jvDialogResizer::kResizeY);
|
||||||
fResizer->AddControl(IDC_PROGRESS, jvDialogResizer::kLockBottom | jvDialogResizer::kResizeX);
|
fResizer->AddControl(IDC_PROGRESS, jvDialogResizer::kLockBottom | jvDialogResizer::kResizeX);
|
||||||
fResizer->AddControl(IDC_DL_TEXT, jvDialogResizer::kLockBottom | jvDialogResizer::kResizeX);
|
fResizer->AddControl(IDC_DL_TEXT, jvDialogResizer::kLockBottom | jvDialogResizer::kResizeX);
|
||||||
fResizer->AddControl(IDC_DL_BUTTON, jvDialogResizer::kLockBottom | jvDialogResizer::kCenterX);
|
fResizer->AddControl(IDC_DL_BUTTON, jvDialogResizer::kLockBottom | jvDialogResizer::kCenterX);
|
||||||
fResizer->SetSize(360, 320);
|
fResizer->SetSize(360, 320);
|
||||||
fResizer->LoadPosAndSize("PlasmaUpdate");
|
fResizer->LoadPosAndSize("PlasmaUpdate");
|
||||||
|
|
||||||
bool goTime = true;
|
bool goTime = true;
|
||||||
if (fFileGrabber->NeedsAuth())
|
if (fFileGrabber->NeedsAuth())
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if (!DialogBox(NULL, MAKEINTRESOURCE(IDD_PLASMAUPDATE_LOGIN), fDlg, ILoginWinProc))
|
if (!DialogBox(NULL, MAKEINTRESOURCE(IDD_PLASMAUPDATE_LOGIN), fDlg, ILoginWinProc))
|
||||||
goTime = false;
|
goTime = false;
|
||||||
else
|
else
|
||||||
*/
|
*/
|
||||||
fFileGrabber->SetUsernamePassword(fUserName, fPassword);
|
fFileGrabber->SetUsernamePassword(fUserName, fPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goTime)
|
if (goTime)
|
||||||
{
|
{
|
||||||
ShowWindow(fDlg, SW_SHOW);
|
ShowWindow(fDlg, SW_SHOW);
|
||||||
PostMessage(fDlg, WM_UPDATE_SERVER, 0, 0);
|
PostMessage(fDlg, WM_UPDATE_SERVER, 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IShutdown()
|
void plPlasmaUpdate::IShutdown()
|
||||||
{
|
{
|
||||||
fResizer->SavePosAndSize("PlasmaUpdate");
|
fResizer->SavePosAndSize("PlasmaUpdate");
|
||||||
delete fResizer;
|
delete fResizer;
|
||||||
fResizer = NULL;
|
fResizer = NULL;
|
||||||
|
|
||||||
IDeleteManifests();
|
IDeleteManifests();
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IEnableCtrls(bool enable)
|
void plPlasmaUpdate::IEnableCtrls(bool enable)
|
||||||
{
|
{
|
||||||
fCanExit = enable;
|
fCanExit = enable;
|
||||||
EnableWindow(GetDlgItem(fDlg, IDC_BUILD_COMBO), enable);
|
EnableWindow(GetDlgItem(fDlg, IDC_BUILD_COMBO), enable);
|
||||||
|
|
||||||
HWND hDlButton = GetDlgItem(fDlg, IDC_DL_BUTTON);
|
HWND hDlButton = GetDlgItem(fDlg, IDC_DL_BUTTON);
|
||||||
|
|
||||||
if (fManifests.empty())
|
if (fManifests.empty())
|
||||||
SetWindowText(hDlButton, "Close");
|
SetWindowText(hDlButton, "Close");
|
||||||
else
|
else
|
||||||
SetWindowText(hDlButton, "Download");
|
SetWindowText(hDlButton, "Download");
|
||||||
|
|
||||||
EnableWindow(hDlButton, enable);
|
EnableWindow(hDlButton, enable);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
SetFocus(hDlButton);
|
SetFocus(hDlButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IDeleteManifests()
|
void plPlasmaUpdate::IDeleteManifests()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < fManifests.size(); i++)
|
for (int i = 0; i < fManifests.size(); i++)
|
||||||
delete fManifests[i];
|
delete fManifests[i];
|
||||||
fManifests.clear();
|
fManifests.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plPlasmaUpdate::IGetManifests(const char* serverRoot, bool external)
|
bool plPlasmaUpdate::IGetManifests(const char* serverRoot, bool external)
|
||||||
{
|
{
|
||||||
IDeleteManifests();
|
IDeleteManifests();
|
||||||
|
|
||||||
char filePath[MAX_PATH];
|
char filePath[MAX_PATH];
|
||||||
sprintf(filePath, "%sCurrent.txt", serverRoot);
|
sprintf(filePath, "%sCurrent.txt", serverRoot);
|
||||||
|
|
||||||
enum Sections
|
enum Sections
|
||||||
{
|
{
|
||||||
kVersion,
|
kVersion,
|
||||||
kInternal,
|
kInternal,
|
||||||
kExternal,
|
kExternal,
|
||||||
kAll
|
kAll
|
||||||
};
|
};
|
||||||
int curSection = kVersion;
|
int curSection = kVersion;
|
||||||
|
|
||||||
hsRAMStream s;
|
hsRAMStream s;
|
||||||
hsRAMStream manifestStream;
|
hsRAMStream manifestStream;
|
||||||
|
|
||||||
if (fFileGrabber->FileToStream(filePath, &s))
|
if (fFileGrabber->FileToStream(filePath, &s))
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
while (s.ReadLn(buf, sizeof(buf)))
|
while (s.ReadLn(buf, sizeof(buf)))
|
||||||
{
|
{
|
||||||
if (buf[0] == '[')
|
if (buf[0] == '[')
|
||||||
{
|
{
|
||||||
if (hsStrEQ(buf, "[Version]"))
|
if (hsStrEQ(buf, "[Version]"))
|
||||||
curSection = kVersion;
|
curSection = kVersion;
|
||||||
else if (hsStrEQ(buf, "[Internal]"))
|
else if (hsStrEQ(buf, "[Internal]"))
|
||||||
curSection = kInternal;
|
curSection = kInternal;
|
||||||
else if (hsStrEQ(buf, "[External]"))
|
else if (hsStrEQ(buf, "[External]"))
|
||||||
curSection = kExternal;
|
curSection = kExternal;
|
||||||
else if (hsStrEQ(buf, "[All]"))
|
else if (hsStrEQ(buf, "[All]"))
|
||||||
curSection = kAll;
|
curSection = kAll;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (curSection == kVersion)
|
if (curSection == kVersion)
|
||||||
{
|
{
|
||||||
int version = atoi(buf);
|
int version = atoi(buf);
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
{
|
{
|
||||||
hsMessageBox("Your copy of PlasmaUpdate is out of date.\nPlease get the latest version.", "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
hsMessageBox("Your copy of PlasmaUpdate is out of date.\nPlease get the latest version.", "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((!external && curSection == kInternal)
|
else if ((!external && curSection == kInternal)
|
||||||
|| (external && curSection == kExternal)
|
|| (external && curSection == kExternal)
|
||||||
|| curSection == kAll)
|
|| curSection == kAll)
|
||||||
{
|
{
|
||||||
//if (curSection == kAll && !(!strcmp(buf, "Data\\Movies.mfs") || !strcmp(buf, "Data\\Sounds.mfs")))
|
//if (curSection == kAll && !(!strcmp(buf, "Data\\Movies.mfs") || !strcmp(buf, "Data\\Sounds.mfs")))
|
||||||
// continue;
|
// continue;
|
||||||
|
|
||||||
sprintf(filePath, "%s%s", serverRoot, buf);
|
sprintf(filePath, "%s%s", serverRoot, buf);
|
||||||
|
|
||||||
fFileGrabber->MakeProperPath(filePath);
|
fFileGrabber->MakeProperPath(filePath);
|
||||||
|
|
||||||
manifestStream.Reset();
|
manifestStream.Reset();
|
||||||
fFileGrabber->FileToStream(filePath, &manifestStream);
|
fFileGrabber->FileToStream(filePath, &manifestStream);
|
||||||
|
|
||||||
plFileUtils::StripFile(filePath);
|
plFileUtils::StripFile(filePath);
|
||||||
|
|
||||||
plManifest* manifest = new plManifest(ILog);
|
plManifest* manifest = new plManifest(ILog);
|
||||||
manifest->Read(&manifestStream, filePath, buf);
|
manifest->Read(&manifestStream, filePath, buf);
|
||||||
fManifests.push_back(manifest);
|
fManifests.push_back(manifest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IUpdateServer()
|
void plPlasmaUpdate::IUpdateServer()
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
IEnableCtrls(false);
|
IEnableCtrls(false);
|
||||||
|
|
||||||
SetDlgItemText(fDlg, IDC_DL_TEXT, "Checking for updates...");
|
SetDlgItemText(fDlg, IDC_DL_TEXT, "Checking for updates...");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Figure out what server we're checking
|
// Figure out what server we're checking
|
||||||
//
|
//
|
||||||
bool external = false;
|
bool external = false;
|
||||||
char serverRoot[MAX_PATH];
|
char serverRoot[MAX_PATH];
|
||||||
|
|
||||||
{
|
{
|
||||||
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||||
int idx = ComboBox_GetCurSel(hCombo);
|
int idx = ComboBox_GetCurSel(hCombo);
|
||||||
LPARAM data = ComboBox_GetItemData(hCombo, idx);
|
LPARAM data = ComboBox_GetItemData(hCombo, idx);
|
||||||
int server = LOWORD(data);
|
int server = LOWORD(data);
|
||||||
external = (HIWORD(data) != 0);
|
external = (HIWORD(data) != 0);
|
||||||
|
|
||||||
sprintf(serverRoot, "/%s/", fServers.GetServerCurrentDir(server).c_str());
|
sprintf(serverRoot, "/%s/", fServers.GetServerCurrentDir(server).c_str());
|
||||||
const char* serverName = fServers.GetServerAddress(server).c_str();
|
const char* serverName = fServers.GetServerAddress(server).c_str();
|
||||||
|
|
||||||
ILog("===== Server set to %s %s =====", serverName, external ? "external" : "internal");
|
ILog("===== Server set to %s %s =====", serverName, external ? "external" : "internal");
|
||||||
|
|
||||||
WritePrivateProfileString("PlasmaUpdate", "ServerAddress", serverName, fIniPath);
|
WritePrivateProfileString("PlasmaUpdate", "ServerAddress", serverName, fIniPath);
|
||||||
WritePrivateProfileString("PlasmaUpdate", "External", external ? "1" : "0", fIniPath);
|
WritePrivateProfileString("PlasmaUpdate", "External", external ? "1" : "0", fIniPath);
|
||||||
|
|
||||||
fFileGrabber->SetServer(serverName);
|
fFileGrabber->SetServer(serverName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the latest publish notes
|
// Get the latest publish notes
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
HWND hList = GetDlgItem(fDlg, IDC_STATUS_LIST);
|
HWND hList = GetDlgItem(fDlg, IDC_STATUS_LIST);
|
||||||
ListBox_ResetContent(hList);
|
ListBox_ResetContent(hList);
|
||||||
|
|
||||||
char updateFile[MAX_PATH];
|
char updateFile[MAX_PATH];
|
||||||
if (external)
|
if (external)
|
||||||
sprintf(updateFile, "%sUpdates-External.txt", serverRoot);
|
sprintf(updateFile, "%sUpdates-External.txt", serverRoot);
|
||||||
else
|
else
|
||||||
sprintf(updateFile, "%sUpdates-Internal.txt", serverRoot);
|
sprintf(updateFile, "%sUpdates-Internal.txt", serverRoot);
|
||||||
|
|
||||||
hsRAMStream updates;
|
hsRAMStream updates;
|
||||||
fFileGrabber->MakeProperPath(updateFile);
|
fFileGrabber->MakeProperPath(updateFile);
|
||||||
if (fFileGrabber->FileToStream(updateFile, &updates))
|
if (fFileGrabber->FileToStream(updateFile, &updates))
|
||||||
{
|
{
|
||||||
while (updates.ReadLn(buf, sizeof(buf)))
|
while (updates.ReadLn(buf, sizeof(buf)))
|
||||||
ListBox_InsertString(hList, 0, buf);
|
ListBox_InsertString(hList, 0, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the manifests
|
// Get the manifests
|
||||||
//
|
//
|
||||||
bool gotManifests = IGetManifests(serverRoot, external);
|
bool gotManifests = IGetManifests(serverRoot, external);
|
||||||
UInt32 dlSize = 0;
|
UInt32 dlSize = 0;
|
||||||
|
|
||||||
fProgressType = kValidating;
|
fProgressType = kValidating;
|
||||||
|
|
||||||
if (gotManifests)
|
if (gotManifests)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
UInt32 numFiles = 0;
|
UInt32 numFiles = 0;
|
||||||
for (i = 0; i < fManifests.size(); i++)
|
for (i = 0; i < fManifests.size(); i++)
|
||||||
numFiles += fManifests[i]->NumFiles();
|
numFiles += fManifests[i]->NumFiles();
|
||||||
|
|
||||||
HWND hProgress = GetDlgItem(fDlg, IDC_PROGRESS);
|
HWND hProgress = GetDlgItem(fDlg, IDC_PROGRESS);
|
||||||
SendMessage(hProgress, PBM_SETRANGE32, 0, numFiles);
|
SendMessage(hProgress, PBM_SETRANGE32, 0, numFiles);
|
||||||
|
|
||||||
for (i = 0; i < fManifests.size(); i++)
|
for (i = 0; i < fManifests.size(); i++)
|
||||||
{
|
{
|
||||||
fManifests[i]->ValidateFiles(ProgressFunc);
|
fManifests[i]->ValidateFiles(ProgressFunc);
|
||||||
dlSize += fManifests[i]->DownloadSize();
|
dlSize += fManifests[i]->DownloadSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print how many megs there are to download
|
// Print how many megs there are to download
|
||||||
if (dlSize == 0)
|
if (dlSize == 0)
|
||||||
{
|
{
|
||||||
strcpy(buf, "No updates to download");
|
strcpy(buf, "No updates to download");
|
||||||
IDeleteManifests();
|
IDeleteManifests();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float dlMegs = float(dlSize) / (1024.f*1024.f);
|
float dlMegs = float(dlSize) / (1024.f*1024.f);
|
||||||
if (dlMegs < .1)
|
if (dlMegs < .1)
|
||||||
dlMegs = .1;
|
dlMegs = .1;
|
||||||
sprintf(buf, "%.1f MB of updates to download", dlMegs);
|
sprintf(buf, "%.1f MB of updates to download", dlMegs);
|
||||||
}
|
}
|
||||||
SetDlgItemText(fDlg, IDC_DL_TEXT, buf);
|
SetDlgItemText(fDlg, IDC_DL_TEXT, buf);
|
||||||
|
|
||||||
IEnableCtrls(true);
|
IEnableCtrls(true);
|
||||||
|
|
||||||
if (fAutoDownload)
|
if (fAutoDownload)
|
||||||
PostMessage(fDlg, WM_COMMAND, MAKEWPARAM(IDC_DL_BUTTON, BN_CLICKED), LPARAM(GetDlgItem(fDlg, IDC_DL_BUTTON)));
|
PostMessage(fDlg, WM_COMMAND, MAKEWPARAM(IDC_DL_BUTTON, BN_CLICKED), LPARAM(GetDlgItem(fDlg, IDC_DL_BUTTON)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::IDownloadUpdates()
|
void plPlasmaUpdate::IDownloadUpdates()
|
||||||
{
|
{
|
||||||
fProgressType = kDownloading;
|
fProgressType = kDownloading;
|
||||||
|
|
||||||
IEnableCtrls(false);
|
IEnableCtrls(false);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
UInt32 dlSize = 0;
|
UInt32 dlSize = 0;
|
||||||
for (i = 0; i < fManifests.size(); i++)
|
for (i = 0; i < fManifests.size(); i++)
|
||||||
dlSize += fManifests[i]->DownloadSize();
|
dlSize += fManifests[i]->DownloadSize();
|
||||||
|
|
||||||
HWND hProgress = GetDlgItem(fDlg, IDC_PROGRESS);
|
HWND hProgress = GetDlgItem(fDlg, IDC_PROGRESS);
|
||||||
SendMessage(hProgress, PBM_SETRANGE32, 0, dlSize);
|
SendMessage(hProgress, PBM_SETRANGE32, 0, dlSize);
|
||||||
|
|
||||||
for (i = 0; i < fManifests.size(); i++)
|
for (i = 0; i < fManifests.size(); i++)
|
||||||
fManifests[i]->DownloadUpdates(ProgressFunc, fFileGrabber);
|
fManifests[i]->DownloadUpdates(ProgressFunc, fFileGrabber);
|
||||||
|
|
||||||
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(fDlg, IDC_DL_BUTTON), false);
|
EnableWindow(GetDlgItem(fDlg, IDC_DL_BUTTON), false);
|
||||||
SetDlgItemText(fDlg, IDC_DL_TEXT, "No updates to download");
|
SetDlgItemText(fDlg, IDC_DL_TEXT, "No updates to download");
|
||||||
|
|
||||||
IDeleteManifests();
|
IDeleteManifests();
|
||||||
|
|
||||||
IEnableCtrls(true);
|
IEnableCtrls(true);
|
||||||
|
|
||||||
if (fAutoDownload)
|
if (fAutoDownload)
|
||||||
PostMessage(fDlg, WM_COMMAND, MAKEWPARAM(IDC_DL_BUTTON, BN_CLICKED), LPARAM(GetDlgItem(fDlg, IDC_DL_BUTTON)));
|
PostMessage(fDlg, WM_COMMAND, MAKEWPARAM(IDC_DL_BUTTON, BN_CLICKED), LPARAM(GetDlgItem(fDlg, IDC_DL_BUTTON)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::ProgressFunc(const char* name, int delta)
|
void plPlasmaUpdate::ProgressFunc(const char* name, int delta)
|
||||||
{
|
{
|
||||||
static const char* lastName = nil;
|
static const char* lastName = nil;
|
||||||
if (lastName != name)
|
if (lastName != name)
|
||||||
{
|
{
|
||||||
lastName = name;
|
lastName = name;
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
if (gInst->fProgressType == kValidating)
|
if (gInst->fProgressType == kValidating)
|
||||||
strcpy(buf, "Checking ");
|
strcpy(buf, "Checking ");
|
||||||
else
|
else
|
||||||
strcpy(buf, "Downloading ");
|
strcpy(buf, "Downloading ");
|
||||||
strcat(buf, name);
|
strcat(buf, name);
|
||||||
|
|
||||||
SetDlgItemText(gInst->fDlg, IDC_DL_TEXT, buf);
|
SetDlgItemText(gInst->fDlg, IDC_DL_TEXT, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendDlgItemMessage(gInst->fDlg, IDC_PROGRESS, PBM_DELTAPOS, delta, 0);
|
SendDlgItemMessage(gInst->fDlg, IDC_PROGRESS, PBM_DELTAPOS, delta, 0);
|
||||||
|
|
||||||
jvBaseDlg::PumpQueue();
|
jvBaseDlg::PumpQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void plPlasmaUpdate::ILog(const char* format, ...)
|
void plPlasmaUpdate::ILog(const char* format, ...)
|
||||||
{
|
{
|
||||||
static plStatusLog* log = nil;
|
static plStatusLog* log = nil;
|
||||||
|
|
||||||
if (!log)
|
if (!log)
|
||||||
log = plStatusLogMgr::GetInstance().CreateStatusLog(0, "PlasmaUpdate.log");
|
log = plStatusLogMgr::GetInstance().CreateStatusLog(0, "PlasmaUpdate.log");
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
log->AddLineV(format, args);
|
log->AddLineV(format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL plPlasmaUpdate::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
BOOL plPlasmaUpdate::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
IInit();
|
IInit();
|
||||||
SetFocus(GetDlgItem(fDlg, IDC_DL_BUTTON));
|
SetFocus(GetDlgItem(fDlg, IDC_DL_BUTTON));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
if (fCanExit)
|
if (fCanExit)
|
||||||
DestroyWindow(hDlg);
|
DestroyWindow(hDlg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
IShutdown();
|
IShutdown();
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_DL_BUTTON)
|
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_DL_BUTTON)
|
||||||
{
|
{
|
||||||
if (fManifests.empty())
|
if (fManifests.empty())
|
||||||
SendMessage(fDlg, WM_CLOSE, 0, 0);
|
SendMessage(fDlg, WM_CLOSE, 0, 0);
|
||||||
else
|
else
|
||||||
IDownloadUpdates();
|
IDownloadUpdates();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_BUILD_COMBO)
|
else if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_BUILD_COMBO)
|
||||||
{
|
{
|
||||||
IUpdateServer();
|
IUpdateServer();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_UPDATE_SERVER:
|
case WM_UPDATE_SERVER:
|
||||||
IUpdateServer();
|
IUpdateServer();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1,78 +1,78 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "jvBaseDlg.h"
|
#include "jvBaseDlg.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "plPlasmaServers.h"
|
#include "plPlasmaServers.h"
|
||||||
#include "plFileGrabber.h"
|
#include "plFileGrabber.h"
|
||||||
|
|
||||||
class plManifest;
|
class plManifest;
|
||||||
class jvDialogResizer;
|
class jvDialogResizer;
|
||||||
|
|
||||||
class plPlasmaUpdate : public jvBaseDlg
|
class plPlasmaUpdate : public jvBaseDlg
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static BOOL CALLBACK ILoginWinProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
static BOOL CALLBACK ILoginWinProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
static std::string fUserName;
|
static std::string fUserName;
|
||||||
static std::string fPassword;
|
static std::string fPassword;
|
||||||
|
|
||||||
std::vector<plManifest*> fManifests;
|
std::vector<plManifest*> fManifests;
|
||||||
char fIniPath[MAX_PATH];
|
char fIniPath[MAX_PATH];
|
||||||
bool fCanExit;
|
bool fCanExit;
|
||||||
enum ProgressType { kValidating, kDownloading };
|
enum ProgressType { kValidating, kDownloading };
|
||||||
ProgressType fProgressType;
|
ProgressType fProgressType;
|
||||||
jvDialogResizer* fResizer;
|
jvDialogResizer* fResizer;
|
||||||
plPlasmaServers fServers;
|
plPlasmaServers fServers;
|
||||||
bool fAutoDownload;
|
bool fAutoDownload;
|
||||||
plFileGrabber* fFileGrabber;
|
plFileGrabber* fFileGrabber;
|
||||||
|
|
||||||
void IInit();
|
void IInit();
|
||||||
void IShutdown();
|
void IShutdown();
|
||||||
|
|
||||||
bool IReadServerInfo();
|
bool IReadServerInfo();
|
||||||
|
|
||||||
void IEnableCtrls(bool enable);
|
void IEnableCtrls(bool enable);
|
||||||
|
|
||||||
BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
static void ProgressFunc(const char* name, int delta);
|
static void ProgressFunc(const char* name, int delta);
|
||||||
static void ILog(const char* format, ...);
|
static void ILog(const char* format, ...);
|
||||||
|
|
||||||
void IUpdateServer();
|
void IUpdateServer();
|
||||||
|
|
||||||
void IDeleteManifests();
|
void IDeleteManifests();
|
||||||
bool IGetManifests(const char* serverRoot, bool external);
|
bool IGetManifests(const char* serverRoot, bool external);
|
||||||
void IDownloadUpdates();
|
void IDownloadUpdates();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plPlasmaUpdate();
|
plPlasmaUpdate();
|
||||||
virtual ~plPlasmaUpdate();
|
virtual ~plPlasmaUpdate();
|
||||||
|
|
||||||
bool Create();
|
bool Create();
|
||||||
|
|
||||||
void SetAutoDownload() { fAutoDownload = true; }
|
void SetAutoDownload() { fAutoDownload = true; }
|
||||||
};
|
};
|
||||||
|
@ -1,138 +1,138 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include "afxres.h"
|
#include "afxres.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_UPDATE DIALOGEX 0, 0, 128, 105
|
IDD_UPDATE DIALOGEX 0, 0, 128, 105
|
||||||
STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
|
STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
|
||||||
WS_THICKFRAME
|
WS_THICKFRAME
|
||||||
CAPTION "Parable Update"
|
CAPTION "Parable Update"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Build:",IDC_STATIC,7,8,18,8
|
LTEXT "Build:",IDC_STATIC,7,8,18,8
|
||||||
COMBOBOX IDC_BUILD_COMBO,27,6,90,167,CBS_DROPDOWNLIST |
|
COMBOBOX IDC_BUILD_COMBO,27,6,90,167,CBS_DROPDOWNLIST |
|
||||||
WS_VSCROLL | WS_TABSTOP
|
WS_VSCROLL | WS_TABSTOP
|
||||||
DEFPUSHBUTTON "Download",IDC_DL_BUTTON,34,86,56,16,WS_DISABLED
|
DEFPUSHBUTTON "Download",IDC_DL_BUTTON,34,86,56,16,WS_DISABLED
|
||||||
LISTBOX IDC_STATUS_LIST,7,36,110,11,LBS_NOINTEGRALHEIGHT |
|
LISTBOX IDC_STATUS_LIST,7,36,110,11,LBS_NOINTEGRALHEIGHT |
|
||||||
LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
|
LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER |
|
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER |
|
||||||
0x1,7,54,110,16
|
0x1,7,54,110,16
|
||||||
LTEXT "Latest Updates:",IDC_STATIC,7,26,51,8
|
LTEXT "Latest Updates:",IDC_STATIC,7,26,51,8
|
||||||
CONTROL "xx.x MB of updates to download",IDC_DL_TEXT,"Static",
|
CONTROL "xx.x MB of updates to download",IDC_DL_TEXT,"Static",
|
||||||
SS_LEFTNOWORDWRAP | WS_GROUP,7,74,110,8
|
SS_LEFTNOWORDWRAP | WS_GROUP,7,74,110,8
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_PLASMAUPDATE_LOGIN DIALOGEX 0, 0, 150, 102
|
IDD_PLASMAUPDATE_LOGIN DIALOGEX 0, 0, 150, 102
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
|
||||||
WS_SYSMENU
|
WS_SYSMENU
|
||||||
CAPTION "Login"
|
CAPTION "Login"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,48,62,50,14
|
DEFPUSHBUTTON "OK",IDOK,48,62,50,14
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,48,80,50,14
|
PUSHBUTTON "Cancel",IDCANCEL,48,80,50,14
|
||||||
EDITTEXT IDC_USERNAME,7,17,135,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_USERNAME,7,17,135,12,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_PASSWORD,7,45,135,12,ES_PASSWORD | ES_AUTOHSCROLL
|
EDITTEXT IDC_PASSWORD,7,45,135,12,ES_PASSWORD | ES_AUTOHSCROLL
|
||||||
LTEXT "Username",IDC_STATIC,7,7,134,8
|
LTEXT "Username",IDC_STATIC,7,7,134,8
|
||||||
LTEXT "Password",IDC_STATIC,7,35,136,10
|
LTEXT "Password",IDC_STATIC,7,35,136,10
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DESIGNINFO
|
// DESIGNINFO
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO
|
GUIDELINES DESIGNINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_UPDATE, DIALOG
|
IDD_UPDATE, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 121
|
RIGHTMARGIN, 121
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 98
|
BOTTOMMARGIN, 98
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_PLASMAUPDATE_LOGIN, DIALOG
|
IDD_PLASMAUPDATE_LOGIN, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 143
|
RIGHTMARGIN, 143
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 95
|
BOTTOMMARGIN, 95
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""afxres.h""\r\n"
|
"#include ""afxres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
//
|
//
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON ICON "Dirt.ICO"
|
IDI_ICON ICON "Dirt.ICO"
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Visual C++ generated include file.
|
// Microsoft Visual C++ generated include file.
|
||||||
// Used by plPlasmaUpdate.rc
|
// Used by plPlasmaUpdate.rc
|
||||||
//
|
//
|
||||||
#define IDD_UPDATE 101
|
#define IDD_UPDATE 101
|
||||||
#define IDI_ICON1 102
|
#define IDI_ICON1 102
|
||||||
#define IDI_ICON 102
|
#define IDI_ICON 102
|
||||||
#define IDD_PLASMAUPDATE_LOGIN 103
|
#define IDD_PLASMAUPDATE_LOGIN 103
|
||||||
#define IDC_DL_BUTTON 1005
|
#define IDC_DL_BUTTON 1005
|
||||||
#define IDC_STATUS_LIST 1006
|
#define IDC_STATUS_LIST 1006
|
||||||
#define IDC_BUILD_COMBO 1008
|
#define IDC_BUILD_COMBO 1008
|
||||||
#define IDC_PROGRESS 1014
|
#define IDC_PROGRESS 1014
|
||||||
#define IDC_DL_TEXT 1015
|
#define IDC_DL_TEXT 1015
|
||||||
#define IDC_EDIT1 1016
|
#define IDC_EDIT1 1016
|
||||||
#define IDC_USERNAME 1016
|
#define IDC_USERNAME 1016
|
||||||
#define IDC_PASSWORD 1017
|
#define IDC_PASSWORD 1017
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1018
|
#define _APS_NEXT_CONTROL_VALUE 1018
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
include_directories(../../CoreLib)
|
include_directories(../../CoreLib)
|
||||||
include_directories(../../PubUtilLib)
|
include_directories(../../PubUtilLib)
|
||||||
|
|
||||||
include_directories(${PYTHON_INCLUDE_DIR})
|
include_directories(${PYTHON_INCLUDE_DIR})
|
||||||
|
|
||||||
set(plPythonPack_SOURCES
|
set(plPythonPack_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
PythonInterface.cpp
|
PythonInterface.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plPythonPack_HEADERS
|
set(plPythonPack_HEADERS
|
||||||
PythonInterface.h
|
PythonInterface.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS})
|
add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS})
|
||||||
target_link_libraries(plPythonPack CoreLib CoreLibExe plFile)
|
target_link_libraries(plPythonPack CoreLib CoreLibExe plFile)
|
||||||
target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY})
|
target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY})
|
||||||
target_link_libraries(plPythonPack optimized ${PYTHON_LIBRARY})
|
target_link_libraries(plPythonPack optimized ${PYTHON_LIBRARY})
|
||||||
|
|
||||||
source_group("Source Files" FILES ${plPythonPack_SOURCES})
|
source_group("Source Files" FILES ${plPythonPack_SOURCES})
|
||||||
source_group("Header Files" FILES ${plPythonPack_HEADERS})
|
source_group("Header Files" FILES ${plPythonPack_HEADERS})
|
||||||
|
@ -1,285 +1,285 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "PythonInterface.h"
|
#include "PythonInterface.h"
|
||||||
|
|
||||||
#include "compile.h"
|
#include "compile.h"
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "marshal.h"
|
#include "marshal.h"
|
||||||
#include "cStringIO.h"
|
#include "cStringIO.h"
|
||||||
|
|
||||||
static PyObject* stdFile; // python object of the stdout and err file
|
static PyObject* stdFile; // python object of the stdout and err file
|
||||||
|
|
||||||
void PythonInterface::initPython(std::string rootDir)
|
void PythonInterface::initPython(std::string rootDir)
|
||||||
{
|
{
|
||||||
// if haven't been initialized then do it
|
// if haven't been initialized then do it
|
||||||
if ( Py_IsInitialized() == 0 )
|
if ( Py_IsInitialized() == 0 )
|
||||||
{
|
{
|
||||||
// initialize the Python stuff
|
// initialize the Python stuff
|
||||||
// let Python do some intialization...
|
// let Python do some intialization...
|
||||||
Py_SetProgramName("plasma");
|
Py_SetProgramName("plasma");
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
|
||||||
// intialize any of our special plasma python modules
|
// intialize any of our special plasma python modules
|
||||||
// initP2PInterface();
|
// initP2PInterface();
|
||||||
// save object to the Plasma module
|
// save object to the Plasma module
|
||||||
// plasmaMod = PyImport_ImportModule("Plasma");
|
// plasmaMod = PyImport_ImportModule("Plasma");
|
||||||
|
|
||||||
// create the StringIO for the stdout and stderr file
|
// create the StringIO for the stdout and stderr file
|
||||||
PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", "cStringIO_CAPI");
|
PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", "cStringIO_CAPI");
|
||||||
stdFile = (*PycStringIO->NewOutput)(20000);
|
stdFile = (*PycStringIO->NewOutput)(20000);
|
||||||
// if we need the builtins then find the builtin module
|
// if we need the builtins then find the builtin module
|
||||||
PyObject* sysmod = PyImport_ImportModule("sys");
|
PyObject* sysmod = PyImport_ImportModule("sys");
|
||||||
// then add the builtin dicitionary to our module's dictionary
|
// then add the builtin dicitionary to our module's dictionary
|
||||||
if (sysmod != NULL )
|
if (sysmod != NULL )
|
||||||
{
|
{
|
||||||
// get the sys's dictionary to find the stdout and stderr
|
// get the sys's dictionary to find the stdout and stderr
|
||||||
PyObject* sys_dict = PyModule_GetDict(sysmod);
|
PyObject* sys_dict = PyModule_GetDict(sysmod);
|
||||||
if (stdFile != nil)
|
if (stdFile != nil)
|
||||||
{
|
{
|
||||||
PyDict_SetItemString(sys_dict,"stdout", stdFile);
|
PyDict_SetItemString(sys_dict,"stdout", stdFile);
|
||||||
PyDict_SetItemString(sys_dict,"stderr", stdFile);
|
PyDict_SetItemString(sys_dict,"stderr", stdFile);
|
||||||
}
|
}
|
||||||
// NOTE: we will reset the path to not include paths
|
// NOTE: we will reset the path to not include paths
|
||||||
// ...that Python may have found in the registery
|
// ...that Python may have found in the registery
|
||||||
PyObject* path_list = PyList_New(0);
|
PyObject* path_list = PyList_New(0);
|
||||||
printf("Setting up include dirs:\n");
|
printf("Setting up include dirs:\n");
|
||||||
printf("%s\n",rootDir.c_str());
|
printf("%s\n",rootDir.c_str());
|
||||||
PyObject* more_path = PyString_FromString(rootDir.c_str());
|
PyObject* more_path = PyString_FromString(rootDir.c_str());
|
||||||
PyList_Append(path_list, more_path);
|
PyList_Append(path_list, more_path);
|
||||||
// make sure that our plasma libraries are gotten before the system ones
|
// make sure that our plasma libraries are gotten before the system ones
|
||||||
std::string temp = rootDir + "plasma";
|
std::string temp = rootDir + "plasma";
|
||||||
printf("%s\n",temp.c_str());
|
printf("%s\n",temp.c_str());
|
||||||
PyObject* more_path3 = PyString_FromString(temp.c_str());
|
PyObject* more_path3 = PyString_FromString(temp.c_str());
|
||||||
PyList_Append(path_list, more_path3);
|
PyList_Append(path_list, more_path3);
|
||||||
temp = rootDir + "system";
|
temp = rootDir + "system";
|
||||||
printf("%s\n\n",temp.c_str());
|
printf("%s\n\n",temp.c_str());
|
||||||
PyObject* more_path2 = PyString_FromString("system");
|
PyObject* more_path2 = PyString_FromString("system");
|
||||||
PyList_Append(path_list, more_path2);
|
PyList_Append(path_list, more_path2);
|
||||||
// set the path to be this one
|
// set the path to be this one
|
||||||
PyDict_SetItemString(sys_dict,"path",path_list);
|
PyDict_SetItemString(sys_dict,"path",path_list);
|
||||||
|
|
||||||
|
|
||||||
Py_DECREF(sysmod);
|
Py_DECREF(sysmod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// initialized++;
|
// initialized++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PythonInterface::addPythonPath(std::string path)
|
void PythonInterface::addPythonPath(std::string path)
|
||||||
{
|
{
|
||||||
PyObject* sysmod = PyImport_ImportModule("sys");
|
PyObject* sysmod = PyImport_ImportModule("sys");
|
||||||
if (sysmod != NULL)
|
if (sysmod != NULL)
|
||||||
{
|
{
|
||||||
PyObject* sys_dict = PyModule_GetDict(sysmod);
|
PyObject* sys_dict = PyModule_GetDict(sysmod);
|
||||||
PyObject* path_list = PyDict_GetItemString(sys_dict, "path");
|
PyObject* path_list = PyDict_GetItemString(sys_dict, "path");
|
||||||
|
|
||||||
printf("Adding path %s\n", path.c_str());
|
printf("Adding path %s\n", path.c_str());
|
||||||
PyObject* more_path = PyString_FromString(path.c_str());
|
PyObject* more_path = PyString_FromString(path.c_str());
|
||||||
PyList_Append(path_list, more_path);
|
PyList_Append(path_list, more_path);
|
||||||
|
|
||||||
Py_DECREF(sysmod);
|
Py_DECREF(sysmod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PythonInterface::finiPython()
|
void PythonInterface::finiPython()
|
||||||
{
|
{
|
||||||
if (Py_IsInitialized() != 0)
|
if (Py_IsInitialized() != 0)
|
||||||
{
|
{
|
||||||
Py_Finalize();
|
Py_Finalize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : CompileString
|
// Function : CompileString
|
||||||
// PARAMETERS : command - string of commands to execute in the...
|
// PARAMETERS : command - string of commands to execute in the...
|
||||||
// : filename - filename to say where to code came from
|
// : filename - filename to say where to code came from
|
||||||
//
|
//
|
||||||
// PURPOSE : run a python string in a specific module name
|
// PURPOSE : run a python string in a specific module name
|
||||||
//
|
//
|
||||||
PyObject* PythonInterface::CompileString(char *command, char* filename)
|
PyObject* PythonInterface::CompileString(char *command, char* filename)
|
||||||
{
|
{
|
||||||
PyObject* pycode = Py_CompileString(command, filename, Py_file_input);
|
PyObject* pycode = Py_CompileString(command, filename, Py_file_input);
|
||||||
return pycode;
|
return pycode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : DumpObject
|
// Function : DumpObject
|
||||||
// PARAMETERS : pyobject - string of commands to execute in the...
|
// PARAMETERS : pyobject - string of commands to execute in the...
|
||||||
//
|
//
|
||||||
// PURPOSE : marshals an object into a char string
|
// PURPOSE : marshals an object into a char string
|
||||||
//
|
//
|
||||||
hsBool PythonInterface::DumpObject(PyObject* pyobj, char** pickle, Int32* size)
|
hsBool PythonInterface::DumpObject(PyObject* pyobj, char** pickle, Int32* size)
|
||||||
{
|
{
|
||||||
PyObject *s; // the python string object where the marsalled object wil go
|
PyObject *s; // the python string object where the marsalled object wil go
|
||||||
// convert object to a marshalled string python object
|
// convert object to a marshalled string python object
|
||||||
#if (PY_MAJOR_VERSION == 2) && (PY_MINOR_VERSION < 4)
|
#if (PY_MAJOR_VERSION == 2) && (PY_MINOR_VERSION < 4)
|
||||||
s = PyMarshal_WriteObjectToString(pyobj);
|
s = PyMarshal_WriteObjectToString(pyobj);
|
||||||
#else
|
#else
|
||||||
s = PyMarshal_WriteObjectToString(pyobj, 0);
|
s = PyMarshal_WriteObjectToString(pyobj, 0);
|
||||||
#endif
|
#endif
|
||||||
// did it actually do it?
|
// did it actually do it?
|
||||||
if ( s != NULL )
|
if ( s != NULL )
|
||||||
{
|
{
|
||||||
// yes, then get the size and the string address
|
// yes, then get the size and the string address
|
||||||
*size = PyString_Size(s);
|
*size = PyString_Size(s);
|
||||||
*pickle = PyString_AsString(s);
|
*pickle = PyString_AsString(s);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else // otherwise, there was an error
|
else // otherwise, there was an error
|
||||||
{
|
{
|
||||||
// Yikes! errors!
|
// Yikes! errors!
|
||||||
PyErr_Print(); // FUTURE: we may have to get the string to display in max...later
|
PyErr_Print(); // FUTURE: we may have to get the string to display in max...later
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : getOutputAndReset
|
// Function : getOutputAndReset
|
||||||
// PARAMETERS : none
|
// PARAMETERS : none
|
||||||
//
|
//
|
||||||
// PURPOSE : get the Output to the error file to be displayed
|
// PURPOSE : get the Output to the error file to be displayed
|
||||||
//
|
//
|
||||||
int PythonInterface::getOutputAndReset(char** line)
|
int PythonInterface::getOutputAndReset(char** line)
|
||||||
{
|
{
|
||||||
PyObject* pyStr = (*PycStringIO->cgetvalue)(stdFile);
|
PyObject* pyStr = (*PycStringIO->cgetvalue)(stdFile);
|
||||||
char *str = PyString_AsString( pyStr );
|
char *str = PyString_AsString( pyStr );
|
||||||
int size = PyString_Size( pyStr );
|
int size = PyString_Size( pyStr );
|
||||||
|
|
||||||
// reset the file back to zero
|
// reset the file back to zero
|
||||||
PyObject_CallMethod(stdFile,"reset","");
|
PyObject_CallMethod(stdFile,"reset","");
|
||||||
/*
|
/*
|
||||||
// check to see if the debug python module is loaded
|
// check to see if the debug python module is loaded
|
||||||
if ( dbgOut != nil )
|
if ( dbgOut != nil )
|
||||||
{
|
{
|
||||||
// then send it the new text
|
// then send it the new text
|
||||||
if ( PyObject_CallFunction(dbgOut,"s",str) == nil )
|
if ( PyObject_CallFunction(dbgOut,"s",str) == nil )
|
||||||
{
|
{
|
||||||
// for some reason this function didn't, remember that and not call it again
|
// for some reason this function didn't, remember that and not call it again
|
||||||
dbgOut = nil;
|
dbgOut = nil;
|
||||||
// if there was an error make sure that the stderr gets flushed so it can be seen
|
// if there was an error make sure that the stderr gets flushed so it can be seen
|
||||||
PyErr_Print(); // make sure the error is printed
|
PyErr_Print(); // make sure the error is printed
|
||||||
PyErr_Clear(); // clear the error
|
PyErr_Clear(); // clear the error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if (line)
|
if (line)
|
||||||
*line = str;
|
*line = str;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : CreateModule
|
// Function : CreateModule
|
||||||
// PARAMETERS : module - module name to create
|
// PARAMETERS : module - module name to create
|
||||||
//
|
//
|
||||||
// PURPOSE : create a new module with built-ins
|
// PURPOSE : create a new module with built-ins
|
||||||
//
|
//
|
||||||
PyObject* PythonInterface::CreateModule(char* module)
|
PyObject* PythonInterface::CreateModule(char* module)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
// first we must get rid of any old modules of the same name, we'll replace it
|
// first we must get rid of any old modules of the same name, we'll replace it
|
||||||
PyObject *modules = PyImport_GetModuleDict();
|
PyObject *modules = PyImport_GetModuleDict();
|
||||||
if ((m = PyDict_GetItemString(modules, module)) != NULL && PyModule_Check(m))
|
if ((m = PyDict_GetItemString(modules, module)) != NULL && PyModule_Check(m))
|
||||||
// clear it
|
// clear it
|
||||||
_PyModule_Clear(m);
|
_PyModule_Clear(m);
|
||||||
|
|
||||||
// create the module
|
// create the module
|
||||||
m = PyImport_AddModule(module);
|
m = PyImport_AddModule(module);
|
||||||
if (m == NULL)
|
if (m == NULL)
|
||||||
return nil;
|
return nil;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
// add in the built-ins
|
// add in the built-ins
|
||||||
// first make sure that we don't already have the builtins
|
// first make sure that we don't already have the builtins
|
||||||
if (PyDict_GetItemString(d, "__builtins__") == NULL)
|
if (PyDict_GetItemString(d, "__builtins__") == NULL)
|
||||||
{
|
{
|
||||||
// if we need the builtins then find the builtin module
|
// if we need the builtins then find the builtin module
|
||||||
PyObject *bimod = PyImport_ImportModule("__builtin__");
|
PyObject *bimod = PyImport_ImportModule("__builtin__");
|
||||||
// then add the builtin dicitionary to our module's dictionary
|
// then add the builtin dicitionary to our module's dictionary
|
||||||
if (bimod == NULL || PyDict_SetItemString(d, "__builtins__", bimod) != 0)
|
if (bimod == NULL || PyDict_SetItemString(d, "__builtins__", bimod) != 0)
|
||||||
return nil;
|
return nil;
|
||||||
Py_DECREF(bimod);
|
Py_DECREF(bimod);
|
||||||
}
|
}
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : RunPYC
|
// Function : RunPYC
|
||||||
// PARAMETERS : code - compiled code
|
// PARAMETERS : code - compiled code
|
||||||
// : module - module name to run the code in
|
// : module - module name to run the code in
|
||||||
//
|
//
|
||||||
// PURPOSE : run a compiled python code in a specific module name
|
// PURPOSE : run a compiled python code in a specific module name
|
||||||
//
|
//
|
||||||
hsBool PythonInterface::RunPYC(PyObject* code, PyObject* module)
|
hsBool PythonInterface::RunPYC(PyObject* code, PyObject* module)
|
||||||
{
|
{
|
||||||
PyObject *d, *v;
|
PyObject *d, *v;
|
||||||
// make sure that we're given a good module... or at least one with an address
|
// make sure that we're given a good module... or at least one with an address
|
||||||
if ( !module )
|
if ( !module )
|
||||||
{
|
{
|
||||||
// if no module was given then use just use the main module
|
// if no module was given then use just use the main module
|
||||||
module = PyImport_AddModule("__main__");
|
module = PyImport_AddModule("__main__");
|
||||||
if (module == NULL)
|
if (module == NULL)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// get the dictionaries for this module
|
// get the dictionaries for this module
|
||||||
d = PyModule_GetDict(module);
|
d = PyModule_GetDict(module);
|
||||||
// run the string
|
// run the string
|
||||||
v = PyEval_EvalCode((PyCodeObject*)code, d, d);
|
v = PyEval_EvalCode((PyCodeObject*)code, d, d);
|
||||||
// check for errors and print them
|
// check for errors and print them
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
{
|
{
|
||||||
// Yikes! errors!
|
// Yikes! errors!
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Py_DECREF(v);
|
Py_DECREF(v);
|
||||||
if (Py_FlushLine())
|
if (Py_FlushLine())
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Function : GetModuleItem
|
// Function : GetModuleItem
|
||||||
// PARAMETERS : item - what item in the plasma module to get
|
// PARAMETERS : item - what item in the plasma module to get
|
||||||
//
|
//
|
||||||
// PURPOSE : get an item (probably a function) from a specific module
|
// PURPOSE : get an item (probably a function) from a specific module
|
||||||
//
|
//
|
||||||
PyObject* PythonInterface::GetModuleItem(char* item, PyObject* module)
|
PyObject* PythonInterface::GetModuleItem(char* item, PyObject* module)
|
||||||
{
|
{
|
||||||
if ( module )
|
if ( module )
|
||||||
{
|
{
|
||||||
PyObject* d = PyModule_GetDict(module);
|
PyObject* d = PyModule_GetDict(module);
|
||||||
return PyDict_GetItemString(d, item);
|
return PyDict_GetItemString(d, item);
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace PythonInterface
|
namespace PythonInterface
|
||||||
{
|
{
|
||||||
void initPython(std::string rootDir);
|
void initPython(std::string rootDir);
|
||||||
void finiPython();
|
void finiPython();
|
||||||
// So the Python packer can add extra paths
|
// So the Python packer can add extra paths
|
||||||
void addPythonPath(std::string dir);
|
void addPythonPath(std::string dir);
|
||||||
|
|
||||||
PyObject* CompileString(char *command, char* filename);
|
PyObject* CompileString(char *command, char* filename);
|
||||||
hsBool DumpObject(PyObject* pyobj, char** pickle, Int32* size);
|
hsBool DumpObject(PyObject* pyobj, char** pickle, Int32* size);
|
||||||
int getOutputAndReset(char** line=nil);
|
int getOutputAndReset(char** line=nil);
|
||||||
PyObject* CreateModule(char* module);
|
PyObject* CreateModule(char* module);
|
||||||
hsBool RunPYC(PyObject* code, PyObject* module);
|
hsBool RunPYC(PyObject* code, PyObject* module);
|
||||||
PyObject* GetModuleItem(char* item, PyObject* module);
|
PyObject* GetModuleItem(char* item, PyObject* module);
|
||||||
}
|
}
|
||||||
|
@ -1,451 +1,451 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
#include "plFile/hsFiles.h"
|
#include "plFile/hsFiles.h"
|
||||||
|
|
||||||
#include "PythonInterface.h"
|
#include "PythonInterface.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
|
||||||
static const char* kPackFileName = "python.pak";
|
static const char* kPackFileName = "python.pak";
|
||||||
static const char* kGlueFile = ".\\plasma\\glue.py";
|
static const char* kGlueFile = ".\\plasma\\glue.py";
|
||||||
static char* glueFile = (char*)kGlueFile;
|
static char* glueFile = (char*)kGlueFile;
|
||||||
|
|
||||||
void WritePythonFile(const char *fileName, const char* path, hsStream *s)
|
void WritePythonFile(const char *fileName, const char* path, hsStream *s)
|
||||||
{
|
{
|
||||||
hsUNIXStream pyStream, glueStream;
|
hsUNIXStream pyStream, glueStream;
|
||||||
char* pathAndFile = new char[strlen(fileName)+strlen(path)+2];
|
char* pathAndFile = new char[strlen(fileName)+strlen(path)+2];
|
||||||
strcpy(pathAndFile,path);
|
strcpy(pathAndFile,path);
|
||||||
char lastchar = pathAndFile[strlen(pathAndFile)-1];
|
char lastchar = pathAndFile[strlen(pathAndFile)-1];
|
||||||
if (lastchar != '\\' && lastchar != '/')
|
if (lastchar != '\\' && lastchar != '/')
|
||||||
strcat(pathAndFile, "\\");
|
strcat(pathAndFile, "\\");
|
||||||
strcat(pathAndFile,fileName);
|
strcat(pathAndFile,fileName);
|
||||||
if (!pyStream.Open(pathAndFile) || !glueStream.Open(glueFile))
|
if (!pyStream.Open(pathAndFile) || !glueStream.Open(glueFile))
|
||||||
{
|
{
|
||||||
printf("Unable to open path %s, ",pathAndFile);
|
printf("Unable to open path %s, ",pathAndFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("==Packing %s, ",fileName);
|
printf("==Packing %s, ",fileName);
|
||||||
|
|
||||||
pyStream.FastFwd();
|
pyStream.FastFwd();
|
||||||
UInt32 pyFileSize = pyStream.GetPosition();
|
UInt32 pyFileSize = pyStream.GetPosition();
|
||||||
pyStream.Rewind();
|
pyStream.Rewind();
|
||||||
|
|
||||||
glueStream.FastFwd();
|
glueStream.FastFwd();
|
||||||
UInt32 glueFileSize = glueStream.GetPosition();
|
UInt32 glueFileSize = glueStream.GetPosition();
|
||||||
glueStream.Rewind();
|
glueStream.Rewind();
|
||||||
|
|
||||||
UInt32 totalSize = pyFileSize + glueFileSize + 2;
|
UInt32 totalSize = pyFileSize + glueFileSize + 2;
|
||||||
|
|
||||||
char *code = new char[totalSize];
|
char *code = new char[totalSize];
|
||||||
|
|
||||||
UInt32 amountRead = pyStream.Read(pyFileSize, code);
|
UInt32 amountRead = pyStream.Read(pyFileSize, code);
|
||||||
hsAssert(amountRead == pyFileSize, "Bad read");
|
hsAssert(amountRead == pyFileSize, "Bad read");
|
||||||
|
|
||||||
code[pyFileSize] = '\n';
|
code[pyFileSize] = '\n';
|
||||||
|
|
||||||
amountRead = glueStream.Read(glueFileSize, code+pyFileSize+1);
|
amountRead = glueStream.Read(glueFileSize, code+pyFileSize+1);
|
||||||
hsAssert(amountRead == glueFileSize, "Bad read");
|
hsAssert(amountRead == glueFileSize, "Bad read");
|
||||||
|
|
||||||
code[totalSize-1] = '\0';
|
code[totalSize-1] = '\0';
|
||||||
|
|
||||||
// remove the CRs, they seem to give Python heartburn
|
// remove the CRs, they seem to give Python heartburn
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for (int i = 0; i < totalSize; i++)
|
for (int i = 0; i < totalSize; i++)
|
||||||
{
|
{
|
||||||
if (code[i] != '\r') // is it not a CR?
|
if (code[i] != '\r') // is it not a CR?
|
||||||
code[k++] = code[i];
|
code[k++] = code[i];
|
||||||
// else
|
// else
|
||||||
// skip the CRs
|
// skip the CRs
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* pythonCode = PythonInterface::CompileString(code, (char*)fileName);
|
PyObject* pythonCode = PythonInterface::CompileString(code, (char*)fileName);
|
||||||
if (pythonCode)
|
if (pythonCode)
|
||||||
{
|
{
|
||||||
// we need to find out if this is PythonFile module
|
// we need to find out if this is PythonFile module
|
||||||
// create a module name... with the '.' as an X
|
// create a module name... with the '.' as an X
|
||||||
// and create a python file name that is without the ".py"
|
// and create a python file name that is without the ".py"
|
||||||
char* modulename = new char[strlen(fileName)+1];
|
char* modulename = new char[strlen(fileName)+1];
|
||||||
char* pythonfilename = new char[strlen(fileName)+1];
|
char* pythonfilename = new char[strlen(fileName)+1];
|
||||||
int j;
|
int j;
|
||||||
for (j=0; j<strlen(fileName); j++)
|
for (j=0; j<strlen(fileName); j++)
|
||||||
{
|
{
|
||||||
if (fileName[j] == '.')
|
if (fileName[j] == '.')
|
||||||
{
|
{
|
||||||
modulename[j] = 'X';
|
modulename[j] = 'X';
|
||||||
pythonfilename[j] = '\0';
|
pythonfilename[j] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
modulename[j] = fileName[j];
|
modulename[j] = fileName[j];
|
||||||
pythonfilename[j] = fileName[j];
|
pythonfilename[j] = fileName[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modulename[j] = '\0';
|
modulename[j] = '\0';
|
||||||
PyObject* fModule = PythonInterface::CreateModule(modulename);
|
PyObject* fModule = PythonInterface::CreateModule(modulename);
|
||||||
delete [] modulename;
|
delete [] modulename;
|
||||||
// run the code
|
// run the code
|
||||||
if (PythonInterface::RunPYC(pythonCode, fModule) )
|
if (PythonInterface::RunPYC(pythonCode, fModule) )
|
||||||
{
|
{
|
||||||
// set the name of the file (in the global dictionary of the module)
|
// set the name of the file (in the global dictionary of the module)
|
||||||
PyObject* dict = PyModule_GetDict(fModule);
|
PyObject* dict = PyModule_GetDict(fModule);
|
||||||
PyObject* pfilename = PyString_FromString(pythonfilename);
|
PyObject* pfilename = PyString_FromString(pythonfilename);
|
||||||
PyDict_SetItemString(dict, "glue_name", pfilename);
|
PyDict_SetItemString(dict, "glue_name", pfilename);
|
||||||
// next we need to:
|
// next we need to:
|
||||||
// - create instance of class
|
// - create instance of class
|
||||||
PyObject* getID = PythonInterface::GetModuleItem("glue_getBlockID",fModule);
|
PyObject* getID = PythonInterface::GetModuleItem("glue_getBlockID",fModule);
|
||||||
hsBool foundID = false;
|
hsBool foundID = false;
|
||||||
if ( getID!=nil && PyCallable_Check(getID) )
|
if ( getID!=nil && PyCallable_Check(getID) )
|
||||||
{
|
{
|
||||||
PyObject* id = PyObject_CallFunction(getID,nil);
|
PyObject* id = PyObject_CallFunction(getID,nil);
|
||||||
if ( id && PyInt_Check(id) )
|
if ( id && PyInt_Check(id) )
|
||||||
foundID = true;
|
foundID = true;
|
||||||
}
|
}
|
||||||
if ( foundID == false ) // then there was an error or no ID or somethin'
|
if ( foundID == false ) // then there was an error or no ID or somethin'
|
||||||
{
|
{
|
||||||
// oops, this is not a PythonFile modifier
|
// oops, this is not a PythonFile modifier
|
||||||
// re-read the source and compile it without the glue code this time
|
// re-read the source and compile it without the glue code this time
|
||||||
memset(code,0,totalSize);
|
memset(code,0,totalSize);
|
||||||
pyStream.Rewind();
|
pyStream.Rewind();
|
||||||
amountRead = pyStream.Read(pyFileSize, code);
|
amountRead = pyStream.Read(pyFileSize, code);
|
||||||
hsAssert(amountRead == pyFileSize, "Bad read");
|
hsAssert(amountRead == pyFileSize, "Bad read");
|
||||||
strcat(code,"\n");
|
strcat(code,"\n");
|
||||||
k = 0;
|
k = 0;
|
||||||
for (int i = 0; i < strlen(code)+1; i++)
|
for (int i = 0; i < strlen(code)+1; i++)
|
||||||
{
|
{
|
||||||
if (code[i] != '\r') // is it not a CR?
|
if (code[i] != '\r') // is it not a CR?
|
||||||
code[k++] = code[i];
|
code[k++] = code[i];
|
||||||
// else
|
// else
|
||||||
// skip the CRs
|
// skip the CRs
|
||||||
}
|
}
|
||||||
pythonCode = PythonInterface::CompileString(code, (char*)fileName);
|
pythonCode = PythonInterface::CompileString(code, (char*)fileName);
|
||||||
hsAssert(pythonCode,"Not sure why this didn't compile the second time???");
|
hsAssert(pythonCode,"Not sure why this didn't compile the second time???");
|
||||||
printf("an import file ");
|
printf("an import file ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("a PythonFile modifier(tm) ");
|
printf("a PythonFile modifier(tm) ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("......blast! Error during run-code!\n");
|
printf("......blast! Error during run-code!\n");
|
||||||
s->WriteSwap32(0);
|
s->WriteSwap32(0);
|
||||||
|
|
||||||
char* errmsg;
|
char* errmsg;
|
||||||
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
||||||
if (chars_read > 0)
|
if (chars_read > 0)
|
||||||
{
|
{
|
||||||
printf(errmsg);
|
printf(errmsg);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] pythonfilename;
|
delete [] pythonfilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure that we have code to save
|
// make sure that we have code to save
|
||||||
if (pythonCode)
|
if (pythonCode)
|
||||||
{
|
{
|
||||||
Int32 size;
|
Int32 size;
|
||||||
char* pycode;
|
char* pycode;
|
||||||
PythonInterface::DumpObject(pythonCode,&pycode,&size);
|
PythonInterface::DumpObject(pythonCode,&pycode,&size);
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
// print any message after each module
|
// print any message after each module
|
||||||
char* errmsg;
|
char* errmsg;
|
||||||
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
||||||
if (chars_read > 0)
|
if (chars_read > 0)
|
||||||
{
|
{
|
||||||
printf(errmsg);
|
printf(errmsg);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
s->WriteSwap32(size);
|
s->WriteSwap32(size);
|
||||||
s->Write(size, pycode);
|
s->Write(size, pycode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("......blast! Compile error!\n");
|
printf("......blast! Compile error!\n");
|
||||||
s->WriteSwap32(0);
|
s->WriteSwap32(0);
|
||||||
|
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
|
|
||||||
char* errmsg;
|
char* errmsg;
|
||||||
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
int chars_read = PythonInterface::getOutputAndReset(&errmsg);
|
||||||
if (chars_read > 0)
|
if (chars_read > 0)
|
||||||
{
|
{
|
||||||
printf(errmsg);
|
printf(errmsg);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] code;
|
delete [] code;
|
||||||
delete [] pathAndFile; // all done with the path and filename as one
|
delete [] pathAndFile; // all done with the path and filename as one
|
||||||
|
|
||||||
pyStream.Close();
|
pyStream.Close();
|
||||||
glueStream.Close();
|
glueStream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindFiles(std::vector<std::string> &filenames, std::vector<std::string> &pathnames, const char* path)
|
void FindFiles(std::vector<std::string> &filenames, std::vector<std::string> &pathnames, const char* path)
|
||||||
{
|
{
|
||||||
// Get the names of all the python files
|
// Get the names of all the python files
|
||||||
hsFolderIterator folder;
|
hsFolderIterator folder;
|
||||||
|
|
||||||
// if there is a path... set it
|
// if there is a path... set it
|
||||||
if ( path )
|
if ( path )
|
||||||
folder.SetPath(path);
|
folder.SetPath(path);
|
||||||
|
|
||||||
while (folder.NextFileSuffix(".py"))
|
while (folder.NextFileSuffix(".py"))
|
||||||
{
|
{
|
||||||
const char *fileName = folder.GetFileName();
|
const char *fileName = folder.GetFileName();
|
||||||
filenames.push_back(fileName);
|
filenames.push_back(fileName);
|
||||||
if ( path )
|
if ( path )
|
||||||
pathnames.push_back(path);
|
pathnames.push_back(path);
|
||||||
else
|
else
|
||||||
pathnames.push_back("");
|
pathnames.push_back("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ToLowerCase(std::string str)
|
std::string ToLowerCase(std::string str)
|
||||||
{
|
{
|
||||||
std::string retVal = "";
|
std::string retVal = "";
|
||||||
for (int i=0; i<str.length(); i++)
|
for (int i=0; i<str.length(); i++)
|
||||||
{
|
{
|
||||||
if ((str[i]>='A')&&(str[i]<='Z'))
|
if ((str[i]>='A')&&(str[i]<='Z'))
|
||||||
retVal += (char)tolower(str[i]);
|
retVal += (char)tolower(str[i]);
|
||||||
else
|
else
|
||||||
retVal += str[i];
|
retVal += str[i];
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindSubDirs(std::vector<std::string> &dirnames, std::vector<std::string> &pakNames, char *path)
|
void FindSubDirs(std::vector<std::string> &dirnames, std::vector<std::string> &pakNames, char *path)
|
||||||
{
|
{
|
||||||
hsFolderIterator folder;
|
hsFolderIterator folder;
|
||||||
if (path)
|
if (path)
|
||||||
folder.SetPath(path);
|
folder.SetPath(path);
|
||||||
|
|
||||||
while (folder.NextFile())
|
while (folder.NextFile())
|
||||||
{
|
{
|
||||||
if (folder.IsDirectory())
|
if (folder.IsDirectory())
|
||||||
{
|
{
|
||||||
std::string dirName = folder.GetFileName();
|
std::string dirName = folder.GetFileName();
|
||||||
if ((dirName != ".")&&(dirName != "..")&&(ToLowerCase(dirName) != "system") && (ToLowerCase(dirName) != "plasma"))
|
if ((dirName != ".")&&(dirName != "..")&&(ToLowerCase(dirName) != "system") && (ToLowerCase(dirName) != "plasma"))
|
||||||
{
|
{
|
||||||
dirnames.push_back(dirName);
|
dirnames.push_back(dirName);
|
||||||
pakNames.push_back(dirName+".pak");
|
pakNames.push_back(dirName+".pak");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// adds or removes the ending slash in a path as necessary
|
// adds or removes the ending slash in a path as necessary
|
||||||
std::string AdjustEndingSlash(std::string path, bool endingSlash = false)
|
std::string AdjustEndingSlash(std::string path, bool endingSlash = false)
|
||||||
{
|
{
|
||||||
std::string retVal = path;
|
std::string retVal = path;
|
||||||
bool endSlashExists = false;
|
bool endSlashExists = false;
|
||||||
char temp = path[path.length()-1];
|
char temp = path[path.length()-1];
|
||||||
if (temp == '\\')
|
if (temp == '\\')
|
||||||
endSlashExists = true;
|
endSlashExists = true;
|
||||||
|
|
||||||
if (endingSlash)
|
if (endingSlash)
|
||||||
{
|
{
|
||||||
if (!endSlashExists)
|
if (!endSlashExists)
|
||||||
retVal += "\\";
|
retVal += "\\";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (endSlashExists)
|
if (endSlashExists)
|
||||||
{
|
{
|
||||||
std::string temp = "";
|
std::string temp = "";
|
||||||
for (int i=0; i<retVal.length()-1; i++)
|
for (int i=0; i<retVal.length()-1; i++)
|
||||||
temp += retVal[i];
|
temp += retVal[i];
|
||||||
retVal = temp;
|
retVal = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
// appends partialPath onto the end of fullPath, inserting or removing slashes as necesssary
|
// appends partialPath onto the end of fullPath, inserting or removing slashes as necesssary
|
||||||
std::string ConcatDirs(std::string fullPath, std::string partialPath)
|
std::string ConcatDirs(std::string fullPath, std::string partialPath)
|
||||||
{
|
{
|
||||||
bool fullSlash = false, partialSlash = false;
|
bool fullSlash = false, partialSlash = false;
|
||||||
char temp = fullPath[fullPath.length()-1];
|
char temp = fullPath[fullPath.length()-1];
|
||||||
if (temp == '\\')
|
if (temp == '\\')
|
||||||
fullSlash = true;
|
fullSlash = true;
|
||||||
temp = partialPath[0];
|
temp = partialPath[0];
|
||||||
if (temp == '\\')
|
if (temp == '\\')
|
||||||
partialSlash = true;
|
partialSlash = true;
|
||||||
|
|
||||||
std::string retVal = "";
|
std::string retVal = "";
|
||||||
if (!fullSlash)
|
if (!fullSlash)
|
||||||
retVal = fullPath + "\\";
|
retVal = fullPath + "\\";
|
||||||
if (partialSlash)
|
if (partialSlash)
|
||||||
{
|
{
|
||||||
std::string temp = "";
|
std::string temp = "";
|
||||||
for (int i=1; i<partialPath.length(); i++)
|
for (int i=1; i<partialPath.length(); i++)
|
||||||
temp += partialPath[i];
|
temp += partialPath[i];
|
||||||
partialPath = temp;
|
partialPath = temp;
|
||||||
}
|
}
|
||||||
retVal += partialPath;
|
retVal += partialPath;
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackDirectory(std::string dir, std::string rootPath, std::string pakName, std::vector<std::string>& extraDirs, bool packSysAndPlasma = false)
|
void PackDirectory(std::string dir, std::string rootPath, std::string pakName, std::vector<std::string>& extraDirs, bool packSysAndPlasma = false)
|
||||||
{
|
{
|
||||||
// make sure the dir ends in a slash
|
// make sure the dir ends in a slash
|
||||||
dir = AdjustEndingSlash(dir,true);
|
dir = AdjustEndingSlash(dir,true);
|
||||||
|
|
||||||
printf("\nCreating %s using the contents of %s\n",pakName.c_str(),dir.c_str());
|
printf("\nCreating %s using the contents of %s\n",pakName.c_str(),dir.c_str());
|
||||||
printf("Changing working directory to %s\n",rootPath.c_str());
|
printf("Changing working directory to %s\n",rootPath.c_str());
|
||||||
if (_chdir(rootPath.c_str()))
|
if (_chdir(rootPath.c_str()))
|
||||||
{
|
{
|
||||||
printf("ERROR: Directory change to %s failed for some reason\n",rootPath.c_str());
|
printf("ERROR: Directory change to %s failed for some reason\n",rootPath.c_str());
|
||||||
printf("Unable to continue with the packing of this directory, aborting...\n");
|
printf("Unable to continue with the packing of this directory, aborting...\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("Directory changed to %s\n",rootPath.c_str());
|
printf("Directory changed to %s\n",rootPath.c_str());
|
||||||
|
|
||||||
std::vector<std::string> fileNames;
|
std::vector<std::string> fileNames;
|
||||||
std::vector<std::string> pathNames;
|
std::vector<std::string> pathNames;
|
||||||
|
|
||||||
FindFiles(fileNames,pathNames,dir.c_str());
|
FindFiles(fileNames,pathNames,dir.c_str());
|
||||||
if (packSysAndPlasma)
|
if (packSysAndPlasma)
|
||||||
{
|
{
|
||||||
printf("Adding the system and plasma directories to this pack file\n");
|
printf("Adding the system and plasma directories to this pack file\n");
|
||||||
std::string tempPath;
|
std::string tempPath;
|
||||||
tempPath = dir + "system";
|
tempPath = dir + "system";
|
||||||
FindFiles(fileNames,pathNames,tempPath.c_str());
|
FindFiles(fileNames,pathNames,tempPath.c_str());
|
||||||
tempPath = dir + "plasma";
|
tempPath = dir + "plasma";
|
||||||
FindFiles(fileNames,pathNames,tempPath.c_str());
|
FindFiles(fileNames,pathNames,tempPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok, we know how many files we're gonna pack, so make a fake index (we'll fill in later)
|
// ok, we know how many files we're gonna pack, so make a fake index (we'll fill in later)
|
||||||
hsUNIXStream s;
|
hsUNIXStream s;
|
||||||
if (!s.Open(pakName.c_str(), "wb"))
|
if (!s.Open(pakName.c_str(), "wb"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s.WriteSwap32(fileNames.size());
|
s.WriteSwap32(fileNames.size());
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < fileNames.size(); i++)
|
for (i = 0; i < fileNames.size(); i++)
|
||||||
{
|
{
|
||||||
s.WriteSafeString(fileNames[i].c_str());
|
s.WriteSafeString(fileNames[i].c_str());
|
||||||
s.WriteSwap32(0);
|
s.WriteSwap32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PythonInterface::initPython(rootPath);
|
PythonInterface::initPython(rootPath);
|
||||||
for (i = 0; i < extraDirs.size(); i++)
|
for (i = 0; i < extraDirs.size(); i++)
|
||||||
PythonInterface::addPythonPath(rootPath + extraDirs[i]);
|
PythonInterface::addPythonPath(rootPath + extraDirs[i]);
|
||||||
|
|
||||||
// set to maximum optimization (includes removing __doc__ strings)
|
// set to maximum optimization (includes removing __doc__ strings)
|
||||||
Py_OptimizeFlag = 2;
|
Py_OptimizeFlag = 2;
|
||||||
|
|
||||||
std::vector<UInt32> filePositions;
|
std::vector<UInt32> filePositions;
|
||||||
filePositions.resize(fileNames.size());
|
filePositions.resize(fileNames.size());
|
||||||
|
|
||||||
for (i = 0; i < fileNames.size(); i++)
|
for (i = 0; i < fileNames.size(); i++)
|
||||||
{
|
{
|
||||||
UInt32 initialPos = s.GetPosition();
|
UInt32 initialPos = s.GetPosition();
|
||||||
WritePythonFile(fileNames[i].c_str(), pathNames[i].c_str(), &s);
|
WritePythonFile(fileNames[i].c_str(), pathNames[i].c_str(), &s);
|
||||||
UInt32 endPos = s.GetPosition();
|
UInt32 endPos = s.GetPosition();
|
||||||
|
|
||||||
filePositions[i] = initialPos;
|
filePositions[i] = initialPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
s.SetPosition(sizeof(UInt32));
|
s.SetPosition(sizeof(UInt32));
|
||||||
for (i = 0; i < fileNames.size(); i++)
|
for (i = 0; i < fileNames.size(); i++)
|
||||||
{
|
{
|
||||||
s.WriteSafeString(fileNames[i].c_str());
|
s.WriteSafeString(fileNames[i].c_str());
|
||||||
s.WriteSwap32(filePositions[i]);
|
s.WriteSwap32(filePositions[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Close();
|
s.Close();
|
||||||
|
|
||||||
PythonInterface::finiPython();
|
PythonInterface::finiPython();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintUsage()
|
void PrintUsage()
|
||||||
{
|
{
|
||||||
printf("Usage:\n");
|
printf("Usage:\n");
|
||||||
printf("plPythonPack [directory to pack...]\n");
|
printf("plPythonPack [directory to pack...]\n");
|
||||||
printf("NOTE: the directory to pack must have full system and plasma dirs and\n");
|
printf("NOTE: the directory to pack must have full system and plasma dirs and\n");
|
||||||
printf(" must be a relative path to the current working directory\n");
|
printf(" must be a relative path to the current working directory\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void main(int argc, char *argv[])
|
void main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
printf("The Python Pack Utility\n");
|
printf("The Python Pack Utility\n");
|
||||||
|
|
||||||
char buffer[_MAX_PATH];
|
char buffer[_MAX_PATH];
|
||||||
_getcwd(buffer,_MAX_PATH);
|
_getcwd(buffer,_MAX_PATH);
|
||||||
std::string baseWorkingDir = buffer;
|
std::string baseWorkingDir = buffer;
|
||||||
|
|
||||||
// are they asking for usage?
|
// are they asking for usage?
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
{
|
{
|
||||||
std::string temp = argv[1];
|
std::string temp = argv[1];
|
||||||
temp = ToLowerCase(temp);
|
temp = ToLowerCase(temp);
|
||||||
if ((temp == "?") || (temp == "-?") || (temp == "/?") || (temp == "-help") || (temp == "/help")
|
if ((temp == "?") || (temp == "-?") || (temp == "/?") || (temp == "-help") || (temp == "/help")
|
||||||
|| (temp == "-h") || (temp == "/h"))
|
|| (temp == "-h") || (temp == "/h"))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// wrong number of args, print usage
|
// wrong number of args, print usage
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> dirNames;
|
std::vector<std::string> dirNames;
|
||||||
std::vector<std::string> pakNames;
|
std::vector<std::string> pakNames;
|
||||||
std::string rootPath;
|
std::string rootPath;
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
{
|
{
|
||||||
FindSubDirs(dirNames,pakNames,nil);
|
FindSubDirs(dirNames,pakNames,nil);
|
||||||
rootPath = AdjustEndingSlash(baseWorkingDir,true);
|
rootPath = AdjustEndingSlash(baseWorkingDir,true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string path = argv[1];
|
std::string path = argv[1];
|
||||||
FindSubDirs(dirNames,pakNames,argv[1]);
|
FindSubDirs(dirNames,pakNames,argv[1]);
|
||||||
rootPath = ConcatDirs(baseWorkingDir,path);
|
rootPath = ConcatDirs(baseWorkingDir,path);
|
||||||
rootPath = AdjustEndingSlash(rootPath,true);
|
rootPath = AdjustEndingSlash(rootPath,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackDirectory(rootPath,rootPath,rootPath+kPackFileName,dirNames,true);
|
PackDirectory(rootPath,rootPath,rootPath+kPackFileName,dirNames,true);
|
||||||
for (int i=0; i<dirNames.size(); i++)
|
for (int i=0; i<dirNames.size(); i++)
|
||||||
{
|
{
|
||||||
PackDirectory(dirNames[i],rootPath,rootPath+pakNames[i],dirNames);
|
PackDirectory(dirNames[i],rootPath,rootPath+pakNames[i],dirNames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,66 +1,66 @@
|
|||||||
include_directories("../../Apps")
|
include_directories("../../Apps")
|
||||||
include_directories("../../CoreLib")
|
include_directories("../../CoreLib")
|
||||||
include_directories("../../NucleusLib/inc")
|
include_directories("../../NucleusLib/inc")
|
||||||
include_directories("../../NucleusLib")
|
include_directories("../../NucleusLib")
|
||||||
include_directories("../../PubUtilLib")
|
include_directories("../../PubUtilLib")
|
||||||
|
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
set(plUruLauncher_HEADERS
|
set(plUruLauncher_HEADERS
|
||||||
Intern.h
|
Intern.h
|
||||||
Pch.h
|
Pch.h
|
||||||
plLauncherInfo.h
|
plLauncherInfo.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plUruLauncher_SOURCES
|
set(plUruLauncher_SOURCES
|
||||||
Main.cpp
|
Main.cpp
|
||||||
SelfPatcher.cpp
|
SelfPatcher.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(plUruLauncher_RESOURCES
|
set(plUruLauncher_RESOURCES
|
||||||
plUruLauncher.rc
|
plUruLauncher.rc
|
||||||
resource.h
|
resource.h
|
||||||
|
|
||||||
banner.bmp
|
banner.bmp
|
||||||
Dirt.ICO
|
Dirt.ICO
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEADERS}
|
add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEADERS}
|
||||||
${plUruLauncher_RESOURCES})
|
${plUruLauncher_RESOURCES})
|
||||||
target_link_libraries(plUruLauncher CoreLib)
|
target_link_libraries(plUruLauncher CoreLib)
|
||||||
target_link_libraries(plUruLauncher CoreLibExe)
|
target_link_libraries(plUruLauncher CoreLibExe)
|
||||||
target_link_libraries(plUruLauncher plAudioCore)
|
target_link_libraries(plUruLauncher plAudioCore)
|
||||||
target_link_libraries(plUruLauncher plClientPatcher)
|
target_link_libraries(plUruLauncher plClientPatcher)
|
||||||
target_link_libraries(plUruLauncher plCompression)
|
target_link_libraries(plUruLauncher plCompression)
|
||||||
target_link_libraries(plUruLauncher plEncryption)
|
target_link_libraries(plUruLauncher plEncryption)
|
||||||
target_link_libraries(plUruLauncher plFile)
|
target_link_libraries(plUruLauncher plFile)
|
||||||
target_link_libraries(plUruLauncher plNetClient)
|
target_link_libraries(plUruLauncher plNetClient)
|
||||||
target_link_libraries(plUruLauncher plNetClientComm)
|
target_link_libraries(plUruLauncher plNetClientComm)
|
||||||
target_link_libraries(plUruLauncher plNetGameLib)
|
target_link_libraries(plUruLauncher plNetGameLib)
|
||||||
target_link_libraries(plUruLauncher plNetMessage)
|
target_link_libraries(plUruLauncher plNetMessage)
|
||||||
target_link_libraries(plUruLauncher plNetTransport)
|
target_link_libraries(plUruLauncher plNetTransport)
|
||||||
target_link_libraries(plUruLauncher plUnifiedTime)
|
target_link_libraries(plUruLauncher plUnifiedTime)
|
||||||
target_link_libraries(plUruLauncher pnAsyncCore)
|
target_link_libraries(plUruLauncher pnAsyncCore)
|
||||||
target_link_libraries(plUruLauncher pnAsyncCoreExe)
|
target_link_libraries(plUruLauncher pnAsyncCoreExe)
|
||||||
target_link_libraries(plUruLauncher pnNetBase)
|
target_link_libraries(plUruLauncher pnNetBase)
|
||||||
target_link_libraries(plUruLauncher pnNetCli)
|
target_link_libraries(plUruLauncher pnNetCli)
|
||||||
target_link_libraries(plUruLauncher pnNetCommon)
|
target_link_libraries(plUruLauncher pnNetCommon)
|
||||||
target_link_libraries(plUruLauncher pnNetProtocol)
|
target_link_libraries(plUruLauncher pnNetProtocol)
|
||||||
target_link_libraries(plUruLauncher pnProduct)
|
target_link_libraries(plUruLauncher pnProduct)
|
||||||
target_link_libraries(plUruLauncher pnSimpleNet)
|
target_link_libraries(plUruLauncher pnSimpleNet)
|
||||||
target_link_libraries(plUruLauncher pnTimer)
|
target_link_libraries(plUruLauncher pnTimer)
|
||||||
target_link_libraries(plUruLauncher pnUtils)
|
target_link_libraries(plUruLauncher pnUtils)
|
||||||
target_link_libraries(plUruLauncher pnUtilsExe)
|
target_link_libraries(plUruLauncher pnUtilsExe)
|
||||||
|
|
||||||
target_link_libraries(plUruLauncher ${DirectX_LIBRARIES})
|
target_link_libraries(plUruLauncher ${DirectX_LIBRARIES})
|
||||||
target_link_libraries(plUruLauncher ${OPENSSL_LIBRARIES})
|
target_link_libraries(plUruLauncher ${OPENSSL_LIBRARIES})
|
||||||
target_link_libraries(plUruLauncher ${Ogg_LIBRARIES})
|
target_link_libraries(plUruLauncher ${Ogg_LIBRARIES})
|
||||||
target_link_libraries(plUruLauncher ${Vorbis_LIBRARIES})
|
target_link_libraries(plUruLauncher ${Vorbis_LIBRARIES})
|
||||||
target_link_libraries(plUruLauncher ws2_32)
|
target_link_libraries(plUruLauncher ws2_32)
|
||||||
target_link_libraries(plUruLauncher winhttp)
|
target_link_libraries(plUruLauncher winhttp)
|
||||||
target_link_libraries(plUruLauncher rpcrt4)
|
target_link_libraries(plUruLauncher rpcrt4)
|
||||||
target_link_libraries(plUruLauncher comctl32)
|
target_link_libraries(plUruLauncher comctl32)
|
||||||
|
|
||||||
source_group("Source Files" FILES ${plUruLauncher_SOURCES})
|
source_group("Source Files" FILES ${plUruLauncher_SOURCES})
|
||||||
source_group("Header Files" FILES ${plUruLauncher_HEADERS})
|
source_group("Header Files" FILES ${plUruLauncher_HEADERS})
|
||||||
source_group("Resource Files" FILES ${plUruLauncher_RESOURCES})
|
source_group("Resource Files" FILES ${plUruLauncher_RESOURCES})
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -1,45 +1,45 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Intern.h
|
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Intern.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_INTERN_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_INTERN_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Intern.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Intern.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_INTERN_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_INTERN_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* SelfPatcher.cpp
|
* SelfPatcher.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
bool SelfPatch (bool noSelfPatch, bool * abort, ENetError * result, plLauncherInfo *info);
|
bool SelfPatch (bool noSelfPatch, bool * abort, ENetError * result, plLauncherInfo *info);
|
||||||
void SetReturnCode (DWORD retCode);
|
void SetReturnCode (DWORD retCode);
|
@ -1,57 +1,57 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h
|
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PCH_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PCH_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/Pch.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PCH_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PCH_H
|
||||||
|
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <WinHttp.h>
|
#include <WinHttp.h>
|
||||||
|
|
||||||
#include "pnUtils/pnUtils.h"
|
#include "pnUtils/pnUtils.h"
|
||||||
#include "pnNetBase/pnNetBase.h"
|
#include "pnNetBase/pnNetBase.h"
|
||||||
#include "pnAsyncCore/pnAsyncCore.h"
|
#include "pnAsyncCore/pnAsyncCore.h"
|
||||||
#include "pnProduct/pnProduct.h"
|
#include "pnProduct/pnProduct.h"
|
||||||
#include "pnNetCli/pnNetCli.h"
|
#include "pnNetCli/pnNetCli.h"
|
||||||
#include "plNetGameLib/plNetGameLib.h"
|
#include "plNetGameLib/plNetGameLib.h"
|
||||||
#include "plEncryption/plChecksum.h"
|
#include "plEncryption/plChecksum.h"
|
||||||
|
|
||||||
#include "plCompression/plZlibStream.h"
|
#include "plCompression/plZlibStream.h"
|
||||||
#include "plClientPatcher/UruPlayer.h"
|
#include "plClientPatcher/UruPlayer.h"
|
||||||
|
|
||||||
#include "plLauncherInfo.h"
|
#include "plLauncherInfo.h"
|
||||||
#include "Intern.h"
|
#include "Intern.h"
|
||||||
|
|
||||||
|
@ -1,305 +1,305 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp
|
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#include "Pch.h"
|
#include "Pch.h"
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Private Data
|
* Private Data
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||||
static const wchar s_manifest[] = L"InternalPatcher";
|
static const wchar s_manifest[] = L"InternalPatcher";
|
||||||
#else
|
#else
|
||||||
static const wchar s_manifest[] = L"ExternalPatcher";
|
static const wchar s_manifest[] = L"ExternalPatcher";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class SelfPatcherStream : public plZlibStream {
|
class SelfPatcherStream : public plZlibStream {
|
||||||
public:
|
public:
|
||||||
virtual UInt32 Write(UInt32 byteCount, const void* buffer);
|
virtual UInt32 Write(UInt32 byteCount, const void* buffer);
|
||||||
static plLauncherInfo *info;
|
static plLauncherInfo *info;
|
||||||
static unsigned totalBytes;
|
static unsigned totalBytes;
|
||||||
static unsigned progress;
|
static unsigned progress;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned SelfPatcherStream::totalBytes = 0;
|
unsigned SelfPatcherStream::totalBytes = 0;
|
||||||
unsigned SelfPatcherStream::progress = 0;
|
unsigned SelfPatcherStream::progress = 0;
|
||||||
|
|
||||||
static bool s_downloadComplete;
|
static bool s_downloadComplete;
|
||||||
static long s_numFiles;
|
static long s_numFiles;
|
||||||
static ENetError s_patchResult;
|
static ENetError s_patchResult;
|
||||||
static bool s_updated;
|
static bool s_updated;
|
||||||
static wchar s_newPatcherFile[MAX_PATH];
|
static wchar s_newPatcherFile[MAX_PATH];
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Private Functions
|
* Private Functions
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static void NetErrorHandler (ENetProtocol protocol, ENetError error) {
|
static void NetErrorHandler (ENetProtocol protocol, ENetError error) {
|
||||||
LogMsg(kLogError, L"NetErr: %s", NetErrorToString(error));
|
LogMsg(kLogError, L"NetErr: %s", NetErrorToString(error));
|
||||||
if (IS_NET_SUCCESS(s_patchResult))
|
if (IS_NET_SUCCESS(s_patchResult))
|
||||||
s_patchResult = error;
|
s_patchResult = error;
|
||||||
s_downloadComplete = true;
|
s_downloadComplete = true;
|
||||||
|
|
||||||
switch(error) {
|
switch(error) {
|
||||||
case kNetErrServerBusy:
|
case kNetErrServerBusy:
|
||||||
MessageBox(0, "Due to the high demand, the server is currently busy. Please try again later, or for alternative download options visit: http://www.mystonline.com/play/", "UruLauncher", MB_OK);
|
MessageBox(0, "Due to the high demand, the server is currently busy. Please try again later, or for alternative download options visit: http://www.mystonline.com/play/", "UruLauncher", MB_OK);
|
||||||
s_patchResult = kNetErrServerBusy;
|
s_patchResult = kNetErrServerBusy;
|
||||||
s_downloadComplete = true;
|
s_downloadComplete = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static void DownloadCallback (
|
static void DownloadCallback (
|
||||||
ENetError result,
|
ENetError result,
|
||||||
void * param,
|
void * param,
|
||||||
const wchar filename[],
|
const wchar filename[],
|
||||||
hsStream * writer
|
hsStream * writer
|
||||||
) {
|
) {
|
||||||
if(IS_NET_ERROR(result)) {
|
if(IS_NET_ERROR(result)) {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case kNetErrTimeout:
|
case kNetErrTimeout:
|
||||||
writer->Rewind();
|
writer->Rewind();
|
||||||
NetCliFileDownloadRequest(filename, writer, DownloadCallback, param);
|
NetCliFileDownloadRequest(filename, writer, DownloadCallback, param);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogMsg(kLogError, L"Error getting patcher file: %s", NetErrorToString(result));
|
LogMsg(kLogError, L"Error getting patcher file: %s", NetErrorToString(result));
|
||||||
if (IS_NET_SUCCESS(s_patchResult))
|
if (IS_NET_SUCCESS(s_patchResult))
|
||||||
s_patchResult = result;
|
s_patchResult = result;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer->Close();
|
writer->Close();
|
||||||
delete writer;
|
delete writer;
|
||||||
AtomicAdd(&s_numFiles, -1);
|
AtomicAdd(&s_numFiles, -1);
|
||||||
|
|
||||||
if(!s_numFiles) {
|
if(!s_numFiles) {
|
||||||
s_downloadComplete = true;
|
s_downloadComplete = true;
|
||||||
s_updated = true;
|
s_updated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static bool MD5Check (const char filename[], const wchar md5[]) {
|
static bool MD5Check (const char filename[], const wchar md5[]) {
|
||||||
// Do md5 check
|
// Do md5 check
|
||||||
char md5copy[MAX_PATH];
|
char md5copy[MAX_PATH];
|
||||||
plMD5Checksum existingMD5(filename);
|
plMD5Checksum existingMD5(filename);
|
||||||
plMD5Checksum latestMD5;
|
plMD5Checksum latestMD5;
|
||||||
|
|
||||||
StrToAnsi(md5copy, md5, arrsize(md5copy));
|
StrToAnsi(md5copy, md5, arrsize(md5copy));
|
||||||
latestMD5.SetFromHexString(md5copy);
|
latestMD5.SetFromHexString(md5copy);
|
||||||
return (existingMD5 == latestMD5);
|
return (existingMD5 == latestMD5);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static void ManifestCallback (
|
static void ManifestCallback (
|
||||||
ENetError result,
|
ENetError result,
|
||||||
void * param,
|
void * param,
|
||||||
const wchar group[],
|
const wchar group[],
|
||||||
const NetCliFileManifestEntry manifest[],
|
const NetCliFileManifestEntry manifest[],
|
||||||
unsigned entryCount
|
unsigned entryCount
|
||||||
) {
|
) {
|
||||||
if(IS_NET_ERROR(result)) {
|
if(IS_NET_ERROR(result)) {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case kNetErrTimeout:
|
case kNetErrTimeout:
|
||||||
NetCliFileManifestRequest(ManifestCallback, nil, s_manifest);
|
NetCliFileManifestRequest(ManifestCallback, nil, s_manifest);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogMsg(kLogError, L"Error getting patcher manifest: %s", NetErrorToString(result));
|
LogMsg(kLogError, L"Error getting patcher manifest: %s", NetErrorToString(result));
|
||||||
if (IS_NET_SUCCESS(s_patchResult))
|
if (IS_NET_SUCCESS(s_patchResult))
|
||||||
s_patchResult = result;
|
s_patchResult = result;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char ansi[MAX_PATH];
|
char ansi[MAX_PATH];
|
||||||
|
|
||||||
// MD5 check current patcher against value in manifest
|
// MD5 check current patcher against value in manifest
|
||||||
ASSERT(entryCount == 1);
|
ASSERT(entryCount == 1);
|
||||||
wchar curPatcherFile[MAX_PATH];
|
wchar curPatcherFile[MAX_PATH];
|
||||||
PathGetProgramName(curPatcherFile, arrsize(curPatcherFile));
|
PathGetProgramName(curPatcherFile, arrsize(curPatcherFile));
|
||||||
StrToAnsi(ansi, curPatcherFile, arrsize(ansi));
|
StrToAnsi(ansi, curPatcherFile, arrsize(ansi));
|
||||||
if (!MD5Check(ansi, manifest[0].md5)) {
|
if (!MD5Check(ansi, manifest[0].md5)) {
|
||||||
// MessageBox(GetTopWindow(nil), "MD5 failed", "Msg", MB_OK);
|
// MessageBox(GetTopWindow(nil), "MD5 failed", "Msg", MB_OK);
|
||||||
SelfPatcherStream::totalBytes += manifest[0].zipSize;
|
SelfPatcherStream::totalBytes += manifest[0].zipSize;
|
||||||
|
|
||||||
AtomicAdd(&s_numFiles, 1);
|
AtomicAdd(&s_numFiles, 1);
|
||||||
SetText("Downloading new patcher...");
|
SetText("Downloading new patcher...");
|
||||||
|
|
||||||
StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi));
|
StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi));
|
||||||
SelfPatcherStream * stream = NEWZERO(SelfPatcherStream);
|
SelfPatcherStream * stream = NEWZERO(SelfPatcherStream);
|
||||||
if (!stream->Open(ansi, "wb"))
|
if (!stream->Open(ansi, "wb"))
|
||||||
ErrorFatal(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno);
|
ErrorFatal(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno);
|
||||||
|
|
||||||
NetCliFileDownloadRequest(manifest[0].downloadName, stream, DownloadCallback, nil);
|
NetCliFileDownloadRequest(manifest[0].downloadName, stream, DownloadCallback, nil);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
s_downloadComplete = true;
|
s_downloadComplete = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static void FileSrvIpAddressCallback (
|
static void FileSrvIpAddressCallback (
|
||||||
ENetError result,
|
ENetError result,
|
||||||
void * param,
|
void * param,
|
||||||
const wchar addr[]
|
const wchar addr[]
|
||||||
) {
|
) {
|
||||||
NetCliGateKeeperDisconnect();
|
NetCliGateKeeperDisconnect();
|
||||||
|
|
||||||
if (IS_NET_ERROR(result)) {
|
if (IS_NET_ERROR(result)) {
|
||||||
LogMsg(kLogDebug, L"FileSrvIpAddressRequest failed: %s", NetErrorToString(result));
|
LogMsg(kLogDebug, L"FileSrvIpAddressRequest failed: %s", NetErrorToString(result));
|
||||||
s_patchResult = result;
|
s_patchResult = result;
|
||||||
s_downloadComplete = true;
|
s_downloadComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start connecting to the server
|
// Start connecting to the server
|
||||||
NetCliFileStartConnect(&addr, 1, true);
|
NetCliFileStartConnect(&addr, 1, true);
|
||||||
|
|
||||||
PathGetProgramDirectory(s_newPatcherFile, arrsize(s_newPatcherFile));
|
PathGetProgramDirectory(s_newPatcherFile, arrsize(s_newPatcherFile));
|
||||||
GetTempFileNameW(s_newPatcherFile, kPatcherExeFilename, 0, s_newPatcherFile);
|
GetTempFileNameW(s_newPatcherFile, kPatcherExeFilename, 0, s_newPatcherFile);
|
||||||
PathDeleteFile(s_newPatcherFile);
|
PathDeleteFile(s_newPatcherFile);
|
||||||
|
|
||||||
NetCliFileManifestRequest(ManifestCallback, nil, s_manifest);
|
NetCliFileManifestRequest(ManifestCallback, nil, s_manifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
static bool SelfPatcherProc (bool * abort, plLauncherInfo *info) {
|
static bool SelfPatcherProc (bool * abort, plLauncherInfo *info) {
|
||||||
|
|
||||||
bool patched = false;
|
bool patched = false;
|
||||||
s_downloadComplete = false;
|
s_downloadComplete = false;
|
||||||
s_patchResult = kNetSuccess;
|
s_patchResult = kNetSuccess;
|
||||||
|
|
||||||
NetClientInitialize();
|
NetClientInitialize();
|
||||||
NetClientSetErrorHandler(NetErrorHandler);
|
NetClientSetErrorHandler(NetErrorHandler);
|
||||||
|
|
||||||
const wchar ** addrs;
|
const wchar ** addrs;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
|
|
||||||
count = GetGateKeeperSrvHostnames(&addrs);
|
count = GetGateKeeperSrvHostnames(&addrs);
|
||||||
|
|
||||||
// Start connecting to the server
|
// Start connecting to the server
|
||||||
NetCliGateKeeperStartConnect(addrs, count);
|
NetCliGateKeeperStartConnect(addrs, count);
|
||||||
|
|
||||||
// request a file server ip address
|
// request a file server ip address
|
||||||
NetCliGateKeeperFileSrvIpAddressRequest(FileSrvIpAddressCallback, nil, true);
|
NetCliGateKeeperFileSrvIpAddressRequest(FileSrvIpAddressCallback, nil, true);
|
||||||
|
|
||||||
while(!s_downloadComplete && !*abort) {
|
while(!s_downloadComplete && !*abort) {
|
||||||
NetClientUpdate();
|
NetClientUpdate();
|
||||||
AsyncSleep(10);
|
AsyncSleep(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetCliFileDisconnect();
|
NetCliFileDisconnect();
|
||||||
NetClientUpdate();
|
NetClientUpdate();
|
||||||
|
|
||||||
// Shutdown the client/server networking subsystem
|
// Shutdown the client/server networking subsystem
|
||||||
NetClientDestroy();
|
NetClientDestroy();
|
||||||
|
|
||||||
if (s_downloadComplete && !*abort && s_updated && IS_NET_SUCCESS(s_patchResult)) {
|
if (s_downloadComplete && !*abort && s_updated && IS_NET_SUCCESS(s_patchResult)) {
|
||||||
|
|
||||||
// launch new patcher
|
// launch new patcher
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
ZERO(si);
|
ZERO(si);
|
||||||
ZERO(pi);
|
ZERO(pi);
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
|
|
||||||
wchar cmdline[MAX_PATH];
|
wchar cmdline[MAX_PATH];
|
||||||
StrPrintf(cmdline, arrsize(cmdline), L"%s %s", s_newPatcherFile, info->cmdLine);
|
StrPrintf(cmdline, arrsize(cmdline), L"%s %s", s_newPatcherFile, info->cmdLine);
|
||||||
|
|
||||||
// we have only successfully patched if we actually launch the new version of the patcher
|
// we have only successfully patched if we actually launch the new version of the patcher
|
||||||
patched = CreateProcessW(
|
patched = CreateProcessW(
|
||||||
NULL,
|
NULL,
|
||||||
cmdline,
|
cmdline,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
DETACHED_PROCESS,
|
DETACHED_PROCESS,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&si,
|
&si,
|
||||||
&pi
|
&pi
|
||||||
);
|
);
|
||||||
SetReturnCode(pi.dwProcessId);
|
SetReturnCode(pi.dwProcessId);
|
||||||
CloseHandle( pi.hThread );
|
CloseHandle( pi.hThread );
|
||||||
CloseHandle( pi.hProcess );
|
CloseHandle( pi.hProcess );
|
||||||
ASSERT(patched);
|
ASSERT(patched);
|
||||||
}
|
}
|
||||||
|
|
||||||
return patched;
|
return patched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* ProgressStream Functions
|
* ProgressStream Functions
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
UInt32 SelfPatcherStream::Write(UInt32 byteCount, const void* buffer) {
|
UInt32 SelfPatcherStream::Write(UInt32 byteCount, const void* buffer) {
|
||||||
progress += byteCount;
|
progress += byteCount;
|
||||||
float p = (float)progress / (float)totalBytes * 100; // progress
|
float p = (float)progress / (float)totalBytes * 100; // progress
|
||||||
SetProgress( (int)p );
|
SetProgress( (int)p );
|
||||||
return plZlibStream::Write(byteCount, buffer);
|
return plZlibStream::Write(byteCount, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Protected Functions
|
* Protected Functions
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
// if return value is true, there was an update and the patcher should be shutdown, so the new patcher can take over
|
// if return value is true, there was an update and the patcher should be shutdown, so the new patcher can take over
|
||||||
bool SelfPatch (bool noSelfPatch, bool * abort, ENetError * result, plLauncherInfo *info) {
|
bool SelfPatch (bool noSelfPatch, bool * abort, ENetError * result, plLauncherInfo *info) {
|
||||||
bool patched = false;
|
bool patched = false;
|
||||||
if (!noSelfPatch) {
|
if (!noSelfPatch) {
|
||||||
SetText("Checking for patcher update...");
|
SetText("Checking for patcher update...");
|
||||||
patched = SelfPatcherProc(abort, info);
|
patched = SelfPatcherProc(abort, info);
|
||||||
}
|
}
|
||||||
*result = s_patchResult;
|
*result = s_patchResult;
|
||||||
return patched;
|
return patched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
@ -1,87 +1,87 @@
|
|||||||
/*==LICENSE==*
|
/*==LICENSE==*
|
||||||
|
|
||||||
CyanWorlds.com Engine - MMOG client, server and tools
|
CyanWorlds.com Engine - MMOG client, server and tools
|
||||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||||
or by snail mail at:
|
or by snail mail at:
|
||||||
Cyan Worlds, Inc.
|
Cyan Worlds, Inc.
|
||||||
14617 N Newport Hwy
|
14617 N Newport Hwy
|
||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h
|
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h included more than once"
|
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h included more than once"
|
||||||
#endif
|
#endif
|
||||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||||
|
|
||||||
enum EStatus {
|
enum EStatus {
|
||||||
kStatusOk,
|
kStatusOk,
|
||||||
kStatusError,
|
kStatusError,
|
||||||
kStatusPending,
|
kStatusPending,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PatchInfo {
|
struct PatchInfo {
|
||||||
unsigned progress;
|
unsigned progress;
|
||||||
unsigned stage;
|
unsigned stage;
|
||||||
unsigned progressStage;
|
unsigned progressStage;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*launcherCallback)(int status, void *param);
|
typedef void (*launcherCallback)(int status, void *param);
|
||||||
typedef void (*setTextCallback)(const char text[]);
|
typedef void (*setTextCallback)(const char text[]);
|
||||||
typedef void (*setStatusTextCallback)(const char text[]);
|
typedef void (*setStatusTextCallback)(const char text[]);
|
||||||
typedef void (*setTimeRemainingCallback)(unsigned seconds);
|
typedef void (*setTimeRemainingCallback)(unsigned seconds);
|
||||||
typedef void (*setBytesRemainingCallback)(unsigned bytes);
|
typedef void (*setBytesRemainingCallback)(unsigned bytes);
|
||||||
|
|
||||||
struct plLauncherInfo {
|
struct plLauncherInfo {
|
||||||
wchar path[MAX_PATH];
|
wchar path[MAX_PATH];
|
||||||
wchar cmdLine[512];
|
wchar cmdLine[512];
|
||||||
unsigned buildId; // buildId override
|
unsigned buildId; // buildId override
|
||||||
launcherCallback prepCallback;
|
launcherCallback prepCallback;
|
||||||
launcherCallback initCallback;
|
launcherCallback initCallback;
|
||||||
launcherCallback startCallback;
|
launcherCallback startCallback;
|
||||||
launcherCallback stopCallback;
|
launcherCallback stopCallback;
|
||||||
launcherCallback terminateCallback;
|
launcherCallback terminateCallback;
|
||||||
launcherCallback progressCallback;
|
launcherCallback progressCallback;
|
||||||
launcherCallback exitCallback;
|
launcherCallback exitCallback;
|
||||||
setTextCallback SetText;
|
setTextCallback SetText;
|
||||||
setStatusTextCallback SetStatusText;
|
setStatusTextCallback SetStatusText;
|
||||||
setTimeRemainingCallback SetTimeRemaining;
|
setTimeRemainingCallback SetTimeRemaining;
|
||||||
setBytesRemainingCallback SetBytesRemaining;
|
setBytesRemainingCallback SetBytesRemaining;
|
||||||
|
|
||||||
PatchInfo patchInfo;
|
PatchInfo patchInfo;
|
||||||
bool IsTGCider;
|
bool IsTGCider;
|
||||||
DWORD returnCode; // used so we can pass a new process id back to gametap. That way gametap wont think uru has exited when the patcher quits.
|
DWORD returnCode; // used so we can pass a new process id back to gametap. That way gametap wont think uru has exited when the patcher quits.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* Main.cpp
|
* Main.cpp
|
||||||
*
|
*
|
||||||
***/
|
***/
|
||||||
|
|
||||||
void SetProgress (unsigned progress) ;
|
void SetProgress (unsigned progress) ;
|
||||||
void SetText (const char text[]);
|
void SetText (const char text[]);
|
||||||
void SetStatusText (const char text[]);
|
void SetStatusText (const char text[]);
|
||||||
void SetTimeRemaining(unsigned seconds);
|
void SetTimeRemaining(unsigned seconds);
|
||||||
void SetBytesRemaining(unsigned bytes);
|
void SetBytesRemaining(unsigned bytes);
|
@ -1,125 +1,125 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include <afxres.h>
|
#include <afxres.h>
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include <afxres.h>\r\n"
|
"#include <afxres.h>\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_DIALOG DIALOGEX 0, 0, 301, 180
|
IDD_DIALOG DIALOGEX 0, 0, 301, 180
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
|
||||||
DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
|
DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL 109,IDB_BITMAP,"Static",SS_BITMAP | SS_SUNKEN,7,7,288,36
|
CONTROL 109,IDB_BITMAP,"Static",SS_BITMAP | SS_SUNKEN,7,7,288,36
|
||||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER | 0x1,7,
|
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER | 0x1,7,
|
||||||
162,234,11
|
162,234,11
|
||||||
LTEXT "Static",IDC_TEXT,10,152,266,8
|
LTEXT "Static",IDC_TEXT,10,152,266,8
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,243,162,51,11
|
PUSHBUTTON "Cancel",IDCANCEL,243,162,51,11
|
||||||
LTEXT "Welcome to URU",IDC_STATUS_TEXT,19,57,266,17
|
LTEXT "Welcome to URU",IDC_STATUS_TEXT,19,57,266,17
|
||||||
GROUPBOX "",IDC_STATIC,7,46,287,49
|
GROUPBOX "",IDC_STATIC,7,46,287,49
|
||||||
GROUPBOX "Status",IDC_STATIC,7,103,287,44
|
GROUPBOX "Status",IDC_STATIC,7,103,287,44
|
||||||
LTEXT "Approx. Time Remaining:",IDC_STATIC,19,117,88,11
|
LTEXT "Approx. Time Remaining:",IDC_STATIC,19,117,88,11
|
||||||
LTEXT "Update Remaining:",IDC_STATIC,20,130,73,9
|
LTEXT "Update Remaining:",IDC_STATIC,20,130,73,9
|
||||||
LTEXT "...",IDC_TIMEREMAINING,111,117,165,12
|
LTEXT "...",IDC_TIMEREMAINING,111,117,165,12
|
||||||
LTEXT "...",IDC_BYTESREMAINING,111,130,42,12
|
LTEXT "...",IDC_BYTESREMAINING,111,130,42,12
|
||||||
RTEXT "Product String",IDC_PRODUCTSTRING,19,85,272,8
|
RTEXT "Product String",IDC_PRODUCTSTRING,19,85,272,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DESIGNINFO
|
// DESIGNINFO
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO
|
GUIDELINES DESIGNINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_DIALOG, DIALOG
|
IDD_DIALOG, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 294
|
RIGHTMARGIN, 294
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 173
|
BOTTOMMARGIN, 173
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Bitmap
|
// Bitmap
|
||||||
//
|
//
|
||||||
|
|
||||||
IDB_BITMAP BITMAP "banner.bmp"
|
IDB_BITMAP BITMAP "banner.bmp"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
//
|
//
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON1 ICON "Dirt.ICO"
|
IDI_ICON1 ICON "Dirt.ICO"
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|