From 575f58d749cb46dd9c96c05d9f17d88c3fba551d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:27:31 +0200 Subject: [PATCH] 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()) );