mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Merge
This commit is contained in:
commit
8dac3b82f3
8 changed files with 157 additions and 45 deletions
|
@ -236,6 +236,8 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
||||||
OPTION(WITH_COVERAGE "With Code Coverage Support" OFF)
|
OPTION(WITH_COVERAGE "With Code Coverage Support" OFF)
|
||||||
OPTION(WITH_PCH "With Precompiled Headers" ON )
|
OPTION(WITH_PCH "With Precompiled Headers" ON )
|
||||||
OPTION(FINAL_VERSION "Build in Final Version mode" 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.
|
# Default to static building on Windows.
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
|
|
|
@ -1464,6 +1464,24 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
|
||||||
return false;
|
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
|
// Create the D3D device
|
||||||
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, ¶meters, &_DeviceInterface);
|
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, ¶meters, &_DeviceInterface);
|
||||||
if (result != D3D_OK)
|
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);
|
// _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, ¶meters, &_DeviceInterface);
|
||||||
|
|
||||||
// Check some caps
|
// Check some caps
|
||||||
|
@ -2635,13 +2655,15 @@ bool CDriverD3D::reset (const GfxMode& mode)
|
||||||
#ifndef NL_NO_ASM
|
#ifndef NL_NO_ASM
|
||||||
CFpuRestorer fpuRestorer; // fpu control word is changed by "Reset"
|
CFpuRestorer fpuRestorer; // fpu control word is changed by "Reset"
|
||||||
#endif
|
#endif
|
||||||
HRESULT hr = _DeviceInterface->Reset (¶meters);
|
if (_Rasterizer!=D3DDEVTYPE_REF) {
|
||||||
if (hr != D3D_OK)
|
HRESULT hr = _DeviceInterface->Reset (¶meters);
|
||||||
{
|
if (hr != D3D_OK)
|
||||||
nlwarning("CDriverD3D::reset: Reset on _DeviceInterface error 0x%x", hr);
|
{
|
||||||
// tmp
|
nlwarning("CDriverD3D::reset: Reset on _DeviceInterface error 0x%x", hr);
|
||||||
nlstopex(("CDriverD3D::reset: Reset on _DeviceInterface"));
|
// tmp
|
||||||
return false;
|
nlstopex(("CDriverD3D::reset: Reset on _DeviceInterface"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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" >
|
<group id="submit_gr" x="30" y="-20" posparent="window" sizeref="wh" w="-30" h="-15" posref="TL TL" >
|
||||||
|
|
||||||
<!-- login -->
|
<!-- 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"
|
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"
|
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"
|
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" />
|
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="12" color="135 243 28 255" />
|
||||||
|
|
||||||
<!-- password -->
|
<!-- 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"
|
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"
|
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"
|
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" />
|
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
|
||||||
|
|
||||||
<!-- confirm password -->
|
<!-- 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"
|
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"
|
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"
|
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" />
|
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
|
||||||
|
|
||||||
<!-- email -->
|
<!-- 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"
|
<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"
|
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=""
|
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"/>
|
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"
|
<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">
|
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"
|
<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="10" multi_max_line="100" hardtext="uiCreateAccountWelcome" />
|
shadow="true" multi_line="true" multi_line_space="20" multi_max_line="100" hardtext="uiCreateAccountWelcome" />
|
||||||
</group>
|
</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" />
|
<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" />
|
||||||
|
|
|
@ -5,10 +5,7 @@ ADD_SUBDIRECTORY(client_sheets)
|
||||||
IF(WITH_RYZOM_CLIENT)
|
IF(WITH_RYZOM_CLIENT)
|
||||||
|
|
||||||
# These are Windows/MFC apps
|
# These are Windows/MFC apps
|
||||||
IF(WIN32)
|
|
||||||
# ADD_SUBDIRECTORY(bug_report)
|
|
||||||
SET(SEVENZIP_LIBRARY "ryzom_sevenzip")
|
SET(SEVENZIP_LIBRARY "ryzom_sevenzip")
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(seven_zip)
|
ADD_SUBDIRECTORY(seven_zip)
|
||||||
|
|
||||||
|
|
|
@ -423,11 +423,11 @@ CClientConfig::CClientConfig()
|
||||||
SelectionFXSize = 0.8f;
|
SelectionFXSize = 0.8f;
|
||||||
|
|
||||||
// only force patching under Windows by default
|
// only force patching under Windows by default
|
||||||
#ifdef NL_OS_WINDOWS
|
#if WITH_PATCH_SUPPORT
|
||||||
PatchWanted = true;
|
PatchWanted = true;
|
||||||
#else
|
#else
|
||||||
PatchWanted = false;
|
PatchWanted = false;
|
||||||
#endif
|
#endif
|
||||||
PatchUrl = "";
|
PatchUrl = "";
|
||||||
PatchletUrl = "";
|
PatchletUrl = "";
|
||||||
PatchVersion = "";
|
PatchVersion = "";
|
||||||
|
@ -846,7 +846,6 @@ void CClientConfig::setValues()
|
||||||
if (nlstricmp(varPtr->asString(), "Auto") == 0 || nlstricmp(varPtr->asString(), "0") == 0) ClientCfg.Driver3D = CClientConfig::DrvAuto;
|
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(), "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(), "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
|
else
|
||||||
cfgWarning ("Default value used for 'Driver3D' !!!");
|
cfgWarning ("Default value used for 'Driver3D' !!!");
|
||||||
|
@ -892,7 +891,9 @@ void CClientConfig::setValues()
|
||||||
READ_STRING_FV(CreateAccountURL)
|
READ_STRING_FV(CreateAccountURL)
|
||||||
READ_STRING_FV(EditAccountURL)
|
READ_STRING_FV(EditAccountURL)
|
||||||
READ_STRING_FV(ConditionsTermsURL)
|
READ_STRING_FV(ConditionsTermsURL)
|
||||||
|
READ_STRING_FV(BetaAccountURL)
|
||||||
READ_STRING_FV(ForgetPwdURL)
|
READ_STRING_FV(ForgetPwdURL)
|
||||||
|
READ_STRING_FV(FreeTrialURL)
|
||||||
READ_STRING_FV(LoginSupportURL)
|
READ_STRING_FV(LoginSupportURL)
|
||||||
|
|
||||||
#ifndef RZ_NO_CLIENT
|
#ifndef RZ_NO_CLIENT
|
||||||
|
@ -1057,11 +1058,18 @@ void CClientConfig::setValues()
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
// NEW PATCHING SYSTEM //
|
// NEW PATCHING SYSTEM //
|
||||||
READ_BOOL_FV(PatchWanted)
|
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(PatchUrl)
|
||||||
READ_STRING_DEV(PatchVersion)
|
READ_STRING_DEV(PatchVersion)
|
||||||
READ_STRING_DEV(RingReleaseNotePath)
|
READ_STRING_DEV(RingReleaseNotePath)
|
||||||
READ_STRING_DEV(ReleaseNotePath)
|
READ_STRING_DEV(ReleaseNotePath)
|
||||||
READ_STRING_FV(PatchServer)
|
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
// NEW PATCHLET SYSTEM //
|
// NEW PATCHLET SYSTEM //
|
||||||
|
|
|
@ -18,6 +18,14 @@
|
||||||
// Includes
|
// Includes
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
//windows doesnt have unistd.h
|
||||||
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -38,9 +46,7 @@
|
||||||
#include "nel/misc/big_file.h"
|
#include "nel/misc/big_file.h"
|
||||||
#include "nel/misc/i18n.h"
|
#include "nel/misc/i18n.h"
|
||||||
|
|
||||||
#ifdef NL_OS_WINOWS
|
#define NL_USE_SEVENZIP 1
|
||||||
#define NL_USE_SEVENZIP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// 7 zip includes
|
// 7 zip includes
|
||||||
#ifdef NL_USE_SEVENZIP
|
#ifdef NL_USE_SEVENZIP
|
||||||
|
@ -740,6 +746,7 @@ void CPatchManager::deleteBatchFile()
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool wantRyzomRestart, bool useBatchFile)
|
void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool wantRyzomRestart, bool useBatchFile)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint nblab = 0;
|
uint nblab = 0;
|
||||||
|
|
||||||
FILE *fp = NULL;
|
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));
|
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);
|
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
|
// Unpack files with category ExtractPath non empty
|
||||||
|
@ -808,8 +822,15 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
|
|
||||||
if (useBatchFile)
|
if (useBatchFile)
|
||||||
{
|
{
|
||||||
SrcPath = CPath::standardizeDosPath(SrcPath);
|
#ifdef NL_OS_WINDOWS
|
||||||
DstPath = CPath::standardizeDosPath(DstPath);
|
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];
|
std::string SrcName = SrcPath + vFilenames[fff];
|
||||||
|
@ -817,11 +838,21 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
|
|
||||||
if (useBatchFile)
|
if (useBatchFile)
|
||||||
{
|
{
|
||||||
fprintf(fp, ":loop%u\n", nblab);
|
//write windows .bat format else write sh format
|
||||||
fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str());
|
#ifdef NL_OS_WINDOWS
|
||||||
fprintf(fp, "del %s\n", DstName.c_str());
|
fprintf(fp, ":loop%u\n", nblab);
|
||||||
fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab);
|
fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str());
|
||||||
fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.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
|
else
|
||||||
{
|
{
|
||||||
|
@ -838,18 +869,26 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
// Finalize batch file
|
// Finalize batch file
|
||||||
if (NLMISC::CFile::isExists("patch") && NLMISC::CFile::isDirectory("patch"))
|
if (NLMISC::CFile::isExists("patch") && NLMISC::CFile::isDirectory("patch"))
|
||||||
{
|
{
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
if (useBatchFile)
|
if (useBatchFile)
|
||||||
{
|
{
|
||||||
fprintf(fp, ":looppatch\n");
|
fprintf(fp, ":looppatch\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
vector<string> vFileList;
|
vector<string> vFileList;
|
||||||
CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false);
|
CPath::getPathContent ("patch", false, false, true, vFileList, NULL, false);
|
||||||
for(uint32 i = 0; i < vFileList.size(); ++i)
|
for(uint32 i = 0; i < vFileList.size(); ++i)
|
||||||
{
|
{
|
||||||
if (useBatchFile)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -859,8 +898,14 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
|
|
||||||
if (useBatchFile)
|
if (useBatchFile)
|
||||||
{
|
{
|
||||||
fprintf(fp, "rd /Q /S patch\n");
|
#ifdef NL_OS_WINDOWS
|
||||||
fprintf(fp, "if exist patch goto looppatch\n");
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -872,7 +917,11 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
{
|
{
|
||||||
if (wantRyzomRestart)
|
if (wantRyzomRestart)
|
||||||
{
|
{
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
fprintf(fp, "start %s %%1 %%2 %%3\n", RyzomFilename.c_str());
|
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;
|
bool writeError = ferror(fp) != 0;
|
||||||
|
@ -887,6 +936,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
||||||
throw NLMISC::EWriteError(UpdateBatchFilename.c_str());
|
throw NLMISC::EWriteError(UpdateBatchFilename.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
|
@ -944,7 +994,36 @@ void CPatchManager::executeBatchFile()
|
||||||
// CloseHandle( pi.hThread );
|
// CloseHandle( pi.hThread );
|
||||||
|
|
||||||
#else
|
#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
|
#endif
|
||||||
|
|
||||||
// exit(0);
|
// exit(0);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
BandwidthRatio = 1;
|
BandwidthRatio = 1;
|
||||||
|
|
||||||
FSUDPPort = 47851;
|
FSUDPPort = 47851;
|
||||||
FSListenHost = "open.ryzom.com";
|
FSListenHost = "shard.ryzomcore.org";
|
||||||
|
|
||||||
#include "frontend_service_default.cfg"
|
#include "frontend_service_default.cfg"
|
||||||
|
|
||||||
|
|
|
@ -323,6 +323,8 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const
|
||||||
|
|
||||||
for (uint32 i=packageIndex.fileCount();i--;)
|
for (uint32 i=packageIndex.fileCount();i--;)
|
||||||
{
|
{
|
||||||
|
bool deleteRefAfterDelta= true;
|
||||||
|
bool usingTemporaryFile = false;
|
||||||
// generate file name root
|
// generate file name root
|
||||||
std::string bnpFileName= _BnpDirectory+packageIndex.getFile(i).getFileName();
|
std::string bnpFileName= _BnpDirectory+packageIndex.getFile(i).getFileName();
|
||||||
std::string refNameRoot= _RefDirectory+NLMISC::CFile::getFilenameWithoutExtension(bnpFileName);
|
std::string refNameRoot= _RefDirectory+NLMISC::CFile::getFilenameWithoutExtension(bnpFileName);
|
||||||
|
@ -345,6 +347,8 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const
|
||||||
prevVersionFileName= _RootDirectory + "empty";
|
prevVersionFileName= _RootDirectory + "empty";
|
||||||
NLMISC::COFile tmpFile(prevVersionFileName);
|
NLMISC::COFile tmpFile(prevVersionFileName);
|
||||||
tmpFile.close();
|
tmpFile.close();
|
||||||
|
usingTemporaryFile = true;
|
||||||
|
deleteRefAfterDelta= false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue