From 2fad59f296a07534a7664296a020285e63a538e1 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:08:31 +0200 Subject: [PATCH 1/9] Changed: Added more memory leaks checks --HG-- branch : develop --- .../nel/src/3d/driver/direct3d/driver_direct3d.cpp | 4 ++++ code/nel/src/3d/driver/direct3d/driver_direct3d.h | 11 ++++++++++- .../3d/driver/direct3d/driver_direct3d_index.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_inputs.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_light.cpp | 4 ++++ .../driver/direct3d/driver_direct3d_material.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_matrix.cpp | 4 ++++ .../direct3d/driver_direct3d_pixel_program.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_profile.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_render.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_shader.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_texture.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_uniform.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_vertex.cpp | 4 ++++ .../direct3d/driver_direct3d_vertex_program.cpp | 4 ++++ code/nel/src/georges/form.cpp | 4 ++++ code/nel/src/georges/form_dfn.cpp | 4 ++++ code/nel/src/georges/form_elm.cpp | 4 ++++ code/nel/src/georges/form_loader.cpp | 4 ++++ code/nel/src/georges/header.cpp | 4 ++++ code/nel/src/georges/stdgeorges.h | 12 ++++++++++++ code/nel/src/georges/type.cpp | 4 ++++ code/nel/src/sound/driver/dsound/buffer_dsound.cpp | 4 ++++ .../src/sound/driver/dsound/listener_dsound.cpp | 3 +++ .../sound/driver/dsound/sound_driver_dsound.cpp | 3 +++ code/nel/src/sound/driver/dsound/source_dsound.cpp | 3 +++ code/nel/src/sound/driver/dsound/stddsound.h | 11 +++++++++++ code/nel/src/sound/driver/fmod/buffer_fmod.cpp | 4 ++++ code/nel/src/sound/driver/fmod/listener_fmod.cpp | 3 +++ .../src/sound/driver/fmod/music_channel_fmod.cpp | 4 ++++ .../src/sound/driver/fmod/sound_driver_fmod.cpp | 4 ++++ code/nel/src/sound/driver/fmod/source_fmod.cpp | 3 +++ code/nel/src/sound/driver/fmod/stdfmod.h | 12 ++++++++++++ code/nel/src/sound/driver/openal/buffer_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/effect_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/listener_al.cpp | 4 ++++ .../src/sound/driver/openal/sound_driver_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/source_al.cpp | 4 ++++ .../nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/buffer_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/effect_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/listener_xaudio2.cpp | 4 ++++ .../sound/driver/xaudio2/sound_driver_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/source_xaudio2.cpp | 4 ++++ code/ryzom/client/src/actions.cpp | 4 ++++ code/ryzom/client/src/actions_client.cpp | 3 +++ code/ryzom/client/src/animation.cpp | 3 +++ code/ryzom/client/src/animation_fx.cpp | 4 ++++ code/ryzom/client/src/animation_fx_id_array.cpp | 4 ++++ code/ryzom/client/src/animation_fx_misc.cpp | 4 ++++ code/ryzom/client/src/animation_misc.cpp | 3 +++ code/ryzom/client/src/animation_set.cpp | 4 ++++ code/ryzom/client/src/animation_state.cpp | 4 ++++ code/ryzom/client/src/app_bundle_utils.cpp | 4 ++++ code/ryzom/client/src/attached_fx.cpp | 4 ++++ code/ryzom/client/src/attack_list.cpp | 3 +++ code/ryzom/client/src/auto_anim.cpp | 3 +++ code/ryzom/client/src/behaviour_context.cpp | 4 ++++ code/ryzom/client/src/bg_downloader_access.cpp | 4 ++++ code/ryzom/client/src/browse_faq.cpp | 4 ++++ code/ryzom/client/src/camera.cpp | 4 ++++ code/ryzom/client/src/character_cl.cpp | 7 +++---- code/ryzom/client/src/commands.cpp | 3 +++ code/ryzom/client/src/http_client_curl.cpp | 4 ++++ code/ryzom/client/src/r2/auto_group.cpp | 4 ++++ code/ryzom/client/src/r2/config_var.cpp | 3 +++ code/ryzom/client/src/r2/displayer_base.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_lua.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_visual.cpp | 4 ++++ .../src/r2/displayer_visual_activity_sequence.cpp | 3 +++ .../client/src/r2/displayer_visual_entity.cpp | 4 ++++ .../ryzom/client/src/r2/displayer_visual_group.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_visual_road.cpp | 3 +++ .../ryzom/client/src/r2/displayer_visual_shape.cpp | 3 +++ code/ryzom/client/src/r2/dmc/action_historic.cpp | 4 ++++ .../client/src/r2/dmc/client_edition_module.cpp | 3 +++ code/ryzom/client/src/r2/dmc/com_lua_module.cpp | 3 +++ code/ryzom/client/src/r2/dmc/dmc.cpp | 3 +++ code/ryzom/client/src/r2/dmc/palette.cpp | 4 ++++ code/ryzom/client/src/r2/dmc/property_accessor.cpp | 5 +++++ code/ryzom/client/src/r2/editor.cpp | 12 ++++++++++++ .../client/src/r2/entity_custom_select_box.cpp | 4 ++++ code/ryzom/client/src/r2/entity_sorter.cpp | 4 ++++ code/ryzom/client/src/r2/instance.cpp | 3 +++ code/ryzom/client/src/r2/island_collision.cpp | 4 ++++ code/ryzom/client/src/r2/lua_event_forwarder.cpp | 3 +++ code/ryzom/client/src/r2/mesh_array.cpp | 3 +++ code/ryzom/client/src/r2/npc_editor.cpp | 4 ++++ code/ryzom/client/src/r2/object_factory_client.cpp | 14 ++++++++++++++ code/ryzom/client/src/r2/palette_node.cpp | 3 +++ code/ryzom/client/src/r2/prim_render.cpp | 3 +++ code/ryzom/client/src/r2/r2_config.cpp | 3 +++ code/ryzom/client/src/r2/r2_lua.cpp | 4 ++++ code/ryzom/client/src/r2/tool.cpp | 4 ++++ code/ryzom/client/src/r2/tool_choose_pos.cpp | 4 ++++ code/ryzom/client/src/r2/tool_choose_pos_lua.cpp | 4 ++++ code/ryzom/client/src/r2/tool_create_entity.cpp | 4 ++++ code/ryzom/client/src/r2/tool_draw_prim.cpp | 3 +++ .../ryzom/client/src/r2/tool_maintained_action.cpp | 4 ++++ code/ryzom/client/src/r2/tool_new_vertex.cpp | 4 ++++ code/ryzom/client/src/r2/tool_pick.cpp | 3 +++ code/ryzom/client/src/r2/tool_select_move.cpp | 3 +++ code/ryzom/client/src/r2/tool_select_rotate.cpp | 3 +++ code/ryzom/client/src/r2/verbose_clock.cpp | 4 ++++ code/ryzom/client/src/stdpch.h | 12 ++++++++++++ 105 files changed, 447 insertions(+), 5 deletions(-) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 5bd0e2cbf..be7a74722 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -32,6 +32,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index c497230aa..a4d9dbaeb 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -480,12 +480,21 @@ public: virtual ~CStateRecord() {} // use STL allocator for fast alloc. this works because objects are small ( < 128 bytes) void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); } + void *operator new(size_t size, int /* blockUse */, char const * /* fileName */, int /* lineNumber */) + { + // TODO: add memory leaks detector + return CStateRecord::Allocator.allocate(size); + } void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); } + void operator delete(void *block, int /* blockUse */, char const* /* fileName */, int /* lineNumber */) + { + // TODO: add memory leaks detector + CStateRecord::Allocator.deallocate((uint8 *)block, 1); + } static std::allocator Allocator; }; - // record of a single .fx pass class CFXPassRecord { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp index dfdc48670..d7ee84303 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp @@ -25,6 +25,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp index f754b6357..d26741faf 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp @@ -17,6 +17,10 @@ #include "stddirect3d.h" #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp index d3bb62e64..f68caab3a 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index cc54d6305..e6622f61d 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -27,6 +27,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp index c5b479de0..6e7520fb7 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp index e0a2cd4a4..7d79eb1a7 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp @@ -29,6 +29,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp index 4ff29481c..b574fff54 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp @@ -19,6 +19,10 @@ #include "driver_direct3d.h" #include "nel/misc/hierarchical_timer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp index 939dc1dc9..6b9d2ce0c 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp @@ -27,6 +27,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 6f48cc2a4..3f11f8bce 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -20,6 +20,10 @@ #include "nel/misc/path.h" #include "nel/misc/file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index d9ba5a526..a10732c64 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp index e44780e89..a936d5b46 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp @@ -18,6 +18,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp index 2b7fa8fa9..ba726fcc9 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp index 69ae49c4f..265468125 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp @@ -18,6 +18,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 22ed15a2e..f5cbcc3a1 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -24,6 +24,10 @@ #include "nel/georges/form.h" #include "nel/georges/form_loader.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLGEORGES diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 3f271b976..629c17f86 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -24,6 +24,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/form_elm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index a28fe2e9c..48368cc38 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -25,6 +25,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/type.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/form_loader.cpp b/code/nel/src/georges/form_loader.cpp index b56ed23ef..877c587ed 100644 --- a/code/nel/src/georges/form_loader.cpp +++ b/code/nel/src/georges/form_loader.cpp @@ -27,6 +27,10 @@ #include "nel/georges/form.h" #include "nel/georges/form_dfn.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/header.cpp b/code/nel/src/georges/header.cpp index f814d5802..40617e6d5 100644 --- a/code/nel/src/georges/header.cpp +++ b/code/nel/src/georges/header.cpp @@ -22,6 +22,10 @@ #include "nel/georges/header.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLGEORGES diff --git a/code/nel/src/georges/stdgeorges.h b/code/nel/src/georges/stdgeorges.h index a11169d27..fa0bf0819 100644 --- a/code/nel/src/georges/stdgeorges.h +++ b/code/nel/src/georges/stdgeorges.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDGEORGES_H +#define STDGEORGES_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include "nel/misc/types_nl.h" #include #include @@ -27,3 +37,5 @@ // Include from libxml2 #include + +#endif diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index cc3c44d6e..0dd2b9457 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -27,6 +27,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/type.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/buffer_dsound.cpp b/code/nel/src/sound/driver/dsound/buffer_dsound.cpp index 53fa8dcec..72423bba7 100644 --- a/code/nel/src/sound/driver/dsound/buffer_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/buffer_dsound.cpp @@ -23,6 +23,10 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/listener_dsound.cpp b/code/nel/src/sound/driver/dsound/listener_dsound.cpp index 3bed4f821..d8c81b58b 100644 --- a/code/nel/src/sound/driver/dsound/listener_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/listener_dsound.cpp @@ -18,6 +18,9 @@ #include "listener_dsound.h" #include "sound_driver_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp index 986993c49..d95b80ca0 100644 --- a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp @@ -31,6 +31,9 @@ #include "sound_driver_dsound.h" #include "listener_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/dsound/source_dsound.cpp b/code/nel/src/sound/driver/dsound/source_dsound.cpp index c3bff3289..b80d03590 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/source_dsound.cpp @@ -21,6 +21,9 @@ #include "buffer_dsound.h" #include "listener_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/stddsound.h b/code/nel/src/sound/driver/dsound/stddsound.h index f550e8150..cb953e630 100644 --- a/code/nel/src/sound/driver/dsound/stddsound.h +++ b/code/nel/src/sound/driver/dsound/stddsound.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDDSOUND_H +#define STDDSOUND_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include "nel/misc/types_nl.h" #define EAX_AVAILABLE 0 @@ -44,4 +54,5 @@ #include "nel/sound/driver/source.h" #include "nel/sound/driver/listener.h" +#endif /* end of file */ diff --git a/code/nel/src/sound/driver/fmod/buffer_fmod.cpp b/code/nel/src/sound/driver/fmod/buffer_fmod.cpp index 69081b013..edba0bec2 100644 --- a/code/nel/src/sound/driver/fmod/buffer_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/buffer_fmod.cpp @@ -25,6 +25,10 @@ # include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/fmod/listener_fmod.cpp b/code/nel/src/sound/driver/fmod/listener_fmod.cpp index ad308c937..776a23d70 100644 --- a/code/nel/src/sound/driver/fmod/listener_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/listener_fmod.cpp @@ -18,6 +18,9 @@ #include "listener_fmod.h" #include "sound_driver_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp b/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp index 3640869b6..9abfd1006 100644 --- a/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp @@ -18,6 +18,10 @@ #include "music_channel_fmod.h" #include "sound_driver_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp index 07455b963..d98aa600f 100644 --- a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp @@ -26,6 +26,10 @@ #include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/source_fmod.cpp b/code/nel/src/sound/driver/fmod/source_fmod.cpp index 6026ce2f5..1224d647d 100644 --- a/code/nel/src/sound/driver/fmod/source_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/source_fmod.cpp @@ -21,6 +21,9 @@ #include "buffer_fmod.h" #include "listener_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/fmod/stdfmod.h b/code/nel/src/sound/driver/fmod/stdfmod.h index afb1af3f1..4274adfe3 100644 --- a/code/nel/src/sound/driver/fmod/stdfmod.h +++ b/code/nel/src/sound/driver/fmod/stdfmod.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDFMOD_H +#define STDFMOD_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #ifdef NL_OS_WINDOWS @@ -42,4 +52,6 @@ #include "nel/sound/driver/source.h" #include "nel/sound/driver/listener.h" +#endif + /* end of file */ diff --git a/code/nel/src/sound/driver/openal/buffer_al.cpp b/code/nel/src/sound/driver/openal/buffer_al.cpp index 352128c3e..ae0054096 100644 --- a/code/nel/src/sound/driver/openal/buffer_al.cpp +++ b/code/nel/src/sound/driver/openal/buffer_al.cpp @@ -18,6 +18,10 @@ #include "sound_driver_al.h" #include "buffer_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLSOUND diff --git a/code/nel/src/sound/driver/openal/effect_al.cpp b/code/nel/src/sound/driver/openal/effect_al.cpp index 0eec97756..9a09ba7ac 100644 --- a/code/nel/src/sound/driver/openal/effect_al.cpp +++ b/code/nel/src/sound/driver/openal/effect_al.cpp @@ -19,6 +19,10 @@ #include "effect_al.h" #include "sound_driver_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; // using namespace NLMISC; diff --git a/code/nel/src/sound/driver/openal/listener_al.cpp b/code/nel/src/sound/driver/openal/listener_al.cpp index a79e551b6..f39f0f18f 100644 --- a/code/nel/src/sound/driver/openal/listener_al.cpp +++ b/code/nel/src/sound/driver/openal/listener_al.cpp @@ -18,6 +18,10 @@ #include "listener_al.h" #include "sound_driver_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLSOUND { diff --git a/code/nel/src/sound/driver/openal/sound_driver_al.cpp b/code/nel/src/sound/driver/openal/sound_driver_al.cpp index ab9574483..d237f533a 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.cpp +++ b/code/nel/src/sound/driver/openal/sound_driver_al.cpp @@ -22,6 +22,10 @@ #include "ext_al.h" #include "effect_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index c13db52af..825d9f1e9 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -22,6 +22,10 @@ #include "source_al.h" #include "ext_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // #define NLSOUND_DEBUG_GAIN using namespace std; diff --git a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp index 2db913268..e70fec076 100644 --- a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp @@ -20,6 +20,10 @@ #include "buffer_xaudio2.h" #include "adpcm_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; // using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp index 106d565f9..acdb95ab4 100644 --- a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp @@ -20,6 +20,10 @@ #include "buffer_xaudio2.h" #include "sound_driver_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp index 5c1f58722..ac3814226 100644 --- a/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp @@ -21,6 +21,10 @@ #include "listener_xaudio2.h" #include "effect_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp index 10b7e7e48..c6b364046 100644 --- a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp @@ -20,6 +20,10 @@ #include "sound_driver_xaudio2.h" #include "listener_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp index 529954006..992f6c66d 100644 --- a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp @@ -22,6 +22,10 @@ #include "effect_xaudio2.h" #include "sound_driver_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp index 021935e50..26566612c 100644 --- a/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp @@ -26,6 +26,10 @@ #include "effect_xaudio2.h" #include "source_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index 6b9a3649b..7aeaee537 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -22,6 +22,10 @@ #include "events_listener.h" #include "interface_v3/interface_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/actions_client.cpp b/code/ryzom/client/src/actions_client.cpp index a538afd50..0f9eabad1 100644 --- a/code/ryzom/client/src/actions_client.cpp +++ b/code/ryzom/client/src/actions_client.cpp @@ -28,6 +28,9 @@ #include "actions_client.h" #include "interface_v3/input_handler_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation.cpp b/code/ryzom/client/src/animation.cpp index 323405528..5968f6c55 100644 --- a/code/ryzom/client/src/animation.cpp +++ b/code/ryzom/client/src/animation.cpp @@ -35,6 +35,9 @@ #include "client_cfg.h" #include "entity_animation_manager.h" // \todo GUIGUI : added to recompile animations at loading (to do better ?). +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation_fx.cpp b/code/ryzom/client/src/animation_fx.cpp index 7be1a79a9..8f716d64e 100644 --- a/code/ryzom/client/src/animation_fx.cpp +++ b/code/ryzom/client/src/animation_fx.cpp @@ -27,6 +27,10 @@ #include "nel/3d/u_scene.h" #include "client_sheets/animation_fx_set_sheet.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; diff --git a/code/ryzom/client/src/animation_fx_id_array.cpp b/code/ryzom/client/src/animation_fx_id_array.cpp index 828ba2a7b..b3c07bbd7 100644 --- a/code/ryzom/client/src/animation_fx_id_array.cpp +++ b/code/ryzom/client/src/animation_fx_id_array.cpp @@ -23,6 +23,10 @@ // #include "nel/3d/u_scene.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; // ********************************************************************* diff --git a/code/ryzom/client/src/animation_fx_misc.cpp b/code/ryzom/client/src/animation_fx_misc.cpp index 9bfb3ffcd..45ee764ba 100644 --- a/code/ryzom/client/src/animation_fx_misc.cpp +++ b/code/ryzom/client/src/animation_fx_misc.cpp @@ -20,4 +20,8 @@ #include "animation_fx_misc.h" #include "animation_fx_id_array.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + CAnimationFXIDArray AnimFXMisc; diff --git a/code/ryzom/client/src/animation_misc.cpp b/code/ryzom/client/src/animation_misc.cpp index d9bf60816..60b13c83c 100644 --- a/code/ryzom/client/src/animation_misc.cpp +++ b/code/ryzom/client/src/animation_misc.cpp @@ -27,6 +27,9 @@ // 3d #include "nel/3d/u_track.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation_set.cpp b/code/ryzom/client/src/animation_set.cpp index 52bead6a1..5e93bc25b 100644 --- a/code/ryzom/client/src/animation_set.cpp +++ b/code/ryzom/client/src/animation_set.cpp @@ -33,6 +33,10 @@ #include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_loader.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/animation_state.cpp b/code/ryzom/client/src/animation_state.cpp index 8254d68b4..82aa27a54 100644 --- a/code/ryzom/client/src/animation_state.cpp +++ b/code/ryzom/client/src/animation_state.cpp @@ -30,6 +30,10 @@ // Georges #include "nel/georges/u_form_elm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/app_bundle_utils.cpp b/code/ryzom/client/src/app_bundle_utils.cpp index 42d1b61bc..4c4753c4f 100644 --- a/code/ryzom/client/src/app_bundle_utils.cpp +++ b/code/ryzom/client/src/app_bundle_utils.cpp @@ -21,6 +21,10 @@ #include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + std::string getAppBundlePath() { static std::string s_cachedPathToBundle; diff --git a/code/ryzom/client/src/attached_fx.cpp b/code/ryzom/client/src/attached_fx.cpp index 0f520f689..7a7b0cd4a 100644 --- a/code/ryzom/client/src/attached_fx.cpp +++ b/code/ryzom/client/src/attached_fx.cpp @@ -27,6 +27,10 @@ #include "time_client.h" #include "fx_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; diff --git a/code/ryzom/client/src/attack_list.cpp b/code/ryzom/client/src/attack_list.cpp index 494ba2e53..c748e5832 100644 --- a/code/ryzom/client/src/attack_list.cpp +++ b/code/ryzom/client/src/attack_list.cpp @@ -29,6 +29,9 @@ // #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_AttackList) diff --git a/code/ryzom/client/src/auto_anim.cpp b/code/ryzom/client/src/auto_anim.cpp index 5cc21305a..9676742bb 100644 --- a/code/ryzom/client/src/auto_anim.cpp +++ b/code/ryzom/client/src/auto_anim.cpp @@ -33,6 +33,9 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/behaviour_context.cpp b/code/ryzom/client/src/behaviour_context.cpp index a8df81d9f..e8fb2d6ea 100644 --- a/code/ryzom/client/src/behaviour_context.cpp +++ b/code/ryzom/client/src/behaviour_context.cpp @@ -19,6 +19,10 @@ #include "stdpch.h" #include "behaviour_context.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + CBehaviourContext::CBehaviourContext() { } diff --git a/code/ryzom/client/src/bg_downloader_access.cpp b/code/ryzom/client/src/bg_downloader_access.cpp index 1a479849e..426a4176b 100644 --- a/code/ryzom/client/src/bg_downloader_access.cpp +++ b/code/ryzom/client/src/bg_downloader_access.cpp @@ -31,6 +31,10 @@ #include "nel/misc/win_thread.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace BGDownloader; using namespace NLMISC; diff --git a/code/ryzom/client/src/browse_faq.cpp b/code/ryzom/client/src/browse_faq.cpp index ec0d7906d..f56ed0baf 100644 --- a/code/ryzom/client/src/browse_faq.cpp +++ b/code/ryzom/client/src/browse_faq.cpp @@ -17,6 +17,10 @@ #include "stdpch.h" #include "browse_faq.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; void browseFAQ(NLMISC::CConfigFile &cf) diff --git a/code/ryzom/client/src/camera.cpp b/code/ryzom/client/src/camera.cpp index 5f388fb28..904a2db49 100644 --- a/code/ryzom/client/src/camera.cpp +++ b/code/ryzom/client/src/camera.cpp @@ -22,6 +22,10 @@ #include "global.h" #include "misc.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index e73592acd..a473b4b80 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -111,6 +111,9 @@ #include "game_share/range_weapon_type.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //////////// // DEFINE // @@ -137,10 +140,6 @@ using namespace std; using namespace MBEHAV; using namespace CLFECOMMON; -#ifdef DEBUG_NEW -#define new DEBUG_NEW -#endif - //////////// // EXTERN // //////////// diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 8ba5f769f..7c33edb90 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -107,6 +107,9 @@ // to desactive some commands // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //////////////// diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index fcead3e5e..9b8bdb6ae 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; using namespace NLNET; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #define _Curl (CURL *)_CurlStruct diff --git a/code/ryzom/client/src/r2/auto_group.cpp b/code/ryzom/client/src/r2/auto_group.cpp index eeefbd7de..7372d6e48 100644 --- a/code/ryzom/client/src/r2/auto_group.cpp +++ b/code/ryzom/client/src/r2/auto_group.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/config_var.cpp b/code/ryzom/client/src/r2/config_var.cpp index bb9655ba9..4706acfb8 100644 --- a/code/ryzom/client/src/r2/config_var.cpp +++ b/code/ryzom/client/src/r2/config_var.cpp @@ -17,6 +17,9 @@ #include "stdpch.h" #include "config_var.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 diff --git a/code/ryzom/client/src/r2/displayer_base.cpp b/code/ryzom/client/src/r2/displayer_base.cpp index a3ae09621..1864d0e95 100644 --- a/code/ryzom/client/src/r2/displayer_base.cpp +++ b/code/ryzom/client/src/r2/displayer_base.cpp @@ -23,6 +23,10 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/interface_element.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/displayer_lua.cpp b/code/ryzom/client/src/r2/displayer_lua.cpp index 100dadc8d..2f17efb1a 100644 --- a/code/ryzom/client/src/r2/displayer_lua.cpp +++ b/code/ryzom/client/src/r2/displayer_lua.cpp @@ -20,6 +20,10 @@ #include "../interface_v3/lua_ihm_ryzom.h" #include "editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/displayer_visual.cpp b/code/ryzom/client/src/r2/displayer_visual.cpp index aec4ea1fe..76c4270a3 100644 --- a/code/ryzom/client/src/r2/displayer_visual.cpp +++ b/code/ryzom/client/src/r2/displayer_visual.cpp @@ -33,6 +33,10 @@ // #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; extern uint SkipFrame; diff --git a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp index 1d24b266c..6fd17b470 100644 --- a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp @@ -23,6 +23,9 @@ #include "../interface_v3/interface_manager.h" #include "nel/gui/view_renderer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index 238b4bf5c..d906d3d1e 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -58,6 +58,10 @@ // #include "../sheet_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/displayer_visual_group.cpp b/code/ryzom/client/src/r2/displayer_visual_group.cpp index 2f10f9512..3784879cc 100644 --- a/code/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_group.cpp @@ -38,6 +38,10 @@ #include "../time_client.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + class CGroupMap; using namespace R2; diff --git a/code/ryzom/client/src/r2/displayer_visual_road.cpp b/code/ryzom/client/src/r2/displayer_visual_road.cpp index dc9f8d9f2..629ca4729 100644 --- a/code/ryzom/client/src/r2/displayer_visual_road.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_road.cpp @@ -22,6 +22,9 @@ #include "../global.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/displayer_visual_shape.cpp b/code/ryzom/client/src/r2/displayer_visual_shape.cpp index d676f916a..9d7bba6ba 100644 --- a/code/ryzom/client/src/r2/displayer_visual_shape.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_shape.cpp @@ -33,6 +33,9 @@ #include "nel/3d/u_visual_collision_manager.h" #include "nel/3d/u_visual_collision_entity.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/dmc/action_historic.cpp b/code/ryzom/client/src/r2/dmc/action_historic.cpp index 4ad984778..e7a32cc62 100644 --- a/code/ryzom/client/src/r2/dmc/action_historic.cpp +++ b/code/ryzom/client/src/r2/dmc/action_historic.cpp @@ -21,6 +21,10 @@ #include "../editor.h" #include "nel/gui/lua_ihm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp index 649996256..a3da447dc 100644 --- a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp +++ b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp @@ -68,6 +68,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index d3f5b1a65..930e06051 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -58,6 +58,9 @@ using namespace NLGUI; using namespace NLMISC; using namespace R2; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif std::map CComLuaModule::_Instance; diff --git a/code/ryzom/client/src/r2/dmc/dmc.cpp b/code/ryzom/client/src/r2/dmc/dmc.cpp index f04feccf4..e03078009 100644 --- a/code/ryzom/client/src/r2/dmc/dmc.cpp +++ b/code/ryzom/client/src/r2/dmc/dmc.cpp @@ -45,6 +45,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLNET; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/dmc/palette.cpp b/code/ryzom/client/src/r2/dmc/palette.cpp index e0fb35b30..2ef0eb630 100644 --- a/code/ryzom/client/src/r2/dmc/palette.cpp +++ b/code/ryzom/client/src/r2/dmc/palette.cpp @@ -21,6 +21,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace R2; namespace R2 diff --git a/code/ryzom/client/src/r2/dmc/property_accessor.cpp b/code/ryzom/client/src/r2/dmc/property_accessor.cpp index a7037201a..3a8da702a 100644 --- a/code/ryzom/client/src/r2/dmc/property_accessor.cpp +++ b/code/ryzom/client/src/r2/dmc/property_accessor.cpp @@ -21,6 +21,11 @@ #include "game_share/object.h" #include + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace R2; diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index a5b889961..d0c169c97 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -115,6 +115,9 @@ using namespace NLGUI; #include "../far_tp.h" #include "nel/gui/lua_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NLNET; @@ -1628,8 +1631,17 @@ int CEditor::luaEnumInstances(CLuaState &ls) mt.setValue("__gc", CLuaObject(ls)); // void *newIter = ls.newUserData(sizeof(CInstanceEnumerator)); + +#ifdef new +#undef new +#endif + CInstanceEnumerator *ie = new (newIter) CInstanceEnumerator; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + ie->InstMap = &getEditor()._InstancesByDispName[classIndex]; ie->Current = ie->InstMap->begin(); mt.push(); diff --git a/code/ryzom/client/src/r2/entity_custom_select_box.cpp b/code/ryzom/client/src/r2/entity_custom_select_box.cpp index bcd757dc7..c426ad30c 100644 --- a/code/ryzom/client/src/r2/entity_custom_select_box.cpp +++ b/code/ryzom/client/src/r2/entity_custom_select_box.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/vector.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/entity_sorter.cpp b/code/ryzom/client/src/r2/entity_sorter.cpp index aee488ff6..201e65e03 100644 --- a/code/ryzom/client/src/r2/entity_sorter.cpp +++ b/code/ryzom/client/src/r2/entity_sorter.cpp @@ -20,6 +20,10 @@ #include "../user_entity.h" #include "../time_client.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/instance.cpp b/code/ryzom/client/src/r2/instance.cpp index 597e58d5d..f97719b0a 100644 --- a/code/ryzom/client/src/r2/instance.cpp +++ b/code/ryzom/client/src/r2/instance.cpp @@ -30,6 +30,9 @@ // #include "displayer_visual_entity.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/island_collision.cpp b/code/ryzom/client/src/r2/island_collision.cpp index fbc5a14ba..74829a17e 100644 --- a/code/ryzom/client/src/r2/island_collision.cpp +++ b/code/ryzom/client/src/r2/island_collision.cpp @@ -33,6 +33,10 @@ // #include "nel/3d/texture_file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern CContinentManager ContinentMngr; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/lua_event_forwarder.cpp b/code/ryzom/client/src/r2/lua_event_forwarder.cpp index cfacfaf07..27b1927b4 100644 --- a/code/ryzom/client/src/r2/lua_event_forwarder.cpp +++ b/code/ryzom/client/src/r2/lua_event_forwarder.cpp @@ -18,6 +18,9 @@ #include "lua_event_forwarder.h" #include "nel/gui/lua_object.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 { diff --git a/code/ryzom/client/src/r2/mesh_array.cpp b/code/ryzom/client/src/r2/mesh_array.cpp index 844370d41..661f56937 100644 --- a/code/ryzom/client/src/r2/mesh_array.cpp +++ b/code/ryzom/client/src/r2/mesh_array.cpp @@ -21,6 +21,9 @@ #include "../global.h" #include "../misc.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/npc_editor.cpp b/code/ryzom/client/src/r2/npc_editor.cpp index 5a154acee..a3c7e190d 100644 --- a/code/ryzom/client/src/r2/npc_editor.cpp +++ b/code/ryzom/client/src/r2/npc_editor.cpp @@ -27,6 +27,10 @@ #include "../sheet_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; using namespace std; diff --git a/code/ryzom/client/src/r2/object_factory_client.cpp b/code/ryzom/client/src/r2/object_factory_client.cpp index 688ec3fcb..f91ed6681 100644 --- a/code/ryzom/client/src/r2/object_factory_client.cpp +++ b/code/ryzom/client/src/r2/object_factory_client.cpp @@ -21,6 +21,10 @@ #include "nel/gui/lua_ihm.h" #include "../interface_v3/lua_ihm_ryzom.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { @@ -319,7 +323,17 @@ void CObjectTableClient::pushOnLuaStack(CLuaState &state, CLuaObject &metatable) nlassert(metatable.isValid()); // return a new refptr on the sub table void *block = state.newUserData(sizeof(TRefPtrConst)); + +#ifdef new +#undef new +#endif + new (block) CObjectTable::TRefPtrConst(this); // create in place + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + metatable.push(); state.setMetaTable(-2); _Ref.pop(state); diff --git a/code/ryzom/client/src/r2/palette_node.cpp b/code/ryzom/client/src/r2/palette_node.cpp index b24c5b6bd..d11eeaefa 100644 --- a/code/ryzom/client/src/r2/palette_node.cpp +++ b/code/ryzom/client/src/r2/palette_node.cpp @@ -18,6 +18,9 @@ #include "palette_node.h" #include "editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 diff --git a/code/ryzom/client/src/r2/prim_render.cpp b/code/ryzom/client/src/r2/prim_render.cpp index e714b979a..e8b1c23ac 100644 --- a/code/ryzom/client/src/r2/prim_render.cpp +++ b/code/ryzom/client/src/r2/prim_render.cpp @@ -29,6 +29,9 @@ #include "nel/gui/view_renderer.h" #include "../interface_v3/group_map.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NL3D; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/r2_config.cpp b/code/ryzom/client/src/r2/r2_config.cpp index 76fc73b39..47f9d56dd 100644 --- a/code/ryzom/client/src/r2/r2_config.cpp +++ b/code/ryzom/client/src/r2/r2_config.cpp @@ -17,6 +17,9 @@ #include "stdpch.h" #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/r2_lua.cpp b/code/ryzom/client/src/r2/r2_lua.cpp index efe510aa7..a29636bff 100644 --- a/code/ryzom/client/src/r2/r2_lua.cpp +++ b/code/ryzom/client/src/r2/r2_lua.cpp @@ -21,6 +21,10 @@ #include "stdpch.h" #include "r2_lua.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // stupid function to remove VC6 warnings #ifdef NL_COMP_VC6 void foo_r2_lua_cpp() {} diff --git a/code/ryzom/client/src/r2/tool.cpp b/code/ryzom/client/src/r2/tool.cpp index bcbe7f5ac..2e663a5ec 100644 --- a/code/ryzom/client/src/r2/tool.cpp +++ b/code/ryzom/client/src/r2/tool.cpp @@ -42,6 +42,10 @@ // #include "nel/3d/packed_world.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NLPACS::UGlobalRetriever *GR; diff --git a/code/ryzom/client/src/r2/tool_choose_pos.cpp b/code/ryzom/client/src/r2/tool_choose_pos.cpp index 64d0b9d7f..ae76fc3bf 100644 --- a/code/ryzom/client/src/r2/tool_choose_pos.cpp +++ b/code/ryzom/client/src/r2/tool_choose_pos.cpp @@ -35,6 +35,10 @@ #include "dmc/idmc.h" #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp index 85e1ba03e..5efaaae20 100644 --- a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp +++ b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/vectord.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_create_entity.cpp b/code/ryzom/client/src/r2/tool_create_entity.cpp index 7c6af14c5..b6be50bd7 100644 --- a/code/ryzom/client/src/r2/tool_create_entity.cpp +++ b/code/ryzom/client/src/r2/tool_create_entity.cpp @@ -41,6 +41,10 @@ #include "game_share/player_visual_properties.h" #include "game_share/visual_slot_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; using namespace std; diff --git a/code/ryzom/client/src/r2/tool_draw_prim.cpp b/code/ryzom/client/src/r2/tool_draw_prim.cpp index fa90ebcc7..da8c41f06 100644 --- a/code/ryzom/client/src/r2/tool_draw_prim.cpp +++ b/code/ryzom/client/src/r2/tool_draw_prim.cpp @@ -34,6 +34,9 @@ // tmp tmp #include "nel/gui/ctrl_quad.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_maintained_action.cpp b/code/ryzom/client/src/r2/tool_maintained_action.cpp index ce68a0b86..ea0adaa93 100644 --- a/code/ryzom/client/src/r2/tool_maintained_action.cpp +++ b/code/ryzom/client/src/r2/tool_maintained_action.cpp @@ -20,6 +20,10 @@ #include "editor.h" #include "../interface_v3/interface_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/tool_new_vertex.cpp b/code/ryzom/client/src/r2/tool_new_vertex.cpp index e0d722822..6d2443e52 100644 --- a/code/ryzom/client/src/r2/tool_new_vertex.cpp +++ b/code/ryzom/client/src/r2/tool_new_vertex.cpp @@ -23,6 +23,10 @@ // #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/tool_pick.cpp b/code/ryzom/client/src/r2/tool_pick.cpp index 972da9a3c..bb80a6258 100644 --- a/code/ryzom/client/src/r2/tool_pick.cpp +++ b/code/ryzom/client/src/r2/tool_pick.cpp @@ -21,6 +21,9 @@ // #include "nel/gui/lua_ihm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_select_move.cpp b/code/ryzom/client/src/r2/tool_select_move.cpp index 261e8b49a..f9b9b9a1a 100644 --- a/code/ryzom/client/src/r2/tool_select_move.cpp +++ b/code/ryzom/client/src/r2/tool_select_move.cpp @@ -31,6 +31,9 @@ // #include "nel/misc/matrix.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_select_rotate.cpp b/code/ryzom/client/src/r2/tool_select_rotate.cpp index b6f87e23c..56884a52b 100644 --- a/code/ryzom/client/src/r2/tool_select_rotate.cpp +++ b/code/ryzom/client/src/r2/tool_select_rotate.cpp @@ -28,6 +28,9 @@ #include "displayer_visual.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/verbose_clock.cpp b/code/ryzom/client/src/r2/verbose_clock.cpp index cd64cc2b3..23f14a735 100644 --- a/code/ryzom/client/src/r2/verbose_clock.cpp +++ b/code/ryzom/client/src/r2/verbose_clock.cpp @@ -20,6 +20,10 @@ // #include "verbose_clock.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index c017c584b..5b95b65d9 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef RYZOMCLIENT_STDPCH_H +#define RYZOMCLIENT_STDPCH_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #include @@ -126,3 +136,5 @@ # include # include #endif // NL_OS_WINDOWS + +#endif From 630ae259ad216bd61f161be31e9734eb4351d6b8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:10:51 +0200 Subject: [PATCH 2/9] Changed: Add Steam support in develop branch too --HG-- branch : develop --- code/CMakeModules/nel.cmake | 1 + code/ryzom/client/src/CMakeLists.txt | 18 +- code/ryzom/client/src/client.cpp | 22 ++- code/ryzom/client/src/far_tp.cpp | 49 ++++- code/ryzom/client/src/far_tp.h | 5 + code/ryzom/client/src/login.cpp | 177 +++++++++++++----- code/ryzom/client/src/login.h | 4 +- code/ryzom/tools/client/CMakeLists.txt | 5 +- .../client/client_config_qt/CMakeLists.txt | 4 + .../src/client_config_dialog.cpp | 5 + 10 files changed, 229 insertions(+), 61 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index e35ce11b2..ed0847015 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -352,6 +352,7 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) OPTION(WITH_RYZOM_CLIENT_UAC "Ask to run as Administrator" OFF) OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF) OPTION(WITH_RYZOM_CUSTOM_PATCH_SERVER "Only use patch server from CFG file" OFF) + OPTION(WITH_RYZOM_STEAM "Enable Steam features" OFF) OPTION(WITH_RYZOM_SANDBOX "Enable Sandbox under OS X" OFF) ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 996a08efa..26b208c67 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -13,7 +13,11 @@ IF(WITH_RYZOM_CLIENT) MESSAGE(FATAL_ERROR "The client cannot be built without the NeL GUI Library (WITH_GUI)") ENDIF() - IF(WITH_RYZOM_PATCH) + # Patch should never be enabled on Steam + IF(WITH_RYZOM_STEAM) + ADD_DEFINITIONS(-DRZ_USE_STEAM) + FIND_PACKAGE(Steam) + ELSEIF(WITH_RYZOM_PATCH) ADD_DEFINITIONS(-DRZ_USE_PATCH) IF(WITH_RYZOM_CUSTOM_PATCH_SERVER) @@ -131,6 +135,14 @@ IF(WITH_RYZOM_CLIENT) ENDIF() ENDIF() + IF(WITH_RYZOM_STEAM AND STEAM_RUNTIME) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${STEAM_RUNTIME} ${RYZOM_CONTENTS_DIR}/MacOS) + + IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --no-strict -fs "${APPLE_CERTIFICATE}" "${RYZOM_CONTENTS_DIR}/MacOS/${STEAM_RUNTIMENAME}" COMMENT "Signing Steam client runtime...") + ENDIF() + ENDIF() + IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign ${ENTITLEMENTS} -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing Ryzom bundle...") ENDIF() @@ -146,6 +158,10 @@ IF(WITH_RYZOM_CLIENT) ${OPENSSL_INCLUDE_DIR} ) + IF(STEAM_FOUND) + INCLUDE_DIRECTORIES(${STEAM_INCLUDE_DIRS}) + ENDIF() + TARGET_LINK_LIBRARIES(ryzom_client nelmisc nelnet diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index a487bf8dd..c92bb887b 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -54,6 +54,10 @@ #include "far_tp.h" #include "user_agent.h" +#ifdef RZ_USE_STEAM +#include "steam_client.h" +#endif + /////////// // USING // /////////// @@ -193,13 +197,17 @@ int main(int argc, char **argv) // no shard id in ring mode std::string sLoginShardId; - if (Args.haveAdditionalArg("login") && Args.haveAdditionalArg("password")) + if (Args.haveAdditionalArg("login")) { LoginLogin = Args.getAdditionalArg("login").front(); - LoginPassword = Args.getAdditionalArg("password").front(); - if (Args.haveAdditionalArg("shard_id")) - sLoginShardId = Args.getAdditionalArg("shard_id").front(); + if (Args.haveAdditionalArg("password")) + { + LoginPassword = Args.getAdditionalArg("password").front(); + + if (Args.haveAdditionalArg("shard_id")) + sLoginShardId = Args.getAdditionalArg("shard_id").front(); + } } if (sLoginShardId.empty() || !fromString(sLoginShardId, LoginShardId)) @@ -282,6 +290,12 @@ int main(int argc, char **argv) // initialize log initLog(); +#ifdef RZ_USE_STEAM + CSteamClient steamClient; + + if (steamClient.init()) + LoginCustomParameters = "&steam_auth_session_ticket=" + steamClient.getAuthSessionTicket(); +#endif // initialize patch manager and set the ryzom full path, before it's used CPatchManager *pPM = CPatchManager::getInstance(); diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index b5a0b19d1..bafb62103 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -189,7 +189,7 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event break; \ } \ -extern std::string LoginLogin, LoginPassword; +extern std::string LoginLogin, LoginPassword, LoginCustomParameters; extern bool noUserChar; extern bool userChar; extern bool serverReceivedReady; @@ -246,14 +246,26 @@ void CLoginStateMachine::run() if (!ClientCfg.TestBrowser) { - if (LoginLogin.empty()) + if (LoginPassword.empty()) { - // standard procedure - SM_BEGIN_EVENT_TABLE - SM_EVENT(ev_init_done, st_login); - SM_EVENT(ev_skip_all_login, st_ingame); - SM_EVENT(ev_quit, st_end); - SM_END_EVENT_TABLE + if (!LoginCustomParameters.empty() && LoginLogin.empty()) + { + // alternate login procedure + SM_BEGIN_EVENT_TABLE + SM_EVENT(ev_init_done, st_alt_login); + SM_EVENT(ev_skip_all_login, st_ingame); + SM_EVENT(ev_quit, st_end); + SM_END_EVENT_TABLE + } + else + { + // standard procedure + SM_BEGIN_EVENT_TABLE + SM_EVENT(ev_init_done, st_login); + SM_EVENT(ev_skip_all_login, st_ingame); + SM_EVENT(ev_quit, st_end); + SM_END_EVENT_TABLE + } } else { @@ -325,6 +337,27 @@ void CLoginStateMachine::run() // SM_EVENT(ev_login_ok, st_check_patch); // SM_EVENT(ev_quit, st_end); // SM_END_EVENT_TABLE +// } + break; + case st_alt_login: + initAltLogin(); + +// if (ClientCfg.R2Mode) + { + // r2 mode + SM_BEGIN_EVENT_TABLE + SM_EVENT(ev_login_not_alt, st_login); + SM_EVENT(ev_login_ok, st_check_patch); + SM_EVENT(ev_quit, st_end); + SM_END_EVENT_TABLE + } +// else +// { +// // legacy mode +// SM_BEGIN_EVENT_TABLE +// SM_EVENT(ev_login_ok, st_check_patch); +// SM_EVENT(ev_quit, st_end); +// SM_END_EVENT_TABLE // } break; case st_shard_list: diff --git a/code/ryzom/client/src/far_tp.h b/code/ryzom/client/src/far_tp.h index cec696ba3..a4c8f77b4 100644 --- a/code/ryzom/client/src/far_tp.h +++ b/code/ryzom/client/src/far_tp.h @@ -81,6 +81,8 @@ public: st_rate_session, /// create account st_create_account, + /// try to login with alternate login system + st_alt_login, /// pseudo state to leave the state machine st_end, /// @@ -156,6 +158,8 @@ public: ev_create_account, /// the client push the 'create account' button ev_close_create_account, + /// the client want to use alternate login system + ev_login_not_alt, /// ev_unknown }; @@ -203,6 +207,7 @@ void initEula(); void initPatchCheck(); void initCatDisplay(); void initAutoLogin(); +void initAltLogin(); void initPatch(); //void initWebBrowser(); void initReboot(); diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 36aaa2a54..986465986 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -81,7 +81,7 @@ extern bool SetMousePosFirstTime; vector Shards; -string LoginLogin, LoginPassword, ClientApp, Salt; +string LoginLogin, LoginPassword, ClientApp, Salt, LoginCustomParameters; uint32 LoginShardId = 0xFFFFFFFF; @@ -847,6 +847,55 @@ void initAutoLogin() } } +void initAltLogin() +{ + // Check the alt param + if (!LoginCustomParameters.empty()) + { + // don't use login and password for alternate login + string res = checkLogin("", "", ClientApp, LoginCustomParameters); + if (res.empty()) + { + if (ClientCfg.R2Mode) + { + LoginSM.pushEvent(CLoginStateMachine::ev_login_ok); + } + else + { + // Select good shard + ShardSelected = -1; + for (uint32 i = 0; i < Shards.size(); ++i) + { + if (Shards[i].ShardId == LoginShardId) + { + ShardSelected = i; + break; + } + } + + if (ShardSelected == -1) + { + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + pIM->messageBoxWithHelp(CI18N::get("uiErrServerLost"), "ui:login"); + LoginSM.pushEvent(CLoginStateMachine::ev_quit); + } + else + { + LoginSM.pushEvent(CLoginStateMachine::ev_login_ok); + } + } + + return; + } + } + + // close the socket in case of error + HttpClient.disconnect(); + + // ignore error + LoginSM.pushEvent(CLoginStateMachine::ev_login_not_alt); +} + // *************************************************************************** // Called from client.cpp @@ -1174,7 +1223,7 @@ void onlogin(bool vanishScreen = true) // Check the login/pass // main menu page for r2mode - string res = checkLogin(LoginLogin, LoginPassword, ClientApp); + string res = checkLogin(LoginLogin, LoginPassword, ClientApp, LoginCustomParameters); if (res.empty()) { // if not in auto login, push login ok event @@ -1901,16 +1950,33 @@ class CAHOpenURL : public IActionHandler return; } + // modify existing languages + + // old site string::size_type pos_lang = url.find("/en/"); - if(pos_lang!=string::npos) - url.replace(pos_lang+1, 2, ClientCfg.getHtmlLanguageCode()); + // or new forums + if (pos_lang == string::npos) + pos_lang = url.find("=en#"); - if(url.find('?')!=string::npos) - url += "&"; + if (pos_lang != string::npos) + { + url.replace(pos_lang + 1, 2, ClientCfg.getHtmlLanguageCode()); + } else - url += "?"; - url += "language=" + ClientCfg.LanguageCode; + { + // append language + if (url.find('?') != string::npos) + url += "&"; + else + url += "?"; + + url += "language=" + ClientCfg.LanguageCode; + + if (!LoginCustomParameters.empty()) + url += LoginCustomParameters; + } + openURL(url); nlinfo("openURL %s", url.c_str()); @@ -2333,6 +2399,10 @@ bool initCreateAccount() CurlHttpClient.verifyServer(true); // set this to false if you need to connect to the test environment std::string params = "language=" + lang; + + if (!LoginCustomParameters.empty()) + params += LoginCustomParameters; + if(!CurlHttpClient.sendGet(url, params, pPM->isVerboseLog())) { ucstring errorMessage("Can't send (error code 60)"); @@ -2523,6 +2593,9 @@ class CAHOnCreateAccountSubmit : public IActionHandler if(conditionsPushed) params += "&TaC=1"; + if (!LoginCustomParameters.empty()) + params += LoginCustomParameters; + std::string md5 = results[0] + results[1] + "" + results[3]; md5 = NLMISC::getMD5((uint8*)md5.data(), (uint32)md5.size()).toString(); @@ -2707,7 +2780,7 @@ REGISTER_ACTION_HANDLER (CAHOnBackToLogin, "on_back_to_login"); // *************************************************************************** -string checkLogin(const string &login, const string &password, const string &clientApp) +string checkLogin(const string &login, const string &password, const string &clientApp, const std::string &customParameters) { CPatchManager *pPM = CPatchManager::getInstance(); Shards.clear(); @@ -2725,50 +2798,64 @@ string checkLogin(const string &login, const string &password, const string &cli std::string url = ClientCfg.ConfigFile.getVar("StartupHost").asString() + ClientCfg.ConfigFile.getVar("StartupPage").asString(); - // ask server for salt - if(!HttpClient.sendGet(url + "?cmd=ask&cp=2&login=" + login + "&lg=" + ClientCfg.LanguageCode, "", pPM->isVerboseLog())) - return "Can't send (error code 60)"; - - if(pPM->isVerboseLog()) nlinfo("Sent request for password salt"); - - if(!HttpClient.receive(res, pPM->isVerboseLog())) - return "Can't receive (error code 61)"; - - if(pPM->isVerboseLog()) nlinfo("Received request login check"); - - if(res.empty()) - return "Empty answer from server (error code 62)"; - - if(res[0] == '0') + // don't use login with alt method + if (!login.empty()) { - // server returns an error - nlwarning("server error: %s", res.substr(2).c_str()); - return res.substr(2); - } - else if(res[0] == '1') - { - Salt = res.substr(2); - } - else - { - // server returns ??? - nlwarning("%s", res.c_str()); - return res; - } + // ask server for salt + if(!HttpClient.sendGet(url + "?cmd=ask&cp=2&login=" + login + "&lg=" + ClientCfg.LanguageCode, "", pPM->isVerboseLog())) + return "Can't send (error code 60)"; - // send login + crypted password + client app and cp=2 (as crypted password) - if(!HttpClient.connectToLogin()) - return "Can't connect (error code 63)"; + if(pPM->isVerboseLog()) nlinfo("Sent request for password salt"); - if(pPM->isVerboseLog()) nlinfo("Connected"); + if(!HttpClient.receive(res, pPM->isVerboseLog())) + return "Can't receive (error code 61)"; + + if(pPM->isVerboseLog()) nlinfo("Received request login check"); + + if(res.empty()) + return "Empty answer from server (error code 62)"; + + if(res[0] == '0') + { + // server returns an error + nlwarning("server error: %s", res.substr(2).c_str()); + return res.substr(2); + } + else if(res[0] == '1') + { + Salt = res.substr(2); + } + else + { + // server returns ??? + nlwarning("%s", res.c_str()); + return res; + } + + // send login + crypted password + client app and cp=2 (as crypted password) + if(!HttpClient.connectToLogin()) + return "Can't connect (error code 63)"; + + if(pPM->isVerboseLog()) nlinfo("Connected"); + } if (ClientCfg.R2Mode) { // R2 login sequence - std::string cryptedPassword = CCrypt::crypt(password, Salt); - if(!HttpClient.sendGet(url + "?cmd=login&login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=2" + "&lg=" + ClientCfg.LanguageCode)) - return "Can't send (error code 2)"; + if (!login.empty()) + { + std::string cryptedPassword = CCrypt::crypt(password, Salt); + + if(!HttpClient.sendGet(url + "?cmd=login&login=" + login + "&password=" + cryptedPassword + "&clientApplication=" + clientApp + "&cp=2" + "&lg=" + ClientCfg.LanguageCode + customParameters)) + return "Can't send (error code 2)"; + } + else + { + // don't send login and password if empty + if(!HttpClient.sendGet(url + "?cmd=login&clientApplication=" + clientApp + "&cp=2" + "&lg=" + ClientCfg.LanguageCode + customParameters)) + return "Can't send (error code 2)"; + } // the response should contains the result code and the cookie value if(pPM->isVerboseLog()) nlinfo("Sent request login check"); diff --git a/code/ryzom/client/src/login.h b/code/ryzom/client/src/login.h index ad2388100..2c6e8c960 100644 --- a/code/ryzom/client/src/login.h +++ b/code/ryzom/client/src/login.h @@ -46,7 +46,7 @@ struct CShard std::string EmergencyPatchURL; }; -extern std::string LoginLogin, LoginPassword; +extern std::string LoginLogin, LoginPassword, LoginCustomParameters; extern uint32 LoginShardId; @@ -54,7 +54,7 @@ extern uint32 AvailablePatchs; -std::string checkLogin(const std::string &login, const std::string &password, const std::string &clientApp); +std::string checkLogin(const std::string &login, const std::string &password, const std::string &clientApp, const std::string &customParameters = ""); std::string selectShard(uint32 shardId, std::string &cookie, std::string &addr); std::string getBGDownloaderCommandLine(); diff --git a/code/ryzom/tools/client/CMakeLists.txt b/code/ryzom/tools/client/CMakeLists.txt index 51cae98e7..66f8c9b48 100644 --- a/code/ryzom/tools/client/CMakeLists.txt +++ b/code/ryzom/tools/client/CMakeLists.txt @@ -1,5 +1,8 @@ IF(WITH_RYZOM_CLIENT) - ADD_SUBDIRECTORY(client_patcher) + # Don't need ryzom_client_patcher if using Steam + IF(NOT WITH_RYZOM_STEAM) + ADD_SUBDIRECTORY(client_patcher) + ENDIF() IF(WITH_QT OR WITH_QT5) ADD_SUBDIRECTORY(client_config_qt) diff --git a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt index 9cbe2bd3b..c81bfcbae 100644 --- a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt +++ b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt @@ -29,6 +29,10 @@ ELSE() QT5_WRAP_UI(CLIENT_CONFIG_UI_HDRS ${CLIENT_CONFIG_UIS}) ENDIF() +IF(WITH_RYZOM_STEAM) + ADD_DEFINITIONS(-DRZ_USE_STEAM) +ENDIF() + SOURCE_GROUP("Resources" FILES ${CLIENT_CONFIG_RCS}) SOURCE_GROUP("Forms" FILES ${CLIENT_CONFIG_UIS}) SOURCE_GROUP("Generated Files" FILES ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_MOC_SRC}) diff --git a/code/ryzom/tools/client/client_config_qt/src/client_config_dialog.cpp b/code/ryzom/tools/client/client_config_qt/src/client_config_dialog.cpp index ecac3ccdb..31fcfd1ac 100644 --- a/code/ryzom/tools/client/client_config_qt/src/client_config_dialog.cpp +++ b/code/ryzom/tools/client/client_config_qt/src/client_config_dialog.cpp @@ -86,6 +86,11 @@ CClientConfigDialog::CClientConfigDialog( QWidget *parent ) : item->setHidden(true); #endif +#ifdef RZ_USE_STEAM + // Hide Play Ryzom button if using Steam because we need to launch it from Steam + playButton->setHidden(true); +#endif + CategoryStackedWidget->addWidget( new CGeneralSettingsWidget( CategoryStackedWidget ) ); CategoryStackedWidget->addWidget( new CDisplaySettingsWidget( CategoryStackedWidget ) ); CategoryStackedWidget->addWidget( new CDisplaySettingsDetailsWidget( CategoryStackedWidget ) ); From 8acaa65e04040f4b409797eb103e2f3a793520c8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:17:10 +0200 Subject: [PATCH 3/9] Fixed: Compilation with OpenSSL 1.1.0 --HG-- branch : develop --- code/CMakeLists.txt | 2 ++ code/ryzom/client/src/http_client_curl.cpp | 23 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 99a1b7335..0bfe05bb8 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -447,6 +447,8 @@ IF(WITH_NEL) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY}) ENDIF() ENDIF() + ELSEIF(WIN32) + SET(CURL_LIBRARIES ${CURL_LIBRARIES} Crypt32.lib) ENDIF() ENDIF() ENDIF() diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index 9b8bdb6ae..2fd5bad81 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -117,6 +117,25 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm if (itmp && itmp->x509) { + X509_NAME *subject = X509_get_subject_name(itmp->x509); + + std::string name; + unsigned char *tmp = NULL; + + // construct a multiline string with name + for (int i = 0, ilen = X509_NAME_entry_count(subject); i < ilen; ++i) + { + X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, i); + ASN1_STRING *d = X509_NAME_ENTRY_get_data(e); + + if (ASN1_STRING_to_UTF8(&tmp, d) > 0) + { + name += NLMISC::toString("%s\n", tmp); + + OPENSSL_free(tmp); + } + } + // add our certificate to this store if (X509_STORE_add_cert(store, itmp->x509) == 0) { @@ -126,13 +145,13 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE) { ERR_error_string_n(errCode, errorBuffer, 1024); - nlwarning("Error adding certificate %s: %s", itmp->x509->name, errorBuffer); + nlwarning("Error adding certificate %s: %s", name.c_str(), errorBuffer); res = CURLE_SSL_CACERT; } } else { - nlinfo("Added certificate %s", itmp->x509->name); + nlinfo("Added certificate %s", name.c_str()); } } } From 30c6a7a9350fb8b0f8dd7a2397d90d47807b9c95 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:17:41 +0200 Subject: [PATCH 4/9] Changed: CMake policy CMP0005 will be removed soon so don't use it --HG-- branch : develop --- code/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 0bfe05bb8..cce763bac 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -28,10 +28,6 @@ IF(COMMAND cmake_policy) # have absolute paths (e.g. -lpthread) cmake_policy(SET CMP0003 NEW) - # Works around warnings about escaped quotes in ADD_DEFINITIONS - # statements - cmake_policy(SET CMP0005 OLD) - # allow to link to qtmain automatically under Windows IF(POLICY CMP0020) CMAKE_POLICY(SET CMP0020 NEW) From aa6d1a7bbb2f3124c668c0c4f5a016666b8e349d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:18:15 +0200 Subject: [PATCH 5/9] Changed: Updated Android ans iOS toolchains --HG-- branch : develop --- code/CMakeModules/AndroidToolChain.cmake | 168 +++++++++-------------- code/CMakeModules/iOSToolChain.cmake | 31 ++--- 2 files changed, 78 insertions(+), 121 deletions(-) diff --git a/code/CMakeModules/AndroidToolChain.cmake b/code/CMakeModules/AndroidToolChain.cmake index 7135400e2..4ca702295 100644 --- a/code/CMakeModules/AndroidToolChain.cmake +++ b/code/CMakeModules/AndroidToolChain.cmake @@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7") SET(TOOLCHAIN_ARCH "arm") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") - SET(MINIMUM_NDK_TARGET 4) + SET(MINIMUM_NDK_TARGET 9) ELSEIF(TARGET_CPU STREQUAL "armv5") SET(LIBRARY_ARCHITECTURE "armeabi") SET(CMAKE_SYSTEM_PROCESSOR "armv5") SET(TOOLCHAIN_ARCH "arm") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") - SET(MINIMUM_NDK_TARGET 4) + SET(MINIMUM_NDK_TARGET 9) ELSEIF(TARGET_CPU STREQUAL "arm64") SET(LIBRARY_ARCHITECTURE "arm64-v8a") SET(CMAKE_SYSTEM_PROCESSOR "arm64") @@ -76,14 +76,9 @@ ELSE() ENDIF() SET(CLANG_TOOLCHAIN_PREFIX "llvm") -SET(ANDROID_COMPILER "GCC") - -IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang") - SET(ANDROID_COMPILER "clang") - SET(CLANG ON) -ELSE() - SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION}) -ENDIF() +SET(ANDROID_COMPILER "clang") +SET(ANDROID_COMPILER "clang") +SET(CLANG ON) IF(NOT NDK_TARGET) SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) @@ -94,88 +89,71 @@ ELSE() ENDIF() IF(CMAKE_HOST_WIN32) - SET(TOOLCHAIN_HOST "windows") + SET(TOOLCHAIN_HOST "windows-x86_64") SET(TOOLCHAIN_BIN_SUFFIX ".exe") ELSEIF(CMAKE_HOST_APPLE) SET(TOOLCHAIN_HOST "apple") SET(TOOLCHAIN_BIN_SUFFIX "") ELSEIF(CMAKE_HOST_UNIX) - SET(TOOLCHAIN_HOST "linux") + SET(TOOLCHAIN_HOST "linux-x86_64") SET(TOOLCHAIN_BIN_SUFFIX "") ENDIF() -MACRO(SEARCH_TOOLCHAIN _COMPILER) - SET(${_COMPILER}_TOOLCHAIN_VERSIONS) - FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*") - IF(_TOOLCHAIN_VERSIONS) - LIST(SORT _TOOLCHAIN_VERSIONS) - LIST(REVERSE _TOOLCHAIN_VERSIONS) - FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS}) - STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") - IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") - LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) - ENDIF() - ENDFOREACH() - ENDIF() +# clang +SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}") - # try prefixes without version - SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}") - IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION}) - LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default") - ENDIF() +IF(EXISTS ${CLANG_TOOLCHAIN_ROOT}) + MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}") +ELSE() + MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}") +ENDIF() - IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS) - MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains") - ENDIF() - - IF(${_COMPILER}_TOOLCHAIN_VERSIONS) - LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX) - IF(_INDEX EQUAL -1) - LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) +# gcc +SET(GCC_TOOLCHAIN_VERSIONS) +FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*") +IF(_TOOLCHAIN_VERSIONS) + LIST(SORT _TOOLCHAIN_VERSIONS) + LIST(REVERSE _TOOLCHAIN_VERSIONS) + FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS}) + STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") + IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") + LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) ENDIF() - ELSE() - LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) - ENDIF() - - MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}") - - IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default") - MESSAGE(STATUS "default") - SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}") - ELSE() - MESSAGE(STATUS "not default") - SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") - ENDIF() - - IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}") - FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*") - IF(_TOOLCHAIN_PREFIXES) - LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT) - ENDIF() - ENDIF() -ENDMACRO() - -IF(CLANG) - SEARCH_TOOLCHAIN(CLANG) - - MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}") + ENDFOREACH() ENDIF() -SEARCH_TOOLCHAIN(GCC) - -MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}") - -IF(CLANG_TOOLCHAIN_ROOT) - MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}") +IF(NOT GCC_TOOLCHAIN_VERSIONS) + MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains") ENDIF() -IF(GCC_TOOLCHAIN_ROOT) - MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") +IF(GCC_TOOLCHAIN_VERSIONS) + LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX) + IF(_INDEX EQUAL -1) + LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION) + ENDIF() +ELSE() + LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION) ENDIF() +SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") + +IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}") + FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*") + IF(_TOOLCHAIN_PREFIXES) + LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT) + ENDIF() +ENDIF() + +IF(EXISTS "${GCC_TOOLCHAIN_ROOT}") + MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") +ELSE() + MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}") +ENDIF() + +# NDK SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") -MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}") +MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}") # include dirs SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include") @@ -208,41 +186,29 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY) SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) ENDMACRO() -# Force the compilers to GCC for Android -include (CMakeForceCompiler) +SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) -IF(CLANG) - MESSAGE(STATUS "Using clang compiler") +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++) - SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang) - SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++) +SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER}) +SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX}) +SET(CMAKE_C_COMPILER_FORCED TRUE) - CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang) - CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang) +SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}) +SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX}) +SET(CMAKE_CXX_COMPILER_FORCED TRUE) - SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as) - SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar) - SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++) - - IF(NOT EXISTS "${CMAKE_ASM_COMPILER}") - SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) - ENDIF() - - IF(NOT EXISTS "${CMAKE_AR}") - SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar) - ENDIF() -ELSE() - MESSAGE(STATUS "Using GCC compiler") - - SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc) - SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++) - - CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU) - CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++) +IF(NOT EXISTS "${CMAKE_ASM_COMPILER}") SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) +ENDIF() + +IF(NOT EXISTS "${CMAKE_AR}") SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar) - SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld) ENDIF() SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip) diff --git a/code/CMakeModules/iOSToolChain.cmake b/code/CMakeModules/iOSToolChain.cmake index 610045e33..7bcb57227 100644 --- a/code/CMakeModules/iOSToolChain.cmake +++ b/code/CMakeModules/iOSToolChain.cmake @@ -35,23 +35,6 @@ SET(UNIX ON) SET(APPLE ON) SET(IOS ON) -# Force the compilers to Clang for iOS -include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER (clang Clang) -CMAKE_FORCE_CXX_COMPILER (clang++ Clang) - -IF(CMAKE_CXX_COMPILER) - EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version - OUTPUT_VARIABLE CLANG_VERSION_RAW - OUTPUT_STRIP_TRAILING_WHITESPACE) - - STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*" - "\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}") - - SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) - SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) -ENDIF() - # Setup iOS platform IF(NOT DEFINED IOS_PLATFORM) SET(IOS_PLATFORM "OS") @@ -162,14 +145,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode) ENDIF() ELSE() IF(${IOS_PLATFORM} STREQUAL "OS") - SET(ARCHS "armv7;arm64") + SET(ARCHS armv7 arm64) SET(CMAKE_SYSTEM_PROCESSOR "armv7") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") # iPhone simulator targets i386 SET(ARCHS "i386") SET(CMAKE_SYSTEM_PROCESSOR "x86") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(ARCHS "armv7;arm64;i386;x86_64") + SET(ARCHS armv7 arm64 i386 x86_64) SET(CMAKE_SYSTEM_PROCESSOR "armv7") ENDIF() ENDIF() @@ -198,5 +181,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +# Force the compilers to Clang for iOS +SET(CMAKE_C_COMPILER clang) +SET(CMAKE_CXX_COMPILER clang++) + +# Skip the platform compiler checks for cross compiling. +SET(CMAKE_CXX_COMPILER_FORCED TRUE) +SET(CMAKE_C_COMPILER_FORCED TRUE) + # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH -include(CMakeFindBinUtils) +INCLUDE(CMakeFindBinUtils) From 92bc8661df1ae080ea582c9bc134a9880a47bc5f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:19:24 +0200 Subject: [PATCH 6/9] Fixed: Support for Visual C++ 2017 and latest Windows 10 Kits --HG-- branch : develop --- code/CMakeModules/FindMSVC.cmake | 58 ++++++++++++- code/CMakeModules/FindWindowsSDK.cmake | 114 ++++++++++++++++--------- code/CMakeModules/nel.cmake | 7 ++ 3 files changed, 136 insertions(+), 43 deletions(-) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index dceb6f054..706541463 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -5,6 +5,24 @@ # VC_LIBRARY_DIR - where to find libraries # VC_FOUND - True if MSVC found. +MACRO(ADD_TRAILING_SLASH _FILENAME_VAR) + # put content in a new variable + SET(_FILENAME ${${_FILENAME_VAR}}) + # get length of the string + STRING(LENGTH ${_FILENAME} _LEN) + # convert length to last pos + MATH(EXPR _POS "${_LEN}-1") + # get last character of the string + STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END) + # compare it with a slash + IF(NOT _FILENAME_END STREQUAL "/") + # not a slash, append it + SET(${_FILENAME_VAR} "${_FILENAME}/") + ELSE() + # already a slash + ENDIF() +ENDMACRO() + MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) # Software/Wow6432Node/... GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE) @@ -12,7 +30,11 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_DIR) GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE) + IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") + # be sure it's finishing by a / + ADD_TRAILING_SLASH(VC${_VERSION}_DIR) + SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/") ENDIF() ENDIF() @@ -55,7 +77,34 @@ MACRO(DETECT_EXPRESS_VERSION _VERSION) ENDIF() ENDMACRO() -IF(MSVC14) +IF(MSVC1411 OR MSVC1410) + DETECT_VC_VERSION("15.0") + SET(MSVC_TOOLSET "140") + + SET(VC_DIR "${VC_DIR}Tools/MSVC") + + FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*") + + IF(MSVC_TOOLCHAIN_VERSIONS) + LIST(SORT MSVC_TOOLCHAIN_VERSIONS) + LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS) + ENDIF() + + IF(NOT MSVC_TOOLCHAIN_VERSIONS) + MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}") + ENDIF() + + LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION) + + SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") + SET(VC_INCLUDE_DIR "${VC_DIR}/include") + + IF(NOT MSVC14_REDIST_DIR) + # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist + # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT + SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist") + ENDIF() +ELSEIF(MSVC14) DETECT_VC_VERSION("14.0") SET(MSVC_TOOLSET "140") @@ -109,6 +158,11 @@ IF(NOT VC_DIR) STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) ENDIF() -SET(VC_INCLUDE_DIR "${VC_DIR}/include") +IF(NOT VC_INCLUDE_DIR) + SET(VC_INCLUDE_DIR "${VC_DIR}/include") +ENDIF() + +MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}") + SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index d7918816f..0e2735570 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) SET(WINSDK${_VERSION}_FOUND ON) SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") IF(NOT WindowsSDK_FIND_QUIETLY) - MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") + MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}") ENDIF() LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) ELSE() @@ -240,7 +240,11 @@ MACRO(USE_CURRENT_WINSDK) IF(NOT WINSDK_DIR) # Use Windows SDK versions installed with VC++ when possible - IF(MSVC14) + IF(MSVC1411 OR MSVC1410) + # Special case, use Kits for SDK + SET(WINSDK_VERSION "10.0") + SET(WINSDK_DIR ${WINSDK_UCRT_DIR}) + ELSEIF(MSVC14) SET(WINSDK_VERSION "8.1") ELSEIF(MSVC12) SET(WINSDK_VERSION "8.1") @@ -305,7 +309,7 @@ MACRO(USE_CURRENT_WINSDK) ENDMACRO() IF(MSVC14) - # Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT + # Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT SET(WINSDK_UCRT_VERSION "10.0") ENDIF() @@ -314,6 +318,40 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND) SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}") ENDIF() +IF(WINSDK_UCRT_DIR) + # determine exact UCRT version + SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include) + SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib) + + FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*) + SET(UCRT_VERSION) + + FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS}) + IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION) + SET(UCRT_VERSION ${UCRT_SUBDIR}) + ENDIF() + ENDFOREACH() + + IF(UCRT_VERSION) + MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}") + + SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}) + SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}) + + # directory where UCRT headers are found + FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h + HINTS + ${WINSDK10_INCLUDE_DIR}/ucrt + ) + + # directory where UCRT libraries are found + FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib + HINTS + ${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX} + ) + ENDIF() +ENDIF() + IF(WINSDK_VERSION STREQUAL "CURRENT") USE_CURRENT_WINSDK() ELSE() @@ -334,93 +372,87 @@ ENDIF() # directory where Win32 headers are found FIND_PATH(WINSDK_INCLUDE_DIR Windows.h HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/um ${WINSDK_DIR}/Include/um ${WINSDK_DIR}/Include + NO_DEFAULT_PATH ) +MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") + # directory where WinRT headers are found FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt ${WINSDK_DIR}/Include/winrt + NO_DEFAULT_PATH ) +MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}") + # directory where DirectX headers are found FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/shared ${WINSDK_DIR}/Include/shared + NO_DEFAULT_PATH ) +MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}") + # directory where OpenGL headers are found FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h HINTS + ${WINSDK_INCLUDE_DIR}/gl ${WINSDK_DIR}/Include/um/gl ${WINSDK_DIR}/Include/gl + NO_DEFAULT_PATH ) +MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}") + SET(WINSDK_LIBRARY_DIRS + ${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} ) IF(WINSDK_SUFFIXES) FOREACH(_SUFFIX ${WINSDK_SUFFIXES}) - SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX}) + LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX}) ENDFOREACH() ELSE() - SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib) + LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib) ENDIF() # directory where all libraries are found FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib HINTS ${WINSDK_LIBRARY_DIRS} + NO_DEFAULT_PATH ) -IF(WINSDK_UCRT_DIR) - # determine exact UCRT version - SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include) - SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib) +MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}") - FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*) - SET(UCRT_VERSION) - - FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS}) - IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION) - SET(UCRT_VERSION ${UCRT_SUBDIR}) - ENDIF() - ENDFOREACH() - - IF(UCRT_VERSION) - MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}") - - # directory where UCRT headers are found - FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h - HINTS - ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt - ) - - # directory where UCRT libraries are found - FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib - HINTS - ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX} - ) - ENDIF() -ENDIF() +SET(WINSDK_BINARY_DIRS + ${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Bin/x86 + ${WINSDK_DIR}/Bin +) # signtool is used to sign executables FIND_PROGRAM(WINSDK_SIGNTOOL signtool HINTS - ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} - ${WINSDK_DIR}/Bin/x86 - ${WINSDK_DIR}/Bin + ${WINSDK_BINARY_DIRS} + NO_DEFAULT_PATH ) # midl is used to generate IDL interfaces FIND_PROGRAM(WINSDK_MIDL midl HINTS - ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} - ${WINSDK_DIR}/Bin/x86 - ${WINSDK_DIR}/Bin + ${WINSDK_BINARY_DIRS} + NO_DEFAULT_PATH ) IF(WINSDK_INCLUDE_DIR) @@ -444,7 +476,7 @@ IF(WINSDK_INCLUDE_DIR) SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR}) ENDIF() - INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow... + INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) IF(WINSDK_UCRT_LIBRARY_DIR) SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index ed0847015..a8879fd4d 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -570,6 +570,13 @@ MACRO(NL_SETUP_BUILD) SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + + # Special cases for VC++ 2017 + IF(MSVC_VERSION EQUAL "1911") + SET(MSVC1411 ON) + ELSEIF(MSVC_VERSION EQUAL "1910") + SET(MSVC1410 ON) + ENDIF() ELSEIF(MSVC12) ADD_PLATFORM_FLAGS("/Gy-") # /Ox is working with VC++ 2013, but custom optimizations don't exist From 90359122d72d55b5d043fdd2e4a062b46761ee79 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:25:00 +0200 Subject: [PATCH 7/9] Changed: Other changes in CMake files --HG-- branch : develop --- code/CMakeModules/PCHSupport.cmake | 17 +++++++++++++---- code/CMakeModules/nel.cmake | 14 +++++++++----- code/ryzom/client/src/CMakeLists.txt | 1 - 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 36d031f10..c396bd6cf 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -114,12 +114,16 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) IF(oldProps) - LIST(APPEND _FLAGS ${oldProps}) + SET(_FLAG ${oldProps}) + SEPARATE_ARGUMENTS(_FLAG) + LIST(APPEND _FLAGS ${_FLAG}) ENDIF() GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) IF(oldPropsBuild) - LIST(APPEND _FLAGS ${oldPropsBuild}) + SET(_FLAG ${oldPropsBuild}) + SEPARATE_ARGUMENTS(_FLAG) + LIST(APPEND _FLAGS ${_FLAG}) ENDIF() GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES) @@ -205,6 +209,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) ENDIF() ENDIF() + IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0") + LIST(APPEND _FLAGS "-std=gnu++11") + ENDIF() + # Format definitions IF(MSVC) # Fix path with space @@ -316,7 +324,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS) SET(_FLAGS "") IF(APPLE) SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") - SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch) + SET(_FLAGS ${OBJC_FLAGS}) ENDIF() SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT}) ENDIF() @@ -402,7 +410,8 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) ENDIF() IF(APPLE) - SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") + STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}") + SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") ENDIF() IF(WITH_PCH_DEBUG) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index a8879fd4d..95b28bb8a 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -565,8 +565,8 @@ MACRO(NL_SETUP_BUILD) ADD_PLATFORM_FLAGS("/X") IF(MSVC14) - ADD_PLATFORM_FLAGS("/Gy- /MP") - # /Ox is working with VC++ 2015, but custom optimizations don't exist + ADD_PLATFORM_FLAGS("/Gy-") + # /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") @@ -664,6 +664,8 @@ MACRO(NL_SETUP_BUILD) ENDIF() IF(APPLE) + SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak) + IF(NOT XCODE) IF(CMAKE_OSX_ARCHITECTURES) SET(TARGETS_COUNT 0) @@ -1167,6 +1169,7 @@ MACRO(SETUP_EXTERNAL) IF(APPLE) IF(WITH_STATIC_EXTERNAL) + # Look only for static libraries because systems libraries are using Frameworks SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) ELSE() SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a) @@ -1180,12 +1183,13 @@ MACRO(SETUP_EXTERNAL) ENDIF() ENDIF() - # Android and iOS have pthread - IF(ANDROID OR IOS) + # Android, iOS and Mac OS X have pthread, but no need to link to libpthread + IF(ANDROID OR APPLE) SET(CMAKE_USE_PTHREADS_INIT 1) SET(Threads_FOUND TRUE) ELSE() - FIND_PACKAGE(Threads REQUIRED) + SET(THREADS_HAVE_PTHREAD_ARG ON) + FIND_PACKAGE(Threads) # TODO: replace all -l by absolute path to in CMAKE_THREAD_LIBS_INIT ENDIF() diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 26b208c67..f0409a2e1 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -177,7 +177,6 @@ IF(WITH_RYZOM_CLIENT) ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES} - ${OPENSSL_LIBRARIES} ) IF(NOT APPLE AND NOT WIN32) From bd901c5a8cc6dc9d96b474fa107e3f36f1cb9bba Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:25:30 +0200 Subject: [PATCH 8/9] Fixed: Commented too verbose messages --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 95eaf8465..edd3943ef 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -100,7 +100,7 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL() CDepthStencilFBO::CDepthStencilFBO(CDriverGL *driver, uint width, uint height) { - nldebug("3D: Init shared FBO"); + //nldebug("3D: Init shared FBO"); m_Driver = driver; Width = width; @@ -142,7 +142,7 @@ CDepthStencilFBO::~CDepthStencilFBO() if (DepthFBOId) { - nldebug("3D: Release shared FBO"); + //nldebug("3D: Release shared FBO"); nglDeleteRenderbuffersEXT(1, &DepthFBOId); if (StencilFBOId == DepthFBOId) StencilFBOId = 0; @@ -191,10 +191,10 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) } nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, DepthStencilFBO->DepthFBOId); - nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); + //nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, DepthStencilFBO->StencilFBOId); - nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); + //nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); } // check status From 575f58d749cb46dd9c96c05d9f17d88c3fba551d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:27:31 +0200 Subject: [PATCH 9/9] Changed: Synchonized some changes from compatibility-develop branch --HG-- branch : develop --- code/ryzom/client/client_default.cfg | 15 +- .../gamedev/interfaces_v3/interaction.lua | 22 +- .../gamedev/interfaces_v3/interaction.xml | 19 +- .../data/gamedev/interfaces_v3/sceneedit.lua | 62 +++-- code/ryzom/client/src/continent.cpp | 4 + code/ryzom/client/src/cursor_functions.cpp | 71 +++-- code/ryzom/client/src/entities.cpp | 127 ++++++++- code/ryzom/client/src/entities.h | 2 + .../src/interface_v3/action_handler_debug.cpp | 9 +- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 7 +- code/ryzom/client/src/r2/editor.cpp | 3 +- code/ryzom/common/data_common/database.xml | 3 +- code/ryzom/common/data_common/msg.xml | 4 +- .../entities_game_service/database_plr.cpp | 46 +++- .../src/entities_game_service/database_plr.h | 242 +++++++++++++++++- .../game_item_manager/player_inventory.cpp | 4 + 16 files changed, 537 insertions(+), 103 deletions(-) diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 4edc72bf5..c128ac28a 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -16,11 +16,11 @@ SaveConfig = 1; Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" // "Auto" will choose the best suited driver depending on hardware FullScreen = 1; -Width = 1024; -Height = 768; +Width = 0; +Height = 0; PositionX = 0; PositionY = 0; -Frequency = 60; +Frequency = 0; Depth = 32; Sleep = -1; ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time @@ -281,7 +281,7 @@ DivideTextureSizeBy2= 0; // Divide texture size DisableVtxProgram = 0; // Disable Hardware Vertex Program. DisableVtxAGP = 0; // Disable Hardware Vertex AGP. DisableTextureShdr = 0; // Disable Hardware Texture Shader. -HDEntityTexture = 0; +HDEntityTexture = 1; HDTextureInstalled = 1; WaitVBL = 0; // 0 or 1 to wait Vertical Sync. @@ -481,7 +481,8 @@ XMLInterfaceFiles = { "commands2.xml", "ring_access_point_filter.xml", "ring_window.xml", - "bg_downloader.xml" + "bg_downloader.xml", + "ryzhome_toolbar.xml" }; XMLR2EDInterfaceFiles = @@ -569,7 +570,9 @@ HelpPages = "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", "en=http://forums.ryzom.com/forum/showthread.php?t=29129", "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", - "de=http://forums.ryzom.com/forum/showthread.php?t=29131" + "de=http://forums.ryzom.com/forum/showthread.php?t=29131", + "es=http://forums.ryzom.com/forum/showthread.php?t=29129", + "ru=http://forums.ryzom.com/forum/showthread.php?t=29129" }; WebIgMainDomain = "app.ryzom.com"; diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua index 9f672e961..bdf838f88 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua +++ b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua @@ -217,7 +217,7 @@ end -- Is its level known (not too high ...) -- Boss/Mini-bosses/Names colored ring function game:updateTargetConsiderUI() - --debugInfo("Updating consider widget") + -- debugInfo("Updating consider widget") local targetWindow = getUI("ui:interface:target") -- @@ -228,12 +228,14 @@ function game:updateTargetConsiderUI() local wgToolTip = targetWindow:find("target_tooltip") local wgPvPTag = targetWindow:find("pvp_tags") local wgHeader = targetWindow:find("header_opened") + local wgLock = targetWindow:find("lock") wgTargetSlotForce.active = true wgImpossible.active = true -- no selection ? if twGetTargetLevel() == -1 then + wgLock.active = false wgTargetSlotForce.active = false wgTargetLevel.active = false wgImpossible.active = false @@ -254,20 +256,36 @@ function game:updateTargetConsiderUI() wgPvPTag.active = false wgHeader.h = 34; + +-- /luaScript getUI("ui:interface:target:header_opened:lock").active=true + -- if the selection is a player, then both the local & targeted player must be in PVP mode for the level to be displayed if (twIsTargetPlayer()) then -- don't display anything ... + wgLock.active = false wgTargetSlotForce.active = false wgTargetLevel.active = false wgImpossible.active = false wgSlotRing.active = false wgToolTip.tooltip = "" if twIsTargetInPVPMode() then - debugInfo("target in pvp") wgPvPTag.active = true wgHeader.h = 56; end return + else + wgLock.active = false + local level = getDbProp(getDefine("target_player_level")) + + if level == 2 then -- Locked by team of player + wgLock.active = true + wgLock.color = "50 250 250 255" + else + if level == 1 then -- Locked by another team + wgLock.active = true + wgLock.color = "250 50 50 255" + end + end end -- depending on the number of people in the group, set the max diff for visibility between player level diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml index cbf4b15ce..f4ab98453 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml @@ -269,14 +269,27 @@ posparent="slot_force" x="-1" y="6" - scale="true" - h="16" - w="32" + scale="true" + h="16" + w="32" color="255 255 255 255" texture="consider_impossible.tga" global_color="false" render_layer="1" active="true" /> + '..message..'' -end - -function SceneEditor:get_html(message, message_bg) - local new_group = '  '..self.T[' - local show_hide_cols = '  '..self.T[' - local reset_scene = ''..self.T[' - - local html = '
'..self.T["sceno_editor"]..'
'..self:get_html_section(message..''..new_group..show_hide_cols..reset_scene, (message_bg or SceneEditor:get_random_color())) - - html = html .. '
\ - ' +function SceneEditor:getShapesByGroups() local groups = {} for shape_id, shape in pairs(self.Shapes) do if shape.group == nil then @@ -504,13 +496,35 @@ function SceneEditor:get_html(message, message_bg) end table.insert(groups[shape.group], shape_id) end + return groups +end + + +function SceneEditor:get_html_section(message, color) + return '
'..message..'
' +end + +function SceneEditor:get_html(message, message_bg) + debug("get_html :"..message) + local new_group = '  '..self.T[' + local show_hide_cols = '  '..self.T[' + local reset_scene = ''..self.T[' + + local html = '
'..self.T["sceno_editor"]..'
'..self:get_html_section(message..''..new_group..show_hide_cols..reset_scene, (message_bg or SceneEditor:get_random_color())) + + html = html .. '\ + ' + + local groups = self:getShapesByGroups() for group, shapes in pairsByKeys(self.Groups) do + debug("Group : "..group) local groupname = group html = html .. '
 '..groupname..' ('..(self.Groups[group].props.count or '0')..') ' if self.Groups[group].props.show then + debug("Group : show") if self.Groups[group].props.edit then html = html .. ''..self.T[' if self.HaveUpdate then diff --git a/code/ryzom/client/src/continent.cpp b/code/ryzom/client/src/continent.cpp index 51b8c9280..a30604282 100644 --- a/code/ryzom/client/src/continent.cpp +++ b/code/ryzom/client/src/continent.cpp @@ -485,6 +485,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress { H_AUTO(InitRZWorldPacs) + releasePACS(); // Init PACS std::string pacsRBankPath = CPath::lookup(PacsRBank, false); @@ -931,6 +932,9 @@ void CContinent::unselect() // Remove the primitive for all entitites (new PACS coming soon and need new primitives). EntitiesMngr.removeCollision(); + // Remove the instances (shapes). + EntitiesMngr.removeInstances(); + // release collision primitives if (IGCallbacks) { diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 8796d509a..7b581b808 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -60,8 +60,7 @@ CLFECOMMON::TCLEntityId SlotUnderCursor; uint32 MissionId = 0; uint32 MissionRingId = 0; sint32 InstanceId = 0; -UInstance selectedInstance; -const UInstance noSelectedInstance; +sint32 selectedInstance = -1; string selectedInstanceURL; static NLMISC::CRefPtr s_UserCharFade; @@ -129,7 +128,7 @@ void initContextualCursor() ContextCur.add(true, "MISSION", string(""), 0.0f, checkUnderCursor, contextMission); ContextCur.add(true, "WEB PAGE", string(""), 0.0f, checkUnderCursor, contextWebPage); ContextCur.add(true, "WEBIG", string(""), 0.0f, checkUnderCursor, contextWebIG); - ContextCur.add(false, "ARKITECT", string("curs_pick.tga"), 0.0f, checkUnderCursor, contextARKitect); + ContextCur.add(false, "ARKITECT", string("curs_create.tga"), 0.0f, checkUnderCursor, contextARKitect); ContextCur.add(true, "OUTPOST", string(""), 0.0f, checkUnderCursor, contextOutpost); ContextCur.add(true, "RING MISSION", string(""), 0.0f, checkUnderCursor, contextRingMission); ContextCur.add(true, "BUILD_TOTEM", string("uimGcmChooseBuilding"), 0.0f, checkUnderCursor, contextBuildTotem); @@ -346,7 +345,6 @@ void checkUnderCursor() // Entity Under the cursor is the entity selected. else { - // Wait for the target is up to date. Do not display context cursor if the user is mounted. if( (UserEntity->selection() == UserEntity->targetSlot()) && (! UserEntity->isRiding()) ) @@ -536,59 +534,49 @@ void checkUnderCursor() sint32 instance_idx; CShapeInstanceReference instref = EntitiesMngr.getShapeInstanceUnderPos(cursX, cursY, instance_idx); - if (EntitiesMngr.instancesRemoved()) - selectedInstance = noSelectedInstance; - + std::vector keys; + keys.push_back("colorize"); + + if (instance_idx != selectedInstance && selectedInstance != -1) { + std::vector values; + values.push_back("0"); + EntitiesMngr.setupInstance((uint32)selectedInstance, keys, values); + } + UInstance instance = instref.Instance; - if (!instance.empty()) + if (!instance.empty() && !instref.ContextURL.empty()) { - if (instance.getObjectPtr() != selectedInstance.getObjectPtr()) - { - for(uint j=0;j values; + values.push_back("#FF0000FF"); + EntitiesMngr.setupInstance((uint32)instance_idx, keys, values); + selectedInstance = instance_idx; + } + + cursor->setCursor("r2ed_tool_select_move_over.tga"); InstanceId = instance_idx; - if(ContextCur.context("ARKITECT", 0.f, ucstring())) + if (ContextCur.context("ARKITECT", 0.f, ucstring("Edit"))) return; } else { + cursor->setCursor("curs_pick.tga"); ucstring contextText; contextText.fromUtf8(instref.ContextText); - if(ContextCur.context("WEBIG", 0.f, contextText)) + if (ContextCur.context("WEBIG", 0.f, contextText)) return; } - } - else - { - if (!selectedInstance.empty()) - { - for(uint j=0;jsetCursor("curs_default.tga"); selectedInstanceURL.clear(); } } + SlotUnderCursor = CLFECOMMON::INVALID_SLOT; } } @@ -896,7 +884,8 @@ void contextWebIG(bool rightClick, bool dblClick) CInterface3DShape *el= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:bot_chat_object:scene3d:object_1")); if (el != NULL) { - el->setName(selectedInstance.getShapeName()); + //TODO: Fix that + //el->setName(selectedInstance.getShapeName()); el->setPosX(0.0f); } if (selectedInstanceURL.empty()) diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 382f2f7e1..b46d7ce29 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -703,6 +703,57 @@ double CEntityManager::getInstanceColOrient(uint32 idx) return primitive->getOrientation(dynamicWI); } +CVector CEntityManager::getInstanceBBoxMin(uint32 idx) +{ + if (!Scene || idx >= _ShapeInstances.size() || _ShapeInstances[idx].Deleted) + return CVector(0,0,0); + + UInstance instance = _ShapeInstances[idx].Instance; + if (instance.empty()) + return CVector(0,0,0); + + NLMISC::CAABBox bbox; + _ShapeInstances[idx].Instance.getShapeAABBox(bbox); + + CVector bbox_min; + + if (bbox.getCenter() == CVector::Null) + bbox_min = CVector(-0.5f, -0.5f, -0.5f); + else + bbox_min = bbox.getMin(); + + bbox_min.x *= _ShapeInstances[idx].Instance.getScale().x; + bbox_min.y *= _ShapeInstances[idx].Instance.getScale().y; + bbox_min.z *= _ShapeInstances[idx].Instance.getScale().z; + + return bbox_min+_ShapeInstances[idx].Instance.getPos(); +} + +CVector CEntityManager::getInstanceBBoxMax(uint32 idx) +{ + if (!Scene || idx >= _ShapeInstances.size() || _ShapeInstances[idx].Deleted) + return CVector(0,0,0); + + UInstance instance = _ShapeInstances[idx].Instance; + if(instance.empty()) + return CVector(0,0,0); + + NLMISC::CAABBox bbox; + _ShapeInstances[idx].Instance.getShapeAABBox(bbox); + + CVector bbox_max; + + if (bbox.getCenter() == CVector::Null) + bbox_max = CVector(-0.5f, -0.5f, -0.5f); + else + bbox_max = bbox.getMax(); + + bbox_max.x *= _ShapeInstances[idx].Instance.getScale().x; + bbox_max.y *= _ShapeInstances[idx].Instance.getScale().y; + bbox_max.z *= _ShapeInstances[idx].Instance.getScale().z; + + return bbox_max+_ShapeInstances[idx].Instance.getPos(); +} bool CEntityManager::removeInstances() { @@ -756,14 +807,28 @@ bool CEntityManager::setupInstance(uint32 idx, const vector &keys, const } else if (param == "colorize") { - CRGBA c; - if( fromString( values[i], c ) ) + if (values[i] == "0") { for(uint j=0;j &keys, const } } } + else if (param == "skeleton") + { + // TODO + } + else if (param == "context") + { + _ShapeInstances[idx].ContextText = values[i]; + } + else if (param == "url") + { + _ShapeInstances[idx].ContextURL = values[i]; + } + else if (param == "move x" || param == "move y" || param == "move z") + { + float v; + CVector pos = getInstancePos(idx); + + if( getRelativeFloatFromString( values[i], v ) ) { + updateVector(param, pos, v, true); + } else { + updateVector(param, pos, v, false); + } + setInstancePos(idx, pos); + } + else if (param == "rot x" || param == "rot y" || param == "rot z") + { + + float v; + CVector rot = getInstanceRot(idx); + + if( getRelativeFloatFromString( values[i], v ) ) { + updateVector(param, rot, v, true); + } else { + updateVector(param, rot, v, false); + } + setInstanceRot(idx, rot); + } else if (param == "scale x" || param == "scale y" || param == "scale z") { float v; @@ -879,6 +981,10 @@ bool CEntityManager::setupInstance(uint32 idx, const vector &keys, const fromString(values[i], active); primitive->setObstacle(active); } + else if (param == "col obstacle") + { + + } } return true; @@ -933,7 +1039,16 @@ CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float bbox_max = bbox.getMax(); } - bbox.setMinMax((bbox_min*_ShapeInstances[i].Instance.getScale().x)+_ShapeInstances[i].Instance.getPos(), (bbox_max*_ShapeInstances[i].Instance.getScale().x)+_ShapeInstances[i].Instance.getPos()); + bbox_min.x *= _ShapeInstances[i].Instance.getScale().x; + bbox_min.y *= _ShapeInstances[i].Instance.getScale().y; + bbox_min.z *= _ShapeInstances[i].Instance.getScale().z; + + bbox_max.x *= _ShapeInstances[i].Instance.getScale().x; + bbox_max.y *= _ShapeInstances[i].Instance.getScale().y; + bbox_max.z *= _ShapeInstances[i].Instance.getScale().z; + + + bbox.setMinMax(bbox_min+_ShapeInstances[i].Instance.getPos(), bbox_max+_ShapeInstances[i].Instance.getPos()); if(bbox.intersect(pos, pos+dir*100.0f)) { diff --git a/code/ryzom/client/src/entities.h b/code/ryzom/client/src/entities.h index ed9b6ea6d..014020d6b 100644 --- a/code/ryzom/client/src/entities.h +++ b/code/ryzom/client/src/entities.h @@ -236,6 +236,8 @@ public: CVector getInstanceColPos(uint32 idx); CVector getInstanceColScale(uint32 idx); double getInstanceColOrient(uint32 idx); + CVector getInstanceBBoxMin(uint32 idx); + CVector getInstanceBBoxMax(uint32 idx); bool setInstanceRot(uint32 idx, CVector pos); bool instancesRemoved(); bool setupInstance(uint32 idx, const std::vector &keys, const std::vector &values); diff --git a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp index 51b029815..74c5542da 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp @@ -96,9 +96,14 @@ REGISTER_ACTION_HANDLER (CAHDisplayInfos, "display_infos"); // ------------------------------------------------------------------------------------------------ class CAHToggleARKPACSBorders : public IActionHandler { - virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) + virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { - ARKPACSBorders = !ARKPACSBorders; + if (!getParam(Params, "on").empty()) + ARKPACSBorders = true; + else if (!getParam(Params, "off").empty()) + ARKPACSBorders = false; + else ARKPACSBorders = !ARKPACSBorders; + } }; REGISTER_ACTION_HANDLER (CAHToggleARKPACSBorders, "ark_pacs_borders"); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index f6d8c9ef4..c0a3e167d 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -2048,7 +2048,8 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) float x = 0.0f, y = 0.0f, z = 0.0f; float scale = 1.0f; string context, url, skeleton, texture; - bool highlight, transparency = false; + bool highlight = false; + bool transparency = false; bool collision = true; if (ls.getTop() >= 2) @@ -2150,14 +2151,14 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) if (!highlight) { instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255)); - instance.getMaterial(j).setShininess( 10.0f ); instance.getMaterial(j).setEmissive(CRGBA(255,255,255,255)); + instance.getMaterial(j).setShininess(10.0f); } else { instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255)); instance.getMaterial(j).setEmissive(CRGBA(255,0,0,255)); - instance.getMaterial(j).setShininess( 1000.0f ); + instance.getMaterial(j).setShininess(1000.0f); } if (!texture.empty()) diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index d0c169c97..dc81eeb38 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -47,7 +47,6 @@ #include "editor.h" // #include "nel/gui/lua_helper.h" -using namespace NLGUI; #include "nel/gui/group_tree.h" #include "../interface_v3/interface_manager.h" #include "../contextual_cursor.h" @@ -122,7 +121,7 @@ using namespace NLGUI; using namespace NLMISC; using namespace NLNET; using namespace NL3D; - +using namespace NLGUI; extern CEventsListener EventsListener; extern CLog g_log; diff --git a/code/ryzom/common/data_common/database.xml b/code/ryzom/common/data_common/database.xml index f6920f90a..8cdcf1f31 100644 --- a/code/ryzom/common/data_common/database.xml +++ b/code/ryzom/common/data_common/database.xml @@ -1551,7 +1551,8 @@ + type="I32" + is_true="1" /> + description="the client equip character (equiped inventory, equiped inventory slot, bag slot)" /> + description="the client unequip character (equiped inventory, equiped inventory slot)" /> getNode( ICDBStructNode::CTextId("IS_INVISIBLE"), false ); nlassert(node != NULL); _IS_INVISIBLE = node; - + node = parent->getNode( ICDBStructNode::CTextId("COUNTER"), false ); nlassert(node != NULL); _COUNTER = node; @@ -1198,6 +1198,14 @@ void CBankAccessor_PLR::TEXCHANGE::TGIVE::TArray::init(ICDBStructNode *parent, u nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1277,6 +1285,14 @@ void CBankAccessor_PLR::TEXCHANGE::TRECEIVE::TArray::init(ICDBStructNode *parent nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1484,6 +1500,14 @@ void CBankAccessor_PLR::TINVENTORY::TTEMP::TArray::init(ICDBStructNode *parent, nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1574,6 +1598,14 @@ void CBankAccessor_PLR::TINVENTORY::TSHARE::TArray::init(ICDBStructNode *parent, nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -2126,6 +2158,14 @@ void CBankAccessor_PLR::TTRADING::TArray::init(ICDBStructNode *parent, uint inde nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -3139,11 +3179,11 @@ void CBankAccessor_PLR::TPACK_ANIMAL::TBEAST::init(ICDBStructNode *parent, uint node = parent->getNode( ICDBStructNode::CTextId("DESPAWN"), false ); nlassert(node != NULL); _DESPAWN = node; - - // WARNING: let the value to true, else it'll corrupt backups + node = parent->getNode( ICDBStructNode::CTextId("NAME"), true ); nlassert(node != NULL); _NAME = node; + // branch init diff --git a/code/ryzom/server/src/entities_game_service/database_plr.h b/code/ryzom/server/src/entities_game_service/database_plr.h index 67e0f7798..bef0cb796 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.h +++ b/code/ryzom/server/src/entities_game_service/database_plr.h @@ -956,6 +956,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) { + + _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); } @@ -971,7 +973,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _IS_INVISIBLE; } - + void setCOUNTER(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -1313,14 +1315,13 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _DODGE; } - - TBRICK_TICK_RANGE &getBRICK_TICK_RANGE() + TBRICK_TICK_RANGE &getBRICK_TICK_RANGE() { return _BRICK_TICK_RANGE; } - + }; - + class TTARGET { public: @@ -2781,6 +2782,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -2867,6 +2870,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -3080,6 +3123,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -3166,6 +3211,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -3471,6 +3556,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -3710,6 +3797,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -3796,6 +3885,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -4051,6 +4180,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -4140,6 +4271,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -4572,6 +4743,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -4582,12 +4755,14 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return value; } - + ICDBStructNode *getMONEYCDBNode() { return _MONEY; } + }; + private: ICDBStructNode *_BranchNode; @@ -4610,8 +4785,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _BranchNode; } + void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -5687,6 +5865,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -5785,6 +5965,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -6005,6 +6225,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY_SHEET(CCDBSynchronised &dbGroup, NLMISC::CSheetId value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY_SHEET, value, forceSending); } @@ -8861,6 +9083,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_HUNGER; ICDBStructNode *_DESPAWN; ICDBStructNode *_NAME; + public: void init(ICDBStructNode *parent, uint index); @@ -9049,9 +9272,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _DESPAWN; } - + void setNAME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) { + + _setProp(dbGroup, _NAME, value, forceSending); } @@ -9062,11 +9287,12 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return value; } - + ICDBStructNode *getNAMECDBNode() { return _NAME; } + }; diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp index dcb7e5a49..ea832b494 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp @@ -1072,11 +1072,15 @@ void CCharacterInvView::updateClientSlot(uint32 slot, const CGameItemPtr item) resaleFlag = BOTCHATTYPE::ResaleKOLockedByOwner; } + const INVENTORIES::TItemId &itemId = item->getItemId(); + INVENTORIES::CItemSlot itemSlot( slot ); itemSlot.setItemProp( INVENTORIES::Sheet, item->getSheetId().asInt() ); itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); + itemSlot.setItemProp( INVENTORIES::CreateTime, itemId.getCreateTime() ); + itemSlot.setItemProp( INVENTORIES::Serial, itemId.getSerialNumber() ); itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 ); itemSlot.setItemProp( INVENTORIES::NameId, item->sendNameId(getCharacter()) );