From 730d0e42d1c1fa25d61adbcbc254d50e1bd722e8 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 08:04:09 +0200 Subject: [PATCH 1/5] Remove dead code --- code/ryzom/common/src/game_share/entity_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ryzom/common/src/game_share/entity_types.h b/code/ryzom/common/src/game_share/entity_types.h index 6298ff64f..aad2d94e9 100644 --- a/code/ryzom/common/src/game_share/entity_types.h +++ b/code/ryzom/common/src/game_share/entity_types.h @@ -81,7 +81,8 @@ const uint32 NB_FAKE_DISC_PROPERTIES_UPDATED_PER_CYCLE=2; typedef uint16 TProperty; typedef uint8 TPropIndex; -const uint32 NB_PROPERTIES = 256; //number of TProperty elements (if you change this, change the ids of special properties in the Front-end Service!) +// KAE: Commented because not used +//const uint32 NB_PROPERTIES = 256; //number of TProperty elements (if you change this, change the ids of special properties in the Front-end Service!) /// Main type for positions/distances. Unit: millimeter From 6376925e6288113de1fb03b3fd2ce24c41fd18f0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 09:09:42 +0200 Subject: [PATCH 2/5] Bugfix in distance prioritizer --- code/ryzom/server/src/frontend_service/distance_prioritizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.h b/code/ryzom/server/src/frontend_service/distance_prioritizer.h index b7a69a1d6..ad59bc12e 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.h +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.h @@ -227,7 +227,7 @@ public: { outbox.serialBitAndLog( BranchHasPayload ); if ( a() ) a()->fillDiscreetProperties( outbox ); - if ( a() ) b()->fillDiscreetProperties( outbox ); + if ( b() ) b()->fillDiscreetProperties( outbox ); } } else From 424b5af411c40469a0be6da923b8cc870e4987a0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 09:37:14 +0200 Subject: [PATCH 3/5] Remove dead code in game item manager --- .../game_item_manager/game_item_manager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp index 830c45d7c..16258192c 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp @@ -845,9 +845,9 @@ void CGameItemManager::buildNpcSpecificItems() //----------------------------------------------- // createItem : //----------------------------------------------- -NLMISC_COMMAND(createItem,"create a new item","") +NLMISC_COMMAND(createItem,"create a new item","") { - if( args.size() < 3 ) + if( args.size() < 2 ) { return false; } @@ -859,9 +859,9 @@ NLMISC_COMMAND(createItem,"create a new item","") uint16 quality; NLMISC::fromString(args[1], quality); - uint32 ownerIdTmp; - NLMISC::fromString(args[2], ownerIdTmp); - CEntityId ownerId(RYZOMID::object,ownerIdTmp); + //uint32 ownerIdTmp; + //NLMISC::fromString(args[2], ownerIdTmp); + //CEntityId ownerId(RYZOMID::object,ownerIdTmp); // CGameItemPtr item = GameItemManager.createItem( sheetId, quality, ownerId, -1, true,true ); CGameItemPtr item = GameItemManager.createItem( sheetId, quality, true, true ); From fa975bedb35c18eebab32ea423bf2822aa58c9e1 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 09:48:28 +0200 Subject: [PATCH 4/5] Cleanup some RYZOMID code --- .../common/src/game_share/ryzom_entity_id.h | 17 +++++++++++------ .../player_manager/character.cpp | 8 +------- .../frontend_service/distance_prioritizer.cpp | 2 +- .../server/src/gpm_service/world_entity.cpp | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/code/ryzom/common/src/game_share/ryzom_entity_id.h b/code/ryzom/common/src/game_share/ryzom_entity_id.h index 9fc2682ef..0e96486c7 100644 --- a/code/ryzom/common/src/game_share/ryzom_entity_id.h +++ b/code/ryzom/common/src/game_share/ryzom_entity_id.h @@ -30,12 +30,17 @@ namespace RYZOMID { // warning: respect separation with creature /object, it's used in front-end vision prioritizer // creature part (include player) - player = 0, - npc, //1 - creature, //2 - mount, //3 - pack_animal, //4 - flora, //5 + creature_begin = 0, + player = creature_begin, + bot_ai_begin, + npc = bot_begin, //1 + creature, //2 + mount, //3 + pack_animal, //4 + flora, //5 + bot_ai_end = flora, + creature_end = bot_end, + // objects part object, // 6 building, // 7 diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 5518042ed..33d1777b9 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -16324,13 +16324,7 @@ void CCharacter::sendEmote( const NLMISC::CEntityId& id, MBEHAV::EBehaviour beha } CEntityId targetId = getTarget(); - if ( targetId.getType() != RYZOMID::npc && - targetId.getType() != RYZOMID::player && - targetId.getType() != RYZOMID::creature && - targetId.getType() != RYZOMID::mount && - targetId.getType() != RYZOMID::pack_animal && - targetId.getType() != RYZOMID::flora - ) + if (targetId.getType() > creature_end) targetId = CEntityId::Unknown; TDataSetRow targetRow = TheDataset.getDataSetRow( targetId ); diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index 305adb992..04bf990cd 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -915,7 +915,7 @@ inline void CDistancePrioritizer::serialSlotHeader( CClientHost& client, CEntit timestampDelta = 15; timestampDelta |= 0x10; // 'timestampIsThere bit': first bit is bit 5 (high to low order) } - else if ( seenEntityId.getType() >= RYZOMID::object ) + else if ( seenEntityId.getType() > RYZOMID::creature_end ) { // For non-players/non-bots types (e.g. bags), set the timestamp delta if entity is being spawned to the client //if ( _VisualPropertyTreeRoot->B->B->getSHEETnode()->BranchHasPayload ) // assumes this is done after arbitrateDiscreetProperties() // CHANGED BEN diff --git a/code/ryzom/server/src/gpm_service/world_entity.cpp b/code/ryzom/server/src/gpm_service/world_entity.cpp index d9976a1c4..6debb6284 100644 --- a/code/ryzom/server/src/gpm_service/world_entity.cpp +++ b/code/ryzom/server/src/gpm_service/world_entity.cpp @@ -161,7 +161,7 @@ void CWorldEntity::init( const CEntityId& id, const TDataSetRow &index ) { _Type = Trigger; } - else if ( (id.getType() >= RYZOMID::npc ) || ( id.getType() <= RYZOMID::flora) ) + else if ((id.getType() >= RYZOMID::bot_ai_begin) && (id.getType() <= RYZOMID::bot_ai_end)) { _Type = AI; } From 5efb09bc5a7bbe7c6e50ca4012f63251beb6f8cd Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 10:42:38 +0200 Subject: [PATCH 5/5] Install fix --- code/web/public_php/setup/install.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code/web/public_php/setup/install.php b/code/web/public_php/setup/install.php index 6ffd0e20c..037910834 100644 --- a/code/web/public_php/setup/install.php +++ b/code/web/public_php/setup/install.php @@ -143,6 +143,7 @@ include('header.php'); $config = str_replace("%nelSetupPassword%", addslashes($_POST["nelSetupPassword"]), $config); $config = str_replace("%domainDatabase%", addslashes($_POST["domainDatabase"]), $config); $config = str_replace("%nelDomainName%", addslashes($_POST["nelDomainName"]), $config); + $config = str_replace("%nelSetupVersion%", addslashes($NEL_SETUP_VERSION), $config); $cryptKeyLength = 16; $cryptKey = str_replace("=", "", base64_encode(mcrypt_create_iv(ceil(0.75 * $cryptKeyLength), MCRYPT_DEV_URANDOM))); $cryptKeyIMAP = str_replace("=", "", base64_encode(mcrypt_create_iv(ceil(0.75 * $cryptKeyLength), MCRYPT_DEV_URANDOM)));