This commit is contained in:
kaetemi 2014-02-08 16:26:01 +01:00
commit 8dac3b82f3
8 changed files with 157 additions and 45 deletions

View file

@ -236,6 +236,8 @@ 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 )
OPTION(WITH_PATCH_SUPPORT "Build with in-game Patch Support" OFF )
# Default to static building on Windows.
IF(WIN32)

View file

@ -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, &parameters, &_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, &parameters, &_DeviceInterface);
// Check some caps
@ -2635,6 +2655,7 @@ bool CDriverD3D::reset (const GfxMode& mode)
#ifndef NL_NO_ASM
CFpuRestorer fpuRestorer; // fpu control word is changed by "Reset"
#endif
if (_Rasterizer!=D3DDEVTYPE_REF) {
HRESULT hr = _DeviceInterface->Reset (&parameters);
if (hr != D3D_OK)
{
@ -2644,6 +2665,7 @@ bool CDriverD3D::reset (const GfxMode& mode)
return false;
}
}
}
_Lost = false;
// BeginScene now

View file

@ -645,34 +645,34 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
<group id="submit_gr" x="30" y="-20" posparent="window" sizeref="wh" w="-30" h="-15" posref="TL TL" >
<!-- login -->
<view type="text" id="txt_log" posref="TL TL" hardtext="uiUsername" fontsize="10" x="0" y="-60" color="255 255 255 255" />
<view type="text" id="txt_log" posref="TL TL" hardtext="uiUsername" fontsize="12" x="0" y="-60" color="255 255 255 255" />
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BL BL" w="260" h="24" fontsize="12" x="190" y="-4"
<instance template="edit_box_log" id="eb_login" posparent="txt_log" posref="BL BL" w="260" h="24" fontsize="12" x="190" y="0"
text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_login" reset_focus_on_hide="false" max_historic="0"
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_password:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="12" color="135 243 28 255" />
<!-- password -->
<view type="text" id="txt_pas" posparent="txt_log" posref="BL TL" hardtext="uiPassword" fontsize="10" x="0" y="-30" color="255 255 255 255" />
<view type="text" id="txt_pas" posparent="txt_log" posref="BL TL" hardtext="uiPassword" fontsize="12" x="0" y="-30" color="255 255 255 255" />
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BL BL" w="260" h="24" fontsize="14" x="190" y="-4"
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BL BL" w="260" h="24" fontsize="16" x="190" y="0"
text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_password" reset_focus_on_hide="false" max_historic="0" entry_type="password"
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_confirm_password:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
<!-- confirm password -->
<view type="text" id="txt_confirm_pas" posparent="txt_pas" posref="BL TL" hardtext="uiConfirmPassword" fontsize="10" x="0" y="-30" color="255 255 255 255" />
<view type="text" id="txt_confirm_pas" posparent="txt_pas" posref="BL TL" hardtext="uiConfirmPassword" fontsize="12" x="0" y="-30" color="255 255 255 255" />
<instance template="edit_box_log" id="eb_confirm_password" posparent="txt_confirm_pas" posref="BL BL" w="260" h="24" fontsize="14" x="190" y="-4"
<instance template="edit_box_log" id="eb_confirm_password" posparent="txt_confirm_pas" posref="BL BL" w="260" h="24" fontsize="16" x="190" y="0"
text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_password_conf" reset_focus_on_hide="false" max_historic="0" entry_type="password"
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_email:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
<!-- email -->
<view type="text" id="txt_email" posparent="txt_confirm_pas" posref="BL TL" hardtext="uiEmail" fontsize="10" x="0" y="-30" color="255 255 255 255" />
<view type="text" id="txt_email" posparent="txt_confirm_pas" posref="BL TL" hardtext="uiEmail" fontsize="12" x="0" y="-30" color="255 255 255 255" />
<instance template="edit_box_log" id="eb_email" posparent="txt_email" posref="BL BL" w="260" h="24" fontsize="12" x="190" y="0"
text_ref="BM BM" text_y="-2"
@ -687,9 +687,9 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
col_over="255 255 255 0" onclick_l="create_account_rules" params_l="" tooltip=""
/>
<view type="text" id="txt_accept_cond" posref="BR BL" posparent="accept_cond" hardtext="uiAcceptTermsOfUse1" fontsize="10" x="10" y="-2" color="255 255 255 255" />
<view type="text" id="txt_accept_cond" posref="BR BL" posparent="accept_cond" hardtext="uiAcceptTermsOfUse1" fontsize="10" x="20" y="-2" color="255 255 255 255" />
<ctrl type="text_button" id="terms_launch_url" style="log_url" posref="BR BL" posparent="txt_accept_cond" x="-2" y="0" hardtext="uiAcceptTermsOfUse2"
<ctrl type="text_button" id="terms_launch_url" style="log_url" posref="BR BL" posparent="txt_accept_cond" x="2" y="0" hardtext="uiAcceptTermsOfUse2"
onclick_l="open_url" params_l="cfg_ConditionsTermsURL"/>
<!-- ********************** -->
@ -701,8 +701,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
<group id="erros_txt" posparent="welcome_errors_gr" posref="TL TL" x="8" y="-8" sizeref="w" child_resize_h="true"
max_sizeparent="welcome_errors_gr" max_sizeref="h" max_h="-16">
<view type="text" id="errors_list" posref="TL TL" x="15" y="-15" fontsize="10" color="255 255 255 255" line_maxw="584"
shadow="true" multi_line="true" multi_line_space="10" multi_max_line="100" hardtext="uiCreateAccountWelcome" />
<view type="text" id="errors_list" posref="TL TL" x="15" y="-15" fontsize="12" color="255 255 255 255" line_maxw="584"
shadow="true" multi_line="true" multi_line_space="20" multi_max_line="100" hardtext="uiCreateAccountWelcome" />
</group>
<instance template="bk_scroll" id="err_back_scrollbar" active="true" posparent="welcome_errors_gr" posref="TR TL" x="4" w="24" sizeref="h" h="0" />

View file

@ -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)

View file

@ -423,11 +423,11 @@ CClientConfig::CClientConfig()
SelectionFXSize = 0.8f;
// only force patching under Windows by default
#ifdef NL_OS_WINDOWS
#if WITH_PATCH_SUPPORT
PatchWanted = true;
#else
#else
PatchWanted = false;
#endif
#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 //

View file

@ -18,6 +18,14 @@
// Includes
//
#include <sys/stat.h>
#ifdef NL_OS_WINDOWS
//windows doesnt have unistd.h
#else
#include <unistd.h>
#endif
#include "stdpch.h"
#include <memory>
@ -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);
}
//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)
{
#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)
{
//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,10 +869,12 @@ 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<string> vFileList;
CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false);
@ -849,7 +882,13 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
{
if (useBatchFile)
{
#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)
{
#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);

View file

@ -6,7 +6,7 @@
BandwidthRatio = 1;
FSUDPPort = 47851;
FSListenHost = "open.ryzom.com";
FSListenHost = "shard.ryzomcore.org";
#include "frontend_service_default.cfg"

View file

@ -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
{