From edd9381a3c0e7c1864b0b857ec30774d8eaeb958 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 7 Feb 2014 19:29:36 -0800 Subject: [PATCH 1/5] General ui fix's --- .../data/gamedev/interfaces_v3/login_main.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml index 648cbbb6a..041a47359 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml @@ -645,34 +645,34 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + - - + - - + - - + - + - @@ -701,8 +701,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + From 7518c066b338e2db13c5c023245e732ee8b66133 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 7 Feb 2014 19:32:10 -0800 Subject: [PATCH 2/5] Change frontend to use shard.ryzomcore.org by default --- code/ryzom/server/frontend_service.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/server/frontend_service.cfg b/code/ryzom/server/frontend_service.cfg index 36a4103c5..2e3fb7601 100644 --- a/code/ryzom/server/frontend_service.cfg +++ b/code/ryzom/server/frontend_service.cfg @@ -6,7 +6,7 @@ BandwidthRatio = 1; FSUDPPort = 47851; -FSListenHost = "open.ryzom.com"; +FSListenHost = "shard.ryzomcore.org"; #include "frontend_service_default.cfg" From e728daa7cda0f542b1e255648d01f37b83109ba4 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 7 Feb 2014 19:49:40 -0800 Subject: [PATCH 3/5] Add CMAKE option and NVIDIA PerfHUD support --- code/CMakeModules/nel.cmake | 1 + .../3d/driver/direct3d/driver_direct3d.cpp | 36 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index ad6fbb2ae..8c0124fa2 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -236,6 +236,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) OPTION(FINAL_VERSION "Build in Final Version mode" ON ) + OPTION(WITH_PERFHUD "Build with NVIDIA PerfHUD support" OFF ) # Default to static building on Windows. IF(WIN32) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 13306432f..864406205 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1464,6 +1464,24 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r return false; } + #if WITH_PERFHUD + // Look for 'NVIDIA PerfHUD' adapter + // If it is present, override default settings + for (UINT gAdapter=0;gAdapter<_D3D->GetAdapterCount();gAdapter++) + { + D3DADAPTER_IDENTIFIER9 Identifier; + HRESULT Res; + Res = _D3D->GetAdapterIdentifier(gAdapter,0,&Identifier); + + if (strstr(Identifier.Description,"PerfHUD") != 0) + { + nlinfo ("Setting up with PerfHUD"); + adapter=gAdapter; + _Rasterizer=D3DDEVTYPE_REF; + break; + } + } + #endif WITH_PERFHUD // Create the D3D device HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, ¶meters, &_DeviceInterface); if (result != D3D_OK) @@ -1487,6 +1505,8 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r } } + + // _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, ¶meters, &_DeviceInterface); // Check some caps @@ -2635,13 +2655,15 @@ bool CDriverD3D::reset (const GfxMode& mode) #ifndef NL_NO_ASM CFpuRestorer fpuRestorer; // fpu control word is changed by "Reset" #endif - HRESULT hr = _DeviceInterface->Reset (¶meters); - if (hr != D3D_OK) - { - nlwarning("CDriverD3D::reset: Reset on _DeviceInterface error 0x%x", hr); - // tmp - nlstopex(("CDriverD3D::reset: Reset on _DeviceInterface")); - return false; + if (_Rasterizer!=D3DDEVTYPE_REF) { + HRESULT hr = _DeviceInterface->Reset (¶meters); + if (hr != D3D_OK) + { + nlwarning("CDriverD3D::reset: Reset on _DeviceInterface error 0x%x", hr); + // tmp + nlstopex(("CDriverD3D::reset: Reset on _DeviceInterface")); + return false; + } } } From 666ab7ebec7cd68717b221066a1482c20a240005 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 7 Feb 2014 20:10:07 -0800 Subject: [PATCH 4/5] Added linux patcher! --- code/CMakeModules/nel.cmake | 1 + code/ryzom/client/src/client_cfg.cpp | 22 ++-- code/ryzom/client/src/login_patch.cpp | 111 +++++++++++++++--- .../tools/patch_gen/patch_gen_common.cpp | 4 + 4 files changed, 115 insertions(+), 23 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 8c0124fa2..c7184d57e 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -237,6 +237,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_PCH "With Precompiled Headers" ON ) OPTION(FINAL_VERSION "Build in Final Version mode" ON ) OPTION(WITH_PERFHUD "Build with NVIDIA PerfHUD support" OFF ) + OPTION(WITH_PATCH_SUPPORT "Build with in-game Patch Support" OFF ) # Default to static building on Windows. IF(WIN32) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index b922fedb9..a065252a5 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -423,11 +423,11 @@ CClientConfig::CClientConfig() SelectionFXSize = 0.8f; // only force patching under Windows by default -#ifdef NL_OS_WINDOWS - PatchWanted = true; -#else - PatchWanted = false; -#endif + #if WITH_PATCH_SUPPORT + PatchWanted = true; + #else + PatchWanted = false; + #endif PatchUrl = ""; PatchletUrl = ""; PatchVersion = ""; @@ -846,7 +846,6 @@ void CClientConfig::setValues() if (nlstricmp(varPtr->asString(), "Auto") == 0 || nlstricmp(varPtr->asString(), "0") == 0) ClientCfg.Driver3D = CClientConfig::DrvAuto; else if (nlstricmp(varPtr->asString(), "OpenGL") == 0 || nlstricmp(varPtr->asString(), "1") == 0) ClientCfg.Driver3D = CClientConfig::OpenGL; else if (nlstricmp(varPtr->asString(), "Direct3D") == 0 || nlstricmp(varPtr->asString(), "2") == 0) ClientCfg.Driver3D = CClientConfig::Direct3D; - else if (nlstricmp(varPtr->asString(), "OpenGLES") == 0 || nlstricmp(varPtr->asString(), "3") == 0) ClientCfg.Driver3D = CClientConfig::OpenGLES; } else cfgWarning ("Default value used for 'Driver3D' !!!"); @@ -892,7 +891,9 @@ void CClientConfig::setValues() READ_STRING_FV(CreateAccountURL) READ_STRING_FV(EditAccountURL) READ_STRING_FV(ConditionsTermsURL) + READ_STRING_FV(BetaAccountURL) READ_STRING_FV(ForgetPwdURL) + READ_STRING_FV(FreeTrialURL) READ_STRING_FV(LoginSupportURL) #ifndef RZ_NO_CLIENT @@ -1057,11 +1058,18 @@ void CClientConfig::setValues() ///////////////////////// // NEW PATCHING SYSTEM // READ_BOOL_FV(PatchWanted) + READ_STRING_FV(PatchServer) + READ_STRING_FV(PatchUrl) + READ_STRING_FV(PatchVersion) + READ_STRING_FV(RingReleaseNotePath) + READ_STRING_FV(ReleaseNotePath) + READ_BOOL_DEV(PatchWanted) + READ_STRING_DEV(PatchServer) READ_STRING_DEV(PatchUrl) READ_STRING_DEV(PatchVersion) READ_STRING_DEV(RingReleaseNotePath) READ_STRING_DEV(ReleaseNotePath) - READ_STRING_FV(PatchServer) + ///////////////////////// // NEW PATCHLET SYSTEM // diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 860f5c7f2..d38c9953d 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -18,6 +18,14 @@ // Includes // +#include + +#ifdef NL_OS_WINDOWS + //windows doesnt have unistd.h +#else + #include +#endif + #include "stdpch.h" #include @@ -38,9 +46,7 @@ #include "nel/misc/big_file.h" #include "nel/misc/i18n.h" -#ifdef NL_OS_WINOWS - #define NL_USE_SEVENZIP 1 -#endif +#define NL_USE_SEVENZIP 1 // 7 zip includes #ifdef NL_USE_SEVENZIP @@ -740,6 +746,7 @@ void CPatchManager::deleteBatchFile() // **************************************************************************** void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool wantRyzomRestart, bool useBatchFile) { + uint nblab = 0; FILE *fp = NULL; @@ -753,7 +760,14 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool string err = toString("Can't open file '%s' for writing: code=%d %s (error code 29)", UpdateBatchFilename.c_str(), errno, strerror(errno)); throw Exception (err); } - fprintf(fp, "@echo off\n"); + //use bat if windows if not use sh + #ifdef NL_OS_WINDOWS + fprintf(fp, "@echo off\n"); + #else NL_OS_MAC + //mac patcher doesn't work yet + #else + fprintf(fp, "#!/bin/sh\npwd\n"); + #endif } // Unpack files with category ExtractPath non empty @@ -808,8 +822,15 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool if (useBatchFile) { - SrcPath = CPath::standardizeDosPath(SrcPath); - DstPath = CPath::standardizeDosPath(DstPath); + #ifdef NL_OS_WINDOWS + SrcPath = CPath::standardizeDosPath(SrcPath); + DstPath = CPath::standardizeDosPath(DstPath); + #elseif NL_OS_MAC + //no patcher on mac yet + #else + SrcPath = CPath::standardizePath(SrcPath); + DstPath = CPath::standardizePath(DstPath); + #endif } std::string SrcName = SrcPath + vFilenames[fff]; @@ -817,11 +838,21 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool if (useBatchFile) { - fprintf(fp, ":loop%u\n", nblab); - fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str()); - fprintf(fp, "del %s\n", DstName.c_str()); - fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab); - fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.c_str()); + //write windows .bat format else write sh format + #ifdef NL_OS_WINDOWS + fprintf(fp, ":loop%u\n", nblab); + fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str()); + fprintf(fp, "del %s\n", DstName.c_str()); + fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab); + fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.c_str()); + #elseif NL_OS_MAC + //no patcher on osx + #else + fprintf(fp, "chmod 777 %s\n", DstName.c_str()); + fprintf(fp, "rm -rf %s\n", DstName.c_str()); + fprintf(fp, "mv %s %s\n", SrcName.c_str(), DstPath.c_str()); + #endif + } else { @@ -838,18 +869,26 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool // Finalize batch file if (NLMISC::CFile::isExists("patch") && NLMISC::CFile::isDirectory("patch")) { + #ifdef NL_OS_WINDOWS if (useBatchFile) { fprintf(fp, ":looppatch\n"); } - + #endif + vector vFileList; CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false); for(uint32 i = 0; i < vFileList.size(); ++i) { if (useBatchFile) { - fprintf(fp, "del %s\n", CPath::standardizeDosPath(vFileList[i]).c_str()); + #ifdef NL_OS_WINDOWS + fprintf(fp, "del %s\n", CPath::standardizeDosPath(vFileList[i]).c_str()); + #elseif NL_OS_MAC + //no patcher on MAC yet + #else + fprintf(fp, "rm -f %s\n", CPath::standardizePath(vFileList[i]).c_str()); + #endif } else { @@ -859,8 +898,14 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool if (useBatchFile) { - fprintf(fp, "rd /Q /S patch\n"); - fprintf(fp, "if exist patch goto looppatch\n"); + #ifdef NL_OS_WINDOWS + fprintf(fp, "rd /Q /S patch\n"); + fprintf(fp, "if exist patch goto looppatch\n"); + #elseif NL_OS_MAC + //no patcher on mac yet + #else + fprintf(fp, "rm -rf patch\n"); + #endif } else { @@ -872,7 +917,11 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool { if (wantRyzomRestart) { + #ifdef NL_OS_WINDOWS fprintf(fp, "start %s %%1 %%2 %%3\n", RyzomFilename.c_str()); + #else + fprintf(fp, "/opt/tita/%s $1 $2 $3\n", RyzomFilename.c_str()); + #endif } bool writeError = ferror(fp) != 0; @@ -887,6 +936,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool throw NLMISC::EWriteError(UpdateBatchFilename.c_str()); } } + } // **************************************************************************** @@ -944,7 +994,36 @@ void CPatchManager::executeBatchFile() // CloseHandle( pi.hThread ); #else - // TODO for Linux and Mac OS + // Start the child process. + bool r2Mode = false; + #ifndef RY_BG_DOWNLOADER + r2Mode = ClientCfg.R2Mode; + #endif + string strCmdLine; + + strCmdLine = "./" + UpdateBatchFilename; + + chmod(strCmdLine.c_str(), S_IRWXU); + if (r2Mode) + { + if (execl(strCmdLine.c_str(), LoginLogin.c_str(), LoginPassword.c_str()) == -1) + { + int errsv = errno; + nlerror("Execl Error: %d %s", errsv, strCmdLine.c_str(), (char *) NULL); + } else { + nlinfo("Ran batch file r2Mode Success"); + } + } + else + { + if (execl(strCmdLine.c_str(), LoginLogin.c_str(), LoginPassword.c_str(), LoginShardId, (char *) NULL) == -1) + { + int errsv = errno; + nlerror("Execl r2mode Error: %d %s", errsv, strCmdLine.c_str()); + } else { + nlinfo("Ran batch file Success"); + } + } #endif // exit(0); diff --git a/code/ryzom/tools/patch_gen/patch_gen_common.cpp b/code/ryzom/tools/patch_gen/patch_gen_common.cpp index 590c0320a..3d28a2439 100644 --- a/code/ryzom/tools/patch_gen/patch_gen_common.cpp +++ b/code/ryzom/tools/patch_gen/patch_gen_common.cpp @@ -323,6 +323,8 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const for (uint32 i=packageIndex.fileCount();i--;) { + bool deleteRefAfterDelta= true; + bool usingTemporaryFile = false; // generate file name root std::string bnpFileName= _BnpDirectory+packageIndex.getFile(i).getFileName(); std::string refNameRoot= _RefDirectory+NLMISC::CFile::getFilenameWithoutExtension(bnpFileName); @@ -345,6 +347,8 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const prevVersionFileName= _RootDirectory + "empty"; NLMISC::COFile tmpFile(prevVersionFileName); tmpFile.close(); + usingTemporaryFile = true; + deleteRefAfterDelta= false; } else { From 275542fa018f43f62e07ead98bcf1fdf0346fe76 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 7 Feb 2014 20:12:15 -0800 Subject: [PATCH 5/5] Added 7z library to all versions needed for in-game patcher --- code/ryzom/client/src/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 324735ff8..fb9bfcaa9 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -5,10 +5,7 @@ ADD_SUBDIRECTORY(client_sheets) IF(WITH_RYZOM_CLIENT) # These are Windows/MFC apps -IF(WIN32) -# ADD_SUBDIRECTORY(bug_report) SET(SEVENZIP_LIBRARY "ryzom_sevenzip") -ENDIF(WIN32) ADD_SUBDIRECTORY(seven_zip)