From 497c48816665a0c032b13e0b8c9a62f16e622e9f Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 12:22:57 +0200 Subject: [PATCH 1/8] Fixed: Wrong syntax for NL_I64 --HG-- branch : develop --- code/nel/src/gui/lua_object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/gui/lua_object.cpp b/code/nel/src/gui/lua_object.cpp index dc7abff52..57581d6ec 100644 --- a/code/nel/src/gui/lua_object.cpp +++ b/code/nel/src/gui/lua_object.cpp @@ -422,7 +422,7 @@ namespace NLGUI { nlassert(key); nlassert(isValid()); - if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a value '%d" NL_I64 "' at key %s on object '%s' of type %s (not a table).", value, key, getId().c_str(), getTypename())); + if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a value '%" NL_I64 "d' at key %s on object '%s' of type %s (not a table).", value, key, getId().c_str(), getTypename())); CLuaStackChecker lsc(_LuaState); push(); _LuaState->push(key); From 25faa27ef5f5f6b09536e1545303c5876c4fcfa5 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 12:30:24 +0200 Subject: [PATCH 2/8] Fixed: Compilation with VC++ 2015 (need spaces around NL_I64) --HG-- branch : develop --- .../server/src/admin_modules/as_module.cpp | 4 +-- .../server/src/ai_service/ai_bot_npc.cpp | 2 +- .../server/src/ai_service/ais_actions.cpp | 2 +- .../src/entities_game_service/admin.cpp | 6 ++-- .../entities_game_service.cpp | 6 ++-- .../entity_manager/entity_callbacks.cpp | 2 +- .../guild_manager/guild.cpp | 10 +++---- .../guild_manager/guild_commands.cpp | 2 +- .../outpost_manager/outpost_manager.cpp | 2 +- .../player_manager/cdb_synchronised.cpp | 14 +++++----- .../player_manager/character.cpp | 6 ++-- .../entity_view_service.cpp | 2 +- .../frontend_service/distance_prioritizer.cpp | 28 +++++++++---------- .../frontend_service/distance_prioritizer.h | 8 +++--- .../src/frontend_service/entity_container.cpp | 14 +++++----- .../src/frontend_service/vision_provider.cpp | 4 +-- .../ryzom/server/src/gpm_service/commands.cpp | 2 +- .../server/src/gpm_service/world_entity.cpp | 2 +- .../gpm_service/world_position_manager.cpp | 2 +- .../server/src/mirror_service/tick_proxy.cpp | 14 +++++----- code/ryzom/server/src/pd_lib/pd_lib.cpp | 10 +++---- code/ryzom/server/src/pd_lib/pd_messages.cpp | 2 +- .../ryzom/server/src/pd_lib/pd_server_utils.h | 6 ++-- .../server/src/pd_lib/pds_table_buffer.cpp | 10 +++---- .../persistant_data_service/db_manager.cpp | 8 +++--- .../db_manager_messages.h | 2 +- .../persistant_data_service/pds_database.cpp | 8 +++--- .../src/persistant_data_service/pds_table.cpp | 10 +++---- .../server/src/tick_service/tick_service.cpp | 2 +- 29 files changed, 95 insertions(+), 95 deletions(-) diff --git a/code/ryzom/server/src/admin_modules/as_module.cpp b/code/ryzom/server/src/admin_modules/as_module.cpp index da4b85485..b5f8c6fd1 100644 --- a/code/ryzom/server/src/admin_modules/as_module.cpp +++ b/code/ryzom/server/src/admin_modules/as_module.cpp @@ -501,7 +501,7 @@ retry_pending_command: // // for (uint i=0; i &ar uint64 id=action; for (uint j=0;j<8 && ((char*)&id)[j]!=0;++j) txt+=((char*)&id)[j]; - nlwarning("Failed to execute action: %16"NL_I64"x: %s",action,txt.c_str()); + nlwarning("Failed to execute action: %16" NL_I64 "x: %s",action,txt.c_str()); } diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index e92657c3e..5e0ad4efd 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -1037,7 +1037,7 @@ ENTITY_VARIABLE(Money, "Money") c->spendMoney(val); } - nlinfo ("Player %s money is %"NL_I64"u", entity.toString().c_str(),c->getMoney()); + nlinfo ("Player %s money is %" NL_I64 "u", entity.toString().c_str(),c->getMoney()); } } @@ -1090,7 +1090,7 @@ ENTITY_VARIABLE(MoneyGuild, "MoneyGuild") guild->spendMoney(val); } - nlinfo ("Player %s guild money is %"NL_I64"u", entity.toString().c_str(),guild->getMoney()); + nlinfo ("Player %s guild money is %" NL_I64 "u", entity.toString().c_str(),guild->getMoney()); } } @@ -4350,7 +4350,7 @@ ENTITY_VARIABLE(Invisible, "Invisibility of a player") msgout.serial( ignore ); CUnifiedNetwork::getInstance()->send("IOS", msgout); - nlinfo ("%s has now '%"NL_I64"X' in invisibility", entity.toString().c_str(), e->getWhoSeesMe()); + nlinfo ("%s has now '%" NL_I64 "X' in invisibility", entity.toString().c_str(), e->getWhoSeesMe()); } } diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index 5ee811499..23a43beff 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -3864,7 +3864,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value","_PropertyDatabase.x_getProp(entry); - log.displayNL("For player %s, buffer %s : value %"NL_I64"d", id.toString().c_str(), entry.c_str(), value ); + log.displayNL("For player %s, buffer %s : value %" NL_I64 "d", id.toString().c_str(), entry.c_str(), value ); } catch (const CCDBSynchronised::ECDBNotFound &) { @@ -3904,7 +3904,7 @@ NLMISC_COMMAND( db, "Display or set the value of a property in the database", "< try { sint64 value = e->_PropertyDatabase.x_getProp( entry ); - log.displayNL( "%"NL_I64"d", value ); + log.displayNL( "%" NL_I64 "d", value ); res = true; } catch (const CCDBSynchronised::ECDBNotFound& ) @@ -4005,7 +4005,7 @@ NLMISC_COMMAND(displayMoney," display_seed","") CCharacter *e = PlayerManager.getChar(id); if( e ) { - log.displayNL("displayMoney: %"NL_I64"%u", e->getMoney() ); + log.displayNL("displayMoney: %" NL_I64 "%u", e->getMoney() ); } else { diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp index d6ddde501..762db5af1 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp @@ -1180,7 +1180,7 @@ void cbDeleteChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ CPlayer* player = PlayerManager.getPlayer( userId ); if ( player == NULL ) { - nlwarning("invalid user %"NL_I64"u %u %hu", longUserId,userId,(uint16)characterIndex); + nlwarning("invalid user %" NL_I64 "u %u %hu", longUserId,userId,(uint16)characterIndex); return; } diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp index b7a5bc4a5..562e3a3a8 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp @@ -137,7 +137,7 @@ void CGuild::spendMoney(uint64 money) { if ( money > _Money ) { - nlwarning( "spendMoney guild %u : money = %"NL_I64"u, max = %"NL_I64"u", _Id, money, _Money); + nlwarning( "spendMoney guild %u : money = %" NL_I64 "u, max = %" NL_I64 "u", _Id, money, _Money); return; } @@ -463,7 +463,7 @@ void CGuild::dumpGuildInfos( NLMISC::CLog & log ) getId()>>20 == IService::getInstance()->getShardId() ? "(Local)" : "(Foreign)", getName().toUtf8().c_str(), getEId().toString().c_str() ); log.displayNL("\tDescription: '%s'", getDescription().toUtf8().c_str() ); - log.displayNL("\tMoney: %"NL_I64"u", getMoney() ); + log.displayNL("\tMoney: %" NL_I64 "u", getMoney() ); // log.displayNL("\tVillage: %hu", getVillage() ); log.displayNL("\tCreation date: %u", getCreationDate() ); // log.displayNL("\tXP: %u", getXP() ); @@ -471,7 +471,7 @@ void CGuild::dumpGuildInfos( NLMISC::CLog & log ) log.displayNL("\tMax bulk: %d", _Inventory->getMaxBulk() ); // log.displayNL("\tCharge points: %u", getChargesPoints() ); log.displayNL("\tRace: %s", EGSPD::CPeople::toString(getRace()).c_str() ); - log.displayNL("\tIcon: 0x%016"NL_I64"x", getIcon() ); + log.displayNL("\tIcon: 0x%016" NL_I64 "x", getIcon() ); log.displayNL("\tCiv Allegiance: %s", PVP_CLAN::toString(_DeclaredCiv).c_str()); log.displayNL("\tCult Allegiance: %s", PVP_CLAN::toString(_DeclaredCult).c_str()); @@ -1146,7 +1146,7 @@ void CGuild::takeMoney( CCharacter * user, uint64 money, uint16 session ) if ( money > _Money ) { - nlwarning( "takeMoney guild %u user %s : money = %"NL_I64"u, max = %"NL_I64"u",_Id,user->getId().toString().c_str(),money,_Money); + nlwarning( "takeMoney guild %u user %s : money = %" NL_I64 "u, max = %" NL_I64 "u",_Id,user->getId().toString().c_str(),money,_Money); return; } if ( ! _GuildInventoryView->checkMoneySession( session ) ) @@ -1183,7 +1183,7 @@ void CGuild::putMoney( CCharacter * user, uint64 money, uint16 session ) if ( money > user->getMoney() ) { - nlwarning( "putMoney guild %u user %s : money = %"NL_I64"u, max = %"NL_I64"u",_Id,user->getId().toString().c_str(),money,_Money); + nlwarning( "putMoney guild %u user %s : money = %" NL_I64 "u, max = %" NL_I64 "u",_Id,user->getId().toString().c_str(),money,_Money); return; } diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp index 3e840bd43..421a157b1 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp @@ -396,7 +396,7 @@ NLMISC_COMMAND( guildDB, "Display or set the value of a property in the guild da } // sint64 val = guild->getClientDBProp( args[1] ); sint64 val = guild->_DbGroup.Database.x_getProp(args[1]); - log.displayNL( "property value is '%"NL_I64"d'", val ); + log.displayNL( "property value is '%" NL_I64 "d'", val ); } catch (const CCDBSynchronised::ECDBNotFound &e) { diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp index 681a32943..efe71fbd0 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp @@ -757,7 +757,7 @@ void COutpostManager::saveAll() } TTime endTime = NLMISC::CTime::getLocalTime(); - nldebug("Saved all outposts in %"NL_I64"d ms.", (endTime-startTime)); + nldebug("Saved all outposts in %" NL_I64 "d ms.", (endTime-startTime)); } //---------------------------------------------------------------------------- diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp b/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp index fce468fb4..e2a35b7af 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp @@ -537,14 +537,14 @@ void CCDBSynchronised::pushDelta( CBitMemStream& s, CCDBStructNodeLeaf *node, ui s.serialAndLog2( value, 32 ); bitsize += 32; if ( VerboseDatabase ) - nldebug( "CDB: Pushing value %"NL_I64"d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); + nldebug( "CDB: Pushing value %" NL_I64 "d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); } else { s.serialAndLog2( value, (uint)node->type() ); bitsize += (uint32)node->type(); if ( VerboseDatabase ) - nldebug( "CDB: Pushing value %"NL_I64"d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() ); + nldebug( "CDB: Pushing value %" NL_I64 "d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() ); } } else @@ -571,14 +571,14 @@ void CCDBSynchronised::pushDeltaPermanent( NLMISC::CBitMemStream& s, CCDBStructN s.serialAndLog2( value, 32 ); bitsize += 32; if ( VerboseDatabase ) - nldebug( "CDB: Pushing permanent value %"NL_I64"d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); + nldebug( "CDB: Pushing permanent value %" NL_I64 "d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); } else { s.serialAndLog2( value, (uint)node->type() ); bitsize += (uint32)node->type(); if ( VerboseDatabase ) - nldebug( "CDB: Pushing permanent value %"NL_I64"d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() ); + nldebug( "CDB: Pushing permanent value %" NL_I64 "d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() ); } } else @@ -806,7 +806,7 @@ bool CCDBSynchronised::x_setProp( ICDBStructNode * node, sint64 value, bool forc { std::string const* pname = node->getName(); std::string name = pname?*pname:"'Unknown'"; - nlinfo( "CDB: Set new value %"NL_I64"d for prop %s in atom %s", value, name.c_str(), groupNodeFinder->getParent()?groupNodeFinder->getName()->c_str():"(root)" ); + nlinfo( "CDB: Set new value %" NL_I64 "d for prop %s in atom %s", value, name.c_str(), groupNodeFinder->getParent()?groupNodeFinder->getName()->c_str():"(root)" ); } } #endif @@ -825,7 +825,7 @@ bool CCDBSynchronised::x_setProp( ICDBStructNode * node, sint64 value, bool forc { std::string const* pname = node->getName(); std::string name = pname?*pname:"'Unknown'"; - nlinfo( "CDB: Set new value %"NL_I64"d for prop %s", value, name.c_str() ); + nlinfo( "CDB: Set new value %" NL_I64 "d for prop %s", value, name.c_str() ); } #endif } @@ -874,7 +874,7 @@ bool CCDBSynchronised::x_setPropButDontSend( const std::string& name, sint64 val #ifdef TRACE_SET_VALUE if ( VerboseDatabase ) - nlinfo("Set value %"NL_I64"d for Prop %s, no change flag", value, name.c_str() ); + nlinfo("Set value %" NL_I64 "d for Prop %s, no change flag", value, name.c_str() ); #endif // Set the property. 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 259a0fc6f..c75d6c2f0 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 @@ -5271,7 +5271,7 @@ void CCharacter::teleportCharacter( sint32 x, sint32 y, sint32 z, bool teleportW uint64 NOT_TELEPORTING_FLAG= (((uint64)0x12345678)<<32)| (uint64)0x87654321; if ( _WhoSeesMeBeforeTP != NOT_TELEPORTING_FLAG ) { - nlwarning("INVISIBILITY (teleportCharacter) Player %s already being Tp as _WhoSeesMeBeforeTp is = %"NL_I64"u and WhoSeesMe = %"NL_I64"u", _Id.toString().c_str(), _WhoSeesMeBeforeTP, whoSeesMe.getValue() ); + nlwarning("INVISIBILITY (teleportCharacter) Player %s already being Tp as _WhoSeesMeBeforeTp is = %" NL_I64 "u and WhoSeesMe = %" NL_I64 "u", _Id.toString().c_str(), _WhoSeesMeBeforeTP, whoSeesMe.getValue() ); nlwarning("INVISIBILITY (teleportCharacter) Current Coordinates :(%d, %d, %d) TP coordinates : (%d, %d, %d)", x,y,z); } else @@ -19371,7 +19371,7 @@ bool CCharacter::setGuildId( uint32 guildId ) _GuildId = guildId; #ifdef HAVE_MONGO - CMongo::update("users", toString("{'game.cid':%"NL_I64"u}", _Id.getShortId()), toString("{$set:{'game.guildId':%d}}", guildId)); + CMongo::update("users", toString("{'game.cid':%" NL_I64 "u}", _Id.getShortId()), toString("{$set:{'game.guildId':%d}}", guildId)); #endif return true; @@ -20375,7 +20375,7 @@ void CCharacter::setIntangibleEndDate(NLMISC::TGameCycle date) void CCharacter::setWhoSeesMeBeforeTP(const uint64 &whoSeesMe) { uint64 NOT_TELEPORTING_FLAG= (((uint64)0x12345678)<<32)| (uint64)0x87654321; - BOMB_IF(_WhoSeesMeBeforeTP != NOT_TELEPORTING_FLAG && whoSeesMe != NOT_TELEPORTING_FLAG , NLMISC::toString("Failing to set _WhoSeesMeBeforeTP old value=%"NL_I64"x new value =%"NL_I64"x", _WhoSeesMeBeforeTP, whoSeesMe), return ); + BOMB_IF(_WhoSeesMeBeforeTP != NOT_TELEPORTING_FLAG && whoSeesMe != NOT_TELEPORTING_FLAG , NLMISC::toString("Failing to set _WhoSeesMeBeforeTP old value=%" NL_I64 "x new value =%" NL_I64 "x", _WhoSeesMeBeforeTP, whoSeesMe), return ); _WhoSeesMeBeforeTP= whoSeesMe; } diff --git a/code/ryzom/server/src/entity_view_service/entity_view_service.cpp b/code/ryzom/server/src/entity_view_service/entity_view_service.cpp index 69de3773c..44161a4f7 100644 --- a/code/ryzom/server/src/entity_view_service/entity_view_service.cpp +++ b/code/ryzom/server/src/entity_view_service/entity_view_service.cpp @@ -1104,7 +1104,7 @@ NLMISC_COMMAND(follow, "follow an entity", "entityId") uint creatorId; uint dynamicId; - if (sscanf(args[0].c_str(), "(%"NL_I64"x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) + if (sscanf(args[0].c_str(), "(%" NL_I64 "x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) return false; sid.setShortId( id ); diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index 04bf990cd..02f0bf0b4 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -981,7 +981,7 @@ void fillSHEET( TOutBox& outbox, TPropIndex ) TDataSetIndex compressedRow = TVPNodeServer::PrioContext.EntityIndex.getCompressedIndex(); uint64 value = (uint64)sheetValue | (((uint64)compressedRow) << 32); ap->setValue64( value ); - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu SHEET at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_SHEET, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu SHEET at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_SHEET, outbox.getPosInBit(), ap->getValue() ); // Add row into the action ap->packFast( outbox ); @@ -1026,7 +1026,7 @@ void fillBEHAVIOUR( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_BEHAVIOUR ); DECLARE_AP(BEHAVIOUR); caseFillAction( BEHAVIOUR ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu BEHAVIOUR at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_BEHAVIOUR, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu BEHAVIOUR at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_BEHAVIOUR, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1045,7 +1045,7 @@ void fillNAME_STRING_ID( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_NAME_STRING_ID ); DECLARE_AP(NAME_STRING_ID); caseFillAction( NAME_STRING_ID ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu NAME_STRING_ID at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_NAME_STRING_ID, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu NAME_STRING_ID at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_NAME_STRING_ID, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1166,7 +1166,7 @@ void fillBARS( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_BARS ); DECLARE_AP(BARS); caseFillAction( BARS ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu BARS at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_BARS, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu BARS at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_BARS, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1189,7 +1189,7 @@ void fillVisualPropertyABC( TOutBox& outbox, TPropIndex propIndex ) DECLARE_AP_INDEX(propIndex); CMirrorPropValueRO prop( TheDataset, TVPNodeServer::PrioContext.EntityIndex, propIndex-PROPERTY_VPA+DSPropertyVPA ); \ ap->setValue64( prop() ); - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu %s at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, propIndex, CLFECOMMON::getPropText( propIndex ), outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu %s at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, propIndex, CLFECOMMON::getPropText( propIndex ), outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1208,7 +1208,7 @@ void fillCONTEXTUAL( TOutBox& outbox, TPropIndex propIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_CONTEXTUAL ); DECLARE_AP(CONTEXTUAL); caseFillAction( CONTEXTUAL ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu CONTEXTUAL at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_CONTEXTUAL, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu CONTEXTUAL at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_CONTEXTUAL, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1226,7 +1226,7 @@ void fillVISUAL_FX( TOutBox& outbox, TPropIndex propIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_VISUAL_FX ); DECLARE_AP(VISUAL_FX); caseFillAction( VISUAL_FX ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu VISUAL_FX at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_VISUAL_FX, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu VISUAL_FX at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_VISUAL_FX, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1310,7 +1310,7 @@ void fillGUILD_NAME_ID( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_NAME_ID ); DECLARE_AP(GUILD_NAME_ID); caseFillAction( GUILD_NAME_ID ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu GUILD_NAME_ID at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_NAME_ID, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu GUILD_NAME_ID at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_NAME_ID, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1328,7 +1328,7 @@ void fillGUILD_SYMBOL( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_SYMBOL ); DECLARE_AP(GUILD_SYMBOL); caseFillAction( GUILD_SYMBOL ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu GUILD_SYMBOL at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_SYMBOL, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu GUILD_SYMBOL at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_SYMBOL, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1347,7 +1347,7 @@ void fillEVENT_FACTION_ID( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_EVENT_FACTION_ID ); DECLARE_AP(EVENT_FACTION_ID); caseFillAction( EVENT_FACTION_ID ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu EVENT_FACTION_ID at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_EVENT_FACTION_ID, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu EVENT_FACTION_ID at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_EVENT_FACTION_ID, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1366,7 +1366,7 @@ void fillPVP_MODE( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_MODE ); DECLARE_AP(PVP_MODE); caseFillAction( PVP_MODE ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu PVP_MODE at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_MODE, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu PVP_MODE at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_MODE, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1385,7 +1385,7 @@ void fillPVP_CLAN( TOutBox& outbox, TPropIndex ) //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_CLAN ); DECLARE_AP(PVP_CLAN); caseFillAction( PVP_CLAN ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu PVP_CLAN at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_CLAN, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu PVP_CLAN at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_CLAN, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap ); @@ -1403,7 +1403,7 @@ void fillOWNER_PEOPLE( TOutBox& outbox, TPropIndex ) outbox.serialBitAndLog( payloadBit ); DECLARE_AP(OWNER_PEOPLE); caseFillAction( OWNER_PEOPLE ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu OWNER_PEOPLE at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_OWNER_PEOPLE, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu OWNER_PEOPLE at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_OWNER_PEOPLE, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); REMOVE_AP(); @@ -1420,7 +1420,7 @@ void fillOUTPOST_INFOS( TOutBox& outbox, TPropIndex ) outbox.serialBitAndLog( payloadBit ); DECLARE_AP(OUTPOST_INFOS); caseFillAction( OUTPOST_INFOS ) - LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu OUTPOST_INFOS at bitpos %d - value %"NL_I64"u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_OUTPOST_INFOS, outbox.getPosInBit(), ap->getValue() ); + LOG_WHAT_IS_SENT( "%u: Filling buffer for C%hu S%hu P%hu OUTPOST_INFOS at bitpos %d - value %" NL_I64 "u", CTickEventHandler::getGameCycle(), TVPNodeServer::PrioContext.ClientId, (uint16)TVPNodeServer::PrioContext.Slot, PROPERTY_OUTPOST_INFOS, outbox.getPosInBit(), ap->getValue() ); ap->packFast( outbox ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); REMOVE_AP(); diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.h b/code/ryzom/server/src/frontend_service/distance_prioritizer.h index ad59bc12e..27244230d 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.h +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.h @@ -589,7 +589,7 @@ public: { if (entry.HasValue) { - //nldebug( "History for C%hu - slot %hu - prop %hu: %"NL_I64"u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); + //nldebug( "History for C%hu - slot %hu - prop %hu: %" NL_I64 "u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); return (currentValue().getIndex() != *((TDataSetIndex*)&(entry.LastSent))); } else @@ -621,7 +621,7 @@ public: if (entry.HasValue) { - //nldebug( "History for C%hu - slot %hu - prop %hu: %"NL_I64"u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); + //nldebug( "History for C%hu - slot %hu - prop %hu: %" NL_I64 "u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); CMirrorPropValueRO currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex ); #ifdef NL_DEBUG @@ -661,7 +661,7 @@ public: if (entry.HasValue) { - //nldebug( "History for C%hu - slot %hu - prop %hu: %"NL_I64"u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); + //nldebug( "History for C%hu - slot %hu - prop %hu: %" NL_I64 "u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); CMirrorPropValueRO currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex ); return (currentValue().getIndex() != *((TDataSetIndex*)&(entry.LastSent))); @@ -688,7 +688,7 @@ public: if (entry.HasValue) { - //nldebug( "History for C%hu - slot %hu - prop %hu: %"NL_I64"u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); + //nldebug( "History for C%hu - slot %hu - prop %hu: %" NL_I64 "u", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex, lastsent_value ); NLMISC::TGameCycle mirrorCycle = TheDataset.getChangeTimestamp( dsPropertyIndex, TVPNodeServer::PrioContext.EntityIndex ); return (mirrorCycle != entry.LastSent); diff --git a/code/ryzom/server/src/frontend_service/entity_container.cpp b/code/ryzom/server/src/frontend_service/entity_container.cpp index ba03595c5..e5b1ca122 100644 --- a/code/ryzom/server/src/frontend_service/entity_container.cpp +++ b/code/ryzom/server/src/frontend_service/entity_container.cpp @@ -425,7 +425,7 @@ void CEntity::displayProperties( const TEntityIndex& entityIndex, NLMISC::CLog * lsSheet = histohasvalue ? toString( "%u", (uint32)lastsent_value ) : "NOT SENT YET"; dispDist(lsSheet,THRESHOLD_SHEET); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_BEHAVIOUR, histohasvalue ).LastSent; - lsBehav = histohasvalue ? toString( "%"NL_I64"u", (uint64)lastsent_value ) : "NOT SENT YET"; + lsBehav = histohasvalue ? toString( "%" NL_I64 "u", (uint64)lastsent_value ) : "NOT SENT YET"; dispDist(lsBehav,THRESHOLD_BEHAVIOUR); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_NAME_STRING_ID, histohasvalue ).LastSent; lsName = histohasvalue ? toString( "%u", (uint32)lastsent_value ) : "NOT SENT YET"; @@ -437,13 +437,13 @@ void CEntity::displayProperties( const TEntityIndex& entityIndex, NLMISC::CLog * lsMode = histohasvalue ? toString( "%hu", (uint32)lastsent_value ) : "NOT SENT YET"; dispDist(lsMode,THRESHOLD_MODE); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPA, histohasvalue ).LastSent; - lsVPA = histohasvalue ? toString( "%"NL_I64"u", lastsent_value ) : "NOT SENT YET"; + lsVPA = histohasvalue ? toString( "%" NL_I64 "u", lastsent_value ) : "NOT SENT YET"; dispDist(lsVPA,THRESHOLD_VPA); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPB, histohasvalue ).LastSent; - lsVPB = histohasvalue ? toString( "%"NL_I64"u", lastsent_value ) : "NOT SENT YET"; + lsVPB = histohasvalue ? toString( "%" NL_I64 "u", lastsent_value ) : "NOT SENT YET"; dispDist(lsVPB,THRESHOLD_VPB); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPC, histohasvalue ).LastSent; - lsVPC = histohasvalue ? toString( "%"NL_I64"u", lastsent_value ) : "NOT SENT YET"; + lsVPC = histohasvalue ? toString( "%" NL_I64 "u", lastsent_value ) : "NOT SENT YET"; dispDist(lsVPC,THRESHOLD_VPC); lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_ENTITY_MOUNTED_ID, histohasvalue ).LastSent; lsMount = histohasvalue ? toString( "%d", (uint32)lastsent_value ) : "NOT SENT YET"; @@ -486,9 +486,9 @@ void CEntity::displayProperties( const TEntityIndex& entityIndex, NLMISC::CLog * TDataSetIndex target = (TDataSetIndex)PV(PROPERTY_TARGET_ID), mount = (TDataSetIndex)PV(PROPERTY_ENTITY_MOUNTED_ID), rider = (TDataSetIndex)PV(PROPERTY_RIDER_ENTITY_ID); log->displayNL( "| Target %d \t %s", target, lsTarget.c_str() ); log->displayNL( "| Mode %hu \t %s", (uint8)PV(PROPERTY_MODE), lsMode.c_str() ); - log->displayNL( "| VPA %"NL_I64"u \t %s", PV(PROPERTY_VPA), lsVPA.c_str() ); - log->displayNL( "| VPB %"NL_I64"u \t %s", PV(PROPERTY_VPB), lsVPB.c_str() ); - log->displayNL( "| VPC %"NL_I64"u \t %s", PV(PROPERTY_VPC), lsVPC.c_str() ); + log->displayNL( "| VPA %" NL_I64 "u \t %s", PV(PROPERTY_VPA), lsVPA.c_str() ); + log->displayNL( "| VPB %" NL_I64 "u \t %s", PV(PROPERTY_VPB), lsVPB.c_str() ); + log->displayNL( "| VPC %" NL_I64 "u \t %s", PV(PROPERTY_VPC), lsVPC.c_str() ); log->displayNL( "| Mount %d \t %s", mount, lsMount.c_str() ); log->displayNL( "| Rider %d \t \t %s", rider, lsRider.c_str() ); log->displayNL( "| Contextual %hu \t %s", (uint16)PV(PROPERTY_CONTEXTUAL), lsContextual.c_str() ); diff --git a/code/ryzom/server/src/frontend_service/vision_provider.cpp b/code/ryzom/server/src/frontend_service/vision_provider.cpp index c03f91183..2354d63c2 100644 --- a/code/ryzom/server/src/frontend_service/vision_provider.cpp +++ b/code/ryzom/server/src/frontend_service/vision_provider.cpp @@ -316,7 +316,7 @@ inline TCoord CVisionProvider::calcDistance( CClientHost *client, TCLEntityId sl //{ // pos2x = getAbsoluteCoordinateFrom64( vlastposx ); // pos2y = getAbsoluteCoordinateFrom64( vlastposy ); - // //nlinfo( "lastpos: %d %d, vlastpos: %"NL_I64"u %"NL_I64"u", pos2x, pos2y, vlastposx, vlastposy ); + // //nlinfo( "lastpos: %d %d, vlastpos: %" NL_I64 "u %" NL_I64 "u", pos2x, pos2y, vlastposx, vlastposy ); /*#ifdef NL_DEBUG TCoord d = (TCoord)(abs(pos1x-pos2x) + abs(pos1y-pos2y)); if ( d < 0 ) @@ -757,7 +757,7 @@ NLMISC_COMMAND( displayEntityInfoById, "Display the properties of an entity, by uint type; uint creatorId; uint dynamicId; - if (sscanf(args[0].c_str(), "(%"NL_I64"x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) + if (sscanf(args[0].c_str(), "(%" NL_I64 "x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) return false; eid.setShortId( id ); eid.setType( type ); diff --git a/code/ryzom/server/src/gpm_service/commands.cpp b/code/ryzom/server/src/gpm_service/commands.cpp index 8e5c8d1b8..5d58296ac 100644 --- a/code/ryzom/server/src/gpm_service/commands.cpp +++ b/code/ryzom/server/src/gpm_service/commands.cpp @@ -602,7 +602,7 @@ NLMISC_COMMAND(trackEntity, "get track of an entity position", "id") uint creatorId; uint dynamicId; - if (sscanf(args[0].c_str(), "(%"NL_I64"x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) + if (sscanf(args[0].c_str(), "(%" NL_I64 "x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) return false; eid.setShortId( id ); diff --git a/code/ryzom/server/src/gpm_service/world_entity.cpp b/code/ryzom/server/src/gpm_service/world_entity.cpp index 6debb6284..7ebdcbf2a 100644 --- a/code/ryzom/server/src/gpm_service/world_entity.cpp +++ b/code/ryzom/server/src/gpm_service/world_entity.cpp @@ -328,7 +328,7 @@ void CWorldEntity::createPrimitive(NLPACS::UMoveContainer *pMoveContainer, uint8 return; } primitive->UserData = ((uint64)(Index.getIndex()) << 16); - //nldebug("Set entity E%u to %"NL_I64"d", Index.getIndex(), primitive->UserData); + //nldebug("Set entity E%u to %" NL_I64 "d", Index.getIndex(), primitive->UserData); primitive->setPrimitiveType( UMovePrimitive::_2DOrientedCylinder ); primitive->setReactionType( UMovePrimitive::Slide ); primitive->setTriggerType( UMovePrimitive::NotATrigger ); diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index 7fc324790..d5cb1622b 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -572,7 +572,7 @@ void CWorldPositionManager::processPacsTriggers(UMoveContainer *moveContainer) uint64 trigger = info.Object0; uint64 entity = info.Object1; - //nldebug("In processPacsTriggers: %"NL_I64"d versus %"NL_I64"d", entity, trigger); + //nldebug("In processPacsTriggers: %" NL_I64 "d versus %" NL_I64 "d", entity, trigger); if ((entity&0xffff) != 0) swap(trigger, entity); diff --git a/code/ryzom/server/src/mirror_service/tick_proxy.cpp b/code/ryzom/server/src/mirror_service/tick_proxy.cpp index 6b3a67c42..cf51f79c6 100644 --- a/code/ryzom/server/src/mirror_service/tick_proxy.cpp +++ b/code/ryzom/server/src/mirror_service/tick_proxy.cpp @@ -115,7 +115,7 @@ static void cbSyncFromMaster(CMessage& msgin, const std::string &serviceName, TS CTickProxy::setGameCycle( gameCycle ); //nldebug( "TCK-%u: Master Sync", gameCycle ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Master Sync", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, gameCycle ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Master Sync", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, gameCycle ); // user callback onSync(); @@ -257,7 +257,7 @@ void CTickProxy::receiveTockFromClient( CMessage& msgin, TServiceId senderId, bo //nldebug( "TCK-%u: %hu tocking", getGameCycle(), senderId ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: %hu tocking", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), senderId.get() ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: %hu tocking", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), senderId.get() ); ++_NbTocked; _TockedServices.push_back( senderId ); @@ -276,7 +276,7 @@ void CTickProxy::masterTickUpdate( TServiceId serviceId ) //nldebug( "TCK-%u: Master Tick", getGameCycle() ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Master Tick", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle() ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Master Tick", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle() ); //nldebug( "--GC-%u-->", _GameCycle ); @@ -298,7 +298,7 @@ void CTickProxy::sendSyncToClient( TServiceId serviceId ) CUnifiedNetwork::getInstance()->send( serviceId, msgout ); //nldebug( "TCK-%u: Sync %hu", getGameCycle(), serviceId ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), serviceId.get() ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), serviceId.get() ); } void CTickProxy::sendSyncs() @@ -313,7 +313,7 @@ void CTickProxy::sendSyncs() CUnifiedNetwork::getInstance()->send( (*its), msgout ); //nldebug( "TCK-%u: Sync %hu", getGameCycle(), *its ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get()); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get()); } } @@ -329,7 +329,7 @@ void CTickProxy::sendTicks() //nldebug( "TCK-%u: Tick %hu", getGameCycle(), *its ); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Tick %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get() ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Tick %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get() ); } // nldebug( "Now expecting local tocks" ); State = ExpectingLocalTocks; @@ -391,7 +391,7 @@ void CTickProxy::sendTockBack( TServiceId serviceId ) nlwarning( "Tocked master twice in the same tick!" ); prev = getGameCycle(); //time_t t; time( &t ); - _QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Tocked Master", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle() ); + _QuickLog.displayNL( "%" NL_I64 "u: TCK-%u: Tocked Master", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle() ); } diff --git a/code/ryzom/server/src/pd_lib/pd_lib.cpp b/code/ryzom/server/src/pd_lib/pd_lib.cpp index 1a2cda9ba..bf5c668da 100644 --- a/code/ryzom/server/src/pd_lib/pd_lib.cpp +++ b/code/ryzom/server/src/pd_lib/pd_lib.cpp @@ -765,7 +765,7 @@ void CPDSLib::allocateRow(TTableIndex table, TRowIndex row, uint64 key) { // send to PDS alloc(table, row, key); if (PDVerbose) - nlinfo("CPDSLib: %12s index=%u:%u, key=%016"NL_I64"X", "allocrow", table, row, key); + nlinfo("CPDSLib: %12s index=%u:%u, key=%016" NL_I64 "X", "allocrow", table, row, key); CDbMessage& msg = nextMessage((uint8)table, row); msg.allocRow(key); @@ -787,7 +787,7 @@ void CPDSLib::allocateRow(TTableIndex table, TRowIndex row, uint64 key, const NL { // send to PDS alloc(table, row, key); if (PDVerbose) - nlinfo("CPDSLib: %12s index=%u:%u, key=%016"NL_I64"X", "allocrow", table, row, key); + nlinfo("CPDSLib: %12s index=%u:%u, key=%016" NL_I64 "X", "allocrow", table, row, key); CDbMessage& msg = nextMessage((uint8)table, row); msg.allocRow(key, id); @@ -857,7 +857,7 @@ void CPDSLib::notifyFetchFailure(NLMISC::IStream &f) if (table >= _FetchFailures.size() || _FetchFailures[table] == NULL) { - nlwarning("CPDSLib: Unable to notify fetch failure of %d:%016"NL_I64"X, callback not set.", table, key); + nlwarning("CPDSLib: Unable to notify fetch failure of %d:%016" NL_I64 "X, callback not set.", table, key); return; } @@ -947,14 +947,14 @@ uint CPDSLib::getMessageQueueSize() void CPDSLib::erase(TTableIndex table, uint64 key) { if (PDVerbose) - nlinfo("CPDSLib: %12s table=%u, key=%016"NL_I64"X", "erase", table, key); + nlinfo("CPDSLib: %12s table=%u, key=%016" NL_I64 "X", "erase", table, key); } // Load a row and its dependent rows from a mapped table void CPDSLib::load(TTableIndex table, uint64 key) { if (PDVerbose) - nlinfo("CPDSLib: %12s table=%u, key=%016"NL_I64"X", "load", table, key); + nlinfo("CPDSLib: %12s table=%u, key=%016" NL_I64 "X", "load", table, key); if (!_UsePDS) { diff --git a/code/ryzom/server/src/pd_lib/pd_messages.cpp b/code/ryzom/server/src/pd_lib/pd_messages.cpp index b5e731d95..d8b8912dd 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.cpp +++ b/code/ryzom/server/src/pd_lib/pd_messages.cpp @@ -247,7 +247,7 @@ void CDbMessage::getHRContent(const CDBDescriptionParser& description, std::stri if (getTable() >= db.Tables.size()) return; const CTableNode& table = db.Tables[getTable()]; - result = NLMISC::toString("%-12s: %s %"NL_I64"X %s", "LoadRow", table.Name.c_str(), asUint64(), asEntityId().toString().c_str()); + result = NLMISC::toString("%-12s: %s %" NL_I64 "X %s", "LoadRow", table.Name.c_str(), asUint64(), asEntityId().toString().c_str()); } break; diff --git a/code/ryzom/server/src/pd_lib/pd_server_utils.h b/code/ryzom/server/src/pd_lib/pd_server_utils.h index 2d3979f6b..47bab34dd 100644 --- a/code/ryzom/server/src/pd_lib/pd_server_utils.h +++ b/code/ryzom/server/src/pd_lib/pd_server_utils.h @@ -642,7 +642,7 @@ inline bool CRowMapper::map(TKey key, const RY_PDS::CObjectIndex& index) if (_KeyMap.find(key) != _KeyMap.end()) { - nlwarning("CRowMapper::map(): cannot map '%016"NL_I64"X' to '%d', already mapped", key, index.toString().c_str()); + nlwarning("CRowMapper::map(): cannot map '%016" NL_I64 "X' to '%d', already mapped", key, index.toString().c_str()); return false; } @@ -678,7 +678,7 @@ inline RY_PDS::CObjectIndex CRowMapper::get(TKey key) const if (it == _KeyMap.end()) { - PDS_LOG_DEBUG(1)("CRowMapper::get(): key '%016"NL_I64"X' not mapped", key); + PDS_LOG_DEBUG(1)("CRowMapper::get(): key '%016" NL_I64 "X' not mapped", key); return RY_PDS::CObjectIndex::null(); } @@ -699,7 +699,7 @@ inline bool CRowMapper::unmap(TKey key) if (it == _KeyMap.end()) { - nlwarning("CRowMapper::unmap(): key '%016"NL_I64"X' not mapped", key); + nlwarning("CRowMapper::unmap(): key '%016" NL_I64 "X' not mapped", key); return false; } diff --git a/code/ryzom/server/src/pd_lib/pds_table_buffer.cpp b/code/ryzom/server/src/pd_lib/pds_table_buffer.cpp index 53ae3e10d..fb17a3d5e 100644 --- a/code/ryzom/server/src/pd_lib/pds_table_buffer.cpp +++ b/code/ryzom/server/src/pd_lib/pds_table_buffer.cpp @@ -789,11 +789,11 @@ bool CTableBuffer::processRow(CAccessor& accessor) // already mapped if (!RY_PDS::ResolveDoubleMappedRows) { - PDS_WARNING("processRow(): key '%016"NL_I64"X' already mapped to '%s', failed", header->getKey(), prevMap.toString().c_str()); + PDS_WARNING("processRow(): key '%016" NL_I64 "X' already mapped to '%s', failed", header->getKey(), prevMap.toString().c_str()); return false; } - PDS_WARNING("processRow(): key '%016"NL_I64"X' already mapped to '%s'", header->getKey(), prevMap.toString().c_str()); + PDS_WARNING("processRow(): key '%016" NL_I64 "X' already mapped to '%s'", header->getKey(), prevMap.toString().c_str()); if (RY_PDS::ResolveDoubleMappedKeepOlder) { @@ -932,7 +932,7 @@ bool CTableBuffer::mapRow(const RY_PDS::CObjectIndex &index, uint64 key) if (!_RowMapper.map(key, index)) { - PDS_WARNING("mapRow(): failed to map row '%d' to key '%016"NL_I64"X'", index.row(), key); + PDS_WARNING("mapRow(): failed to map row '%d' to key '%016" NL_I64 "X'", index.row(), key); return false; } @@ -971,7 +971,7 @@ bool CTableBuffer::unmapRow(const RY_PDS::CObjectIndex &index, uint64 key) if (!_RowMapper.unmap(key)) { - PDS_WARNING("unmapRow(): failed to unmap row '%d' from key '%016"NL_I64"X", index.row(), key); + PDS_WARNING("unmapRow(): failed to unmap row '%d' from key '%016" NL_I64 "X", index.row(), key); return false; } @@ -980,7 +980,7 @@ bool CTableBuffer::unmapRow(const RY_PDS::CObjectIndex &index, uint64 key) if (header->getKey() != key) { - PDS_WARNING("unmapRow(): row '%d' is mapped to '%016"NL_I64"X', unmap row anyway, system may not recover object", index.row(), key); + PDS_WARNING("unmapRow(): row '%d' is mapped to '%016" NL_I64 "X', unmap row anyway, system may not recover object", index.row(), key); } header->setKey(0); diff --git a/code/ryzom/server/src/persistant_data_service/db_manager.cpp b/code/ryzom/server/src/persistant_data_service/db_manager.cpp index 1f853a729..39590d3ca 100644 --- a/code/ryzom/server/src/persistant_data_service/db_manager.cpp +++ b/code/ryzom/server/src/persistant_data_service/db_manager.cpp @@ -395,7 +395,7 @@ bool CDbManager::mapRow(TDatabaseId id, const RY_PDS::CObjectIndex &index, uint6 CDatabase* db = getDatabase(id); if (db == NULL) { - nlwarning("Unable to mapRow() '%016"NL_I64"X' to row '%d':'%d' in db '%d' , not created yet", key, index.table(), index.row(), id); + nlwarning("Unable to mapRow() '%016" NL_I64 "X' to row '%d':'%d' in db '%d' , not created yet", key, index.table(), index.row(), id); return false; } @@ -415,7 +415,7 @@ bool CDbManager::unmapRow(TDatabaseId id, RY_PDS::TTableIndex tableIndex, uint64 CDatabase* db = getDatabase(id); if (db == NULL) { - nlwarning("Unable to unmapRow() '%016"NL_I64"X' in '%d':'%d' in db '%d' , not created yet", key, tableIndex, id); + nlwarning("Unable to unmapRow() '%016" NL_I64 "X' in '%d':'%d' in db '%d' , not created yet", key, tableIndex, id); return false; } @@ -1054,7 +1054,7 @@ NLMISC_COMMAND(mapRow, "map a row in a table of a given database with a 64bits k RY_PDS::TRowIndex rowId; NLMISC::fromString(args[2], rowId); uint64 key; - sscanf(args[3].c_str(), "%"NL_I64"X", &key); + sscanf(args[3].c_str(), "%" NL_I64 "X", &key); CDatabase* database = CDbManager::getDatabase(databaseId); @@ -1079,7 +1079,7 @@ NLMISC_COMMAND(unmapRow, "unmap a row in a table of a given database with a 64bi NLMISC::fromString(args[0], databaseId); const std::string& tableName = args[1]; uint64 key; - sscanf(args[2].c_str(), "%"NL_I64"X", &key); + sscanf(args[2].c_str(), "%" NL_I64 "X", &key); CDatabase* database = CDbManager::getDatabase(databaseId); diff --git a/code/ryzom/server/src/persistant_data_service/db_manager_messages.h b/code/ryzom/server/src/persistant_data_service/db_manager_messages.h index aaaba01fd..54b2b6ad0 100644 --- a/code/ryzom/server/src/persistant_data_service/db_manager_messages.h +++ b/code/ryzom/server/src/persistant_data_service/db_manager_messages.h @@ -129,7 +129,7 @@ public: void display(NLMISC::CLog* log = NLMISC::InfoLog) { - log->displayNL("%d messages, %d submessages, %"NL_I64"d message bytes, %"NL_I64"d header bytes", NumMessages, NumSubMessages, TotalMessagesSize, TotalHeaderSize); + log->displayNL("%d messages, %d submessages, %" NL_I64 "d message bytes, %" NL_I64 "d header bytes", NumMessages, NumSubMessages, TotalMessagesSize, TotalHeaderSize); log->displayNL("%.1f bytes avg per submessage, %.1f bytes avg per submessage header", (double)TotalMessagesSize/(double)NumSubMessages, (double)TotalHeaderSize/(double)NumSubMessages); log->displayNL("%d updates, %d values updated, %d column updated, %d row updated", NumUpdateSubMessages, UpdateRowMap.size(), UpdateMap.size(), UpdateTableRowMap.size()); } diff --git a/code/ryzom/server/src/persistant_data_service/pds_database.cpp b/code/ryzom/server/src/persistant_data_service/pds_database.cpp index 6743e5e16..c3617f55a 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_database.cpp +++ b/code/ryzom/server/src/persistant_data_service/pds_database.cpp @@ -349,7 +349,7 @@ string CDatabase::getValue(const CLocatePath::TLocatePath &path) if (path[node].Name[0] == '$') { uint64 key; - if (sscanf(path[node].Name.c_str()+1, "%"NL_I64"X", &key) != 1) + if (sscanf(path[node].Name.c_str()+1, "%" NL_I64 "X", &key) != 1) { PDS_WARNING("getValue(): unable to select mapped row '%s'", path[node].Name.c_str()); return ""; @@ -575,7 +575,7 @@ bool CDatabase::mapRow(const RY_PDS::CObjectIndex &index, uint64 key) bool success = table->mapRow(index, key); if (success) - PDS_FULL_DEBUG("mapped '%016"NL_I64"X' to '%s' successfully", key, index.toString().c_str()); + PDS_FULL_DEBUG("mapped '%016" NL_I64 "X' to '%s' successfully", key, index.toString().c_str()); return success; } @@ -605,7 +605,7 @@ bool CDatabase::unmapRow(RY_PDS::TTableIndex tableIndex, uint64 key) bool success = table->unmapRow(key); if (success) - PDS_FULL_DEBUG("unmapped '%016"NL_I64"X' successfully", key); + PDS_FULL_DEBUG("unmapped '%016" NL_I64 "X' successfully", key); return success; } @@ -890,7 +890,7 @@ bool CDatabase::set(RY_PDS::TTableIndex table, RY_PDS::TRowIndex row, RY_PDS::TC case PDS_sint64: { uint64 data; - sscanf(value.c_str(), "%016"NL_I64"d", &data); + sscanf(value.c_str(), "%016" NL_I64 "d", &data); return set(table, row, column, sizeof(data), &data); } break; diff --git a/code/ryzom/server/src/persistant_data_service/pds_table.cpp b/code/ryzom/server/src/persistant_data_service/pds_table.cpp index 8be11839e..38ad34a56 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_table.cpp +++ b/code/ryzom/server/src/persistant_data_service/pds_table.cpp @@ -268,7 +268,7 @@ void CTable::displayRow(RY_PDS::TRowIndex row, NLMISC::CLog* log, bool displayHe (rowaccess.mapped() ? ", mapped" : ""), (rowaccess.dirty() ? ", dirty" : "")); - log->displayNL("row %d: %d bytes, flags=[%s] (map=%016"NL_I64"X, dirtstamp=%08X)", row, _RowSize, flagstr.c_str(), (rowaccess.mapped() ? rowaccess.key() : (uint64)0), rowaccess.dirtyStamp()); + log->displayNL("row %d: %d bytes, flags=[%s] (map=%016" NL_I64 "X, dirtstamp=%08X)", row, _RowSize, flagstr.c_str(), (rowaccess.mapped() ? rowaccess.key() : (uint64)0), rowaccess.dirtyStamp()); if (displayHeader) { @@ -495,11 +495,11 @@ bool CTable::mapRow(const RY_PDS::CObjectIndex &index, uint64 key) if (!_TableBuffer.mapRow(index, key)) { - PDS_WARNING("mapRow(): failed to map '%s' to '%016"NL_I64"X'", index.toString().c_str(), key); + PDS_WARNING("mapRow(): failed to map '%s' to '%016" NL_I64 "X'", index.toString().c_str(), key); return false; } - PDS_FULL_DEBUG("Mapped '%s' to key '%016"NL_I64"X'", index.toString().c_str(), key); + PDS_FULL_DEBUG("Mapped '%s' to key '%016" NL_I64 "X'", index.toString().c_str(), key); return true; } @@ -535,11 +535,11 @@ bool CTable::unmapRow(uint64 key) if (!_TableBuffer.unmapRow(index, key)) { - PDS_WARNING("mapRow(): failed to unmap '%s' to '%016"NL_I64"X'", index.toString().c_str(), key); + PDS_WARNING("mapRow(): failed to unmap '%s' to '%016" NL_I64 "X'", index.toString().c_str(), key); return false; } - PDS_FULL_DEBUG("Unmapped '%s' of key '%016"NL_I64"X'", index.toString().c_str(), key); + PDS_FULL_DEBUG("Unmapped '%s' of key '%016" NL_I64 "X'", index.toString().c_str(), key); return true; } diff --git a/code/ryzom/server/src/tick_service/tick_service.cpp b/code/ryzom/server/src/tick_service/tick_service.cpp index 4a64fdd7c..e3851cfa0 100644 --- a/code/ryzom/server/src/tick_service/tick_service.cpp +++ b/code/ryzom/server/src/tick_service/tick_service.cpp @@ -418,7 +418,7 @@ void CTickService::checkTockReceived() _TickSendTime = oldTime + dt; } - //nlinfo( " %"NL_I64"u %"NL_I64"u", (TTime)((_TickSendTime-oldTime)*1000), (TTime)((d2-oldTime)*1000) ); + //nlinfo( " %" NL_I64 "u %" NL_I64 "u", (TTime)((_TickSendTime-oldTime)*1000), (TTime)((d2-oldTime)*1000) ); // broadcast the tick broadcastTick(); From 517336923fae93215712623b986f130e197210dd Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 12:33:37 +0200 Subject: [PATCH 3/8] Changed: Replace sscanf by fromString --HG-- branch : develop --- code/nel/src/misc/hierarchical_timer.cpp | 2 +- code/ryzom/server/src/ai_service/commands.cpp | 8 ++++---- .../src/entities_game_service/entities_game_service.cpp | 3 ++- .../server/src/persistant_data_service/db_manager.cpp | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/nel/src/misc/hierarchical_timer.cpp b/code/nel/src/misc/hierarchical_timer.cpp index 62dc0786a..70fb98d9f 100644 --- a/code/nel/src/misc/hierarchical_timer.cpp +++ b/code/nel/src/misc/hierarchical_timer.cpp @@ -1082,7 +1082,7 @@ NLMISC_CATEGORISED_COMMAND(nel,displayMeasures, "display hierarchical timer", "[ } sint depth = 0; - bool hasDepth = (sscanf(args[0].c_str(), "%d", &depth) == 1 || (args.size() > 1 && sscanf(args[1].c_str(), "%d", &depth) == 1)); + bool hasDepth = (fromString(args[0], depth) || (args.size() > 1 && fromString(args[1], depth))); CASE_DISPLAYMEASURES(NoSort, -3) CASE_DISPLAYMEASURES(TotalTime, -2) diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index 8d8d1c7c9..0cea6f93c 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -3122,8 +3122,8 @@ static void setRyzomDebugDate(CRyzomDate &rd) NLMISC_COMMAND(setDebugHour, "set the current debug hour", "") { if (args.size() != 1) return false; - int hour; - if (sscanf(args[0].c_str(), "%d", &hour) != 1) return false; + sint hour; + if (!fromString(args[0], hour)) return false; CRyzomDate rd; getRyzomDebugDate(rd); rd.Time = fmodf(rd.Time, 1.f) + (float) hour; @@ -3134,8 +3134,8 @@ NLMISC_COMMAND(setDebugHour, "set the current debug hour", "") NLMISC_COMMAND(setDebugDayOfYear, "set the current debug day of year (first day has index 1)", "") { if (args.size() != 1) return false; - int day; - if (sscanf(args[0].c_str(), "%d", &day) != 1) return false; + sint day; + if (!fromString(args[0], day)) return false; CRyzomDate rd; getRyzomDebugDate(rd); rd.Day = day - 1; // for the user, days start at '1' diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index 23a43beff..b84129e46 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -3916,7 +3916,8 @@ NLMISC_COMMAND( db, "Display or set the value of a property in the database", "< { // Set sint64 value; - sscanf( args[2].c_str(), "%"NL_I64"d", &value ); + fromString(args[2], value); + if ( (args.size() > 3) && (args[3]!="0") ) { res = e->_PropertyDatabase.x_setPropButDontSend( entry, value ); diff --git a/code/ryzom/server/src/persistant_data_service/db_manager.cpp b/code/ryzom/server/src/persistant_data_service/db_manager.cpp index 39590d3ca..582788257 100644 --- a/code/ryzom/server/src/persistant_data_service/db_manager.cpp +++ b/code/ryzom/server/src/persistant_data_service/db_manager.cpp @@ -1217,7 +1217,7 @@ NLMISC_COMMAND(dumpToXml, "dump the content of an object into an xml file", " Date: Thu, 20 Oct 2016 12:34:25 +0200 Subject: [PATCH 4/8] Changed: Minor changes --HG-- branch : develop --- .../3d/zone_check_bind/zone_check_bind.cpp | 78 +++++++++---------- .../entities_game_service.cpp | 4 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp b/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp index 465fcddb1..c6dfa56c0 100644 --- a/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp +++ b/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "zone_utility.h" -// +// #include "nel/misc/types_nl.h" #include "nel/misc/path.h" #include "nel/misc/file.h" @@ -54,7 +54,7 @@ struct CPatchVertexInfo uint patchIndex, uint patchVertex, const CVector &pos - ) + ) : ZoneIndex(zoneIndex), PatchIndex(patchIndex), PatchVertex(patchVertex), @@ -95,7 +95,7 @@ static CZone *LoadZone(uint16 xPos, uint16 yPos, std::string zoneExt) { std::string zoneName; ::getZoneNameByCoord(xPos, yPos, zoneName); - std::auto_ptr zone(new CZone); + std::auto_ptr zone(new CZone); std::string lookedUpZoneName = CPath::lookup(zoneName + zoneExt, false, false, false); if (lookedUpZoneName.empty()) return NULL; CIFile iF; @@ -128,7 +128,7 @@ static void GetCandidateVertices(const CVector &pos, float weldThreshold ) { - dest.clear(); + dest.clear(); CVector half(weldThreshold, weldThreshold, weldThreshold); qg.select(pos - half, pos + half); for (TPVQuadGrid::CIterator it = qg.begin(); it != qg.end(); ++it) @@ -146,8 +146,8 @@ static void GetCandidateVertices(const CVector &pos, //=========================================================================================================================== /** Search a vertex of a patch that can be welded with the given vertex * return -1 if none - */ -static sint GetWeldableVertex(const CBezierPatch &bp, const CVector &pos, float weldThreshold) + */ +static sint GetWeldableVertex(const CBezierPatch &bp, const CVector &pos, float weldThreshold) { for (uint k = 0; k < 4; ++k) { @@ -166,7 +166,7 @@ static sint GetWeldableVertex(const CBezierPatch &bp, const CVector &pos, float static uint CheckZone(std::string middleZoneFile, float weldThreshold, float middleEdgeWeldThreshold) { uint numErrors = 0; - uint k, l, m, n, p, q; // some loop counters + uint k, l, m, n, p, q; // some loop counters // This avoid reporting errors twice (for readability) std::set errorPairs; @@ -176,7 +176,7 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid std::auto_ptr zones[9]; std::string zoneNames[9]; - CZoneInfo zoneInfos[9]; + CZoneInfo zoneInfos[9]; uint16 xPos, yPos; const sint16 posOffs[][2] = { {0, 0}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1} }; @@ -201,16 +201,16 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid nlinfo("Zones loading failed : %d", e.what()); return 0; } - + /////////////////////////////// // retrieve datas from zones // /////////////////////////////// for (k = 0; k < 9; ++k) { - ::getZoneNameByCoord(xPos + posOffs[k][0], yPos + posOffs[k][1], zoneNames[k]); + ::getZoneNameByCoord(xPos + posOffs[k][0], yPos + posOffs[k][1], zoneNames[k]); if (zones[k].get() != NULL) zones[k]->retrieve(zoneInfos[k]); - } + } // fill the quad grid CAABBox zoneBBox = zones[0]->getZoneBB().getAABBox(); @@ -222,7 +222,7 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid // insert vertices in quadgrid for (k = 0; k < 9; ++k) - { + { for (l = 0; l < zoneInfos[k].Patchs.size(); ++l) { CPatchInfo &patch = zoneInfos[k].Patchs[l]; @@ -236,7 +236,7 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid CVector half(weldThreshold, weldThreshold, weldThreshold); // yes, insert it in the tree qg.insert(pos - half, pos + half, CPatchVertexInfo(k, l, m, pos)); - } + } } } } @@ -246,11 +246,11 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid ///////////////////////////////////////////////// for (l = 0; l < zoneInfos[0].Patchs.size(); ++l) - { + { CPatchInfo &patch = zoneInfos[0].Patchs[l]; // deals with each border for (m = 0; m < 4; ++m) - { + { // if this border is said to be bound, no need to test.. if (patch.BindEdges[m].NPatchs == 0) { @@ -271,10 +271,10 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid ::GetCandidateVertices(patch.Patch.Vertices[vIndex[q]], qg, verts[q], l, 0, weldThreshold); } - + /////////////////////////// // 1 - 1 connectivity ? // - /////////////////////////// + /////////////////////////// // If there is a patch that is present in the 2 lists, then this is a 1-1 error for (n = 0; n < verts[0].size() && !errorFound; ++n) { @@ -288,9 +288,9 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid CPatchIdentPair errPair = std::make_pair(pi1, pi2); // if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? - { + { nlinfo("**** Patch %d of zone %s has 1 - 1 connectivity error, try binding it with patch %d of zone %s", - l + 1, middleZoneName.c_str(), verts[0][n]->PatchIndex + 1, zoneNames[verts[0][n]->ZoneIndex].c_str()); + l + 1, middleZoneName.c_str(), verts[0][n]->PatchIndex + 1, zoneNames[verts[0][n]->ZoneIndex].c_str()); errorPairs.insert(std::make_pair(pi2, pi1)); ++numErrors; } @@ -303,10 +303,10 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid ////////////////////////// // 1 - 2 connectivity ? // ////////////////////////// - + // get the position at the middle of that border CVector middlePos = patch.Patch.eval( 0.5f * (indexToST[vIndex[0]][0] + indexToST[vIndex[1]][0]), - 0.5f * (indexToST[vIndex[0]][1] + indexToST[vIndex[1]][1]) ); + 0.5f * (indexToST[vIndex[0]][1] + indexToST[vIndex[1]][1]) ); // for each vertex of this border for (q = 0; q < 2 && !errorFound; ++q) @@ -330,24 +330,24 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid CPatchIdentPair errPair = std::make_pair(pi1, pi2); // if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? - { + { nlinfo("**** Patch %d of zone %s has 1 - 2 connectivity error, try binding it with patch %d of zone %s", - l + 1, middleZoneName.c_str(), pv.PatchIndex + 1, zoneNames[pv.ZoneIndex].c_str()); + l + 1, middleZoneName.c_str(), pv.PatchIndex + 1, zoneNames[pv.ZoneIndex].c_str()); errorPairs.insert(std::make_pair(pi2, pi1)); - ++numErrors; + ++numErrors; } errorFound = true; break; - } + } } } - if (errorFound) continue; - + if (errorFound) continue; + ////////////////////////// // 1 - 4 connectivity ? // ////////////////////////// - + // compute points along the border. CVector borderPos[5]; float lambda = 0.f; @@ -356,12 +356,12 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid borderPos[n] = patch.Patch.eval((1.f - lambda) * indexToST[vIndex[0]][0] + lambda * indexToST[vIndex[1]][0], (1.f - lambda) * indexToST[vIndex[0]][1] + lambda * indexToST[vIndex[1]][1]); lambda += 0.25f; - } - + } + // Try to find a patch that shares 2 consecutives vertices for (k = 0; k < 4 && !errorFound; ++k) { - ::GetCandidateVertices(borderPos[k], qg, verts[0], l, 0, middleEdgeWeldThreshold); + ::GetCandidateVertices(borderPos[k], qg, verts[0], l, 0, middleEdgeWeldThreshold); for (p = 0; p < verts[0].size() && !errorFound; ++p) { const CPatchVertexInfo &pv = *(verts[0][p]); @@ -382,16 +382,16 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid CPatchIdentPair errPair = std::make_pair(pi1, pi2); // if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? - { + { nlinfo("**** Patch %d of zone %s has 1 - 4 connectivity error, try binding it with patch %d of zone %s", - l + 1, middleZoneName.c_str(), pv.PatchIndex + 1, zoneNames[pv.ZoneIndex].c_str()); + l + 1, middleZoneName.c_str(), pv.PatchIndex + 1, zoneNames[pv.ZoneIndex].c_str()); ++numErrors; errorPairs.insert(std::make_pair(pi2, pi1)); } errorFound = true; } } - } + } } } } @@ -406,14 +406,14 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid //========================================================================================================================= int main(int argc, char* argv[]) -{ +{ NLMISC::createDebug(); InfoLog->addNegativeFilter("adding the path"); if (argc < 4) { std::string appName = CFile::getFilename(std::string(argv[0])); - nlinfo("usage : %s \n", appName.empty() ? "zone_check_bind" : appName.c_str()); + nlinfo("usage : %s \n", appName.empty() ? "zone_check_bind" : appName.c_str()); return -1; } @@ -442,10 +442,10 @@ int main(int argc, char* argv[]) // Filter addSearchPath CPath::addSearchPath(zonePaths); - + // Contains all the zone in the directory std::vector zoneNames; - + CPath::getPathContent(zonePaths, true, false, true, zoneNames); uint numErrors = 0; @@ -461,4 +461,4 @@ int main(int argc, char* argv[]) nlinfo("%d errors were found", numErrors); } - + diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index b84129e46..01b9607c7 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -1618,7 +1618,7 @@ nlassert(nodeLeaf->getType() == ICDBStructNode::TEXT); // { // if( args.size() == 0 ) // return false; -// +// // NLMEMORY::StatisticsReport( args[0].c_str(), args.size() > 1 ); // return true; //} @@ -3873,7 +3873,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value"," Date: Thu, 20 Oct 2016 12:34:38 +0200 Subject: [PATCH 5/8] Changed: Replace sscanf by fromString --HG-- branch : develop --- code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp b/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp index c6dfa56c0..f7fa710aa 100644 --- a/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp +++ b/code/nel/tools/3d/zone_check_bind/zone_check_bind.cpp @@ -419,13 +419,13 @@ int main(int argc, char* argv[]) float weldThreshold, middleEdgeWeldThreshold; - if (::sscanf(argv[2], "%f", &weldThreshold) != 1) + if (!fromString(argv[2], weldThreshold)) { nlinfo("invalid weldThreshold"); return -1; } - if (::sscanf(argv[3], "%f", &middleEdgeWeldThreshold) != 1) + if (!fromString(argv[3], middleEdgeWeldThreshold)) { nlinfo("invalid middleEdgeWeldThreshold"); return -1; From 661975a4711f0de5ce6f637bc5ff405c835bae93 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 12:35:24 +0200 Subject: [PATCH 6/8] Changed: Simplify toString --HG-- branch : develop --- code/ryzom/common/src/game_share/object.cpp | 2 +- code/ryzom/server/src/entities_game_service/admin.cpp | 4 ++-- .../mission_manager/missions_commands.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index d3f8856af..45e1a549e 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -894,7 +894,7 @@ void CObjectInteger::inPlaceCopy(const CObjectInteger &src) } -std::string CObjectInteger::doToString() const { return NLMISC::toString("%" NL_I64 "d", _Value); } +std::string CObjectInteger::doToString() const { return NLMISC::toString(_Value); } void CObjectInteger::doSerialize(std::string& out, CSerializeContext& /* context */) const { diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 5e0ad4efd..585b4c1a8 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -1002,7 +1002,7 @@ ENTITY_VARIABLE(Money, "Money") if (get) { - value = toString("%"NL_I64"u", c->getMoney()); + value = toString(c->getMoney()); } else { @@ -1054,7 +1054,7 @@ ENTITY_VARIABLE(MoneyGuild, "MoneyGuild") if (get) { - value = toString("%"NL_I64"u", guild->getMoney()); + value = toString(guild->getMoney()); } else { diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index f7cd1b6af..e97043a9d 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -1011,7 +1011,7 @@ NLMISC_COMMAND(getMoney, "get money of player", "") { GET_ACTIVE_CHARACTER - string value = toString("%"NL_I64"u", c->getMoney()); + string value = toString(c->getMoney()); log.displayNL(value.c_str()); From de2eba12feb53cb434d1aab741bc022a8f6fb726 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 13:07:18 +0200 Subject: [PATCH 7/8] Changed: Logs in Ryzom Installer --HG-- branch : develop --- .../client/ryzom_installer/src/downloader.cpp | 9 +++- .../ryzom_installer/src/installdialog.cpp | 9 ++-- .../tools/client/ryzom_installer/src/main.cpp | 27 +++++++++++ .../ryzom_installer/src/migratedialog.cpp | 8 ++-- .../client/ryzom_installer/src/operation.h | 2 + .../tools/client/ryzom_installer/src/stdpch.h | 6 ++- .../client/ryzom_installer/src/utils.cpp | 48 +++++++++++++++++++ .../tools/client/ryzom_installer/src/utils.h | 10 ++++ 8 files changed, 108 insertions(+), 11 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp index bbc660f8a..19e5793ee 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp @@ -272,6 +272,8 @@ void CDownloader::onHeadFinished() { if (redirection.isEmpty()) { + nlwarning("No redirection defined"); + if (m_listener) m_listener->operationFail(tr("Redirection URL is not defined")); return; } @@ -298,6 +300,8 @@ void CDownloader::onHeadFinished() if (!m_supportsAcceptRanges && acceptRanges == "bytes") { + nlinfo("Server supports resume for %s", Q2C(url)); + // server supports resume, part 1 m_supportsAcceptRanges = true; @@ -309,6 +313,7 @@ void CDownloader::onHeadFinished() // server doesn't support resume or // we requested range, but server always returns 200 // download from the beginning + nlwarning("Server doesn't support resume, download %s from the beginning", Q2C(url)); } // we requested with a range @@ -327,10 +332,12 @@ void CDownloader::onHeadFinished() // update offset and size if (m_listener) m_listener->operationInit(m_offset, m_size); + + nlinfo("Server supports resume for %s: offset %" NL_I64 "d, size %" NL_I64 "d", Q2C(url), m_offset, m_size); } else { - qDebug() << "Unable to parse"; + nlwarning("Unable to parse %s", Q2C(contentRange)); } } diff --git a/code/ryzom/tools/client/ryzom_installer/src/installdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/installdialog.cpp index 65378c369..b1ef5de67 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/installdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/installdialog.cpp @@ -132,17 +132,18 @@ void CInstallDialog::accept() // check free disk space qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); + // shouldn't happen if (freeSpace == 0) { - QString error = qFromUtf8(NLMISC::formatErrorMessage(NLMISC::getLastError())); + int error = NLMISC::getLastError(); - QMessageBox::StandardButton res = QMessageBox::warning(this, tr("Error"), tr("Error '%1' occured when trying to check free disk space on %2.").arg(error).arg(m_dstDirectory)); - return; + nlwarning("Error '%s' (%d) occured when trying to check free disk space on %s, continue anyway", NLMISC::formatErrorMessage(error).c_str(), error, Q2C(m_dstDirectory)); } const CServer &server = CConfigFile::getInstance()->getServer(); - if (freeSpace < server.dataUncompressedSize) + // compare with exact size of current directory + if (freeSpace && freeSpace < server.dataUncompressedSize) { QMessageBox::StandardButton res = QMessageBox::warning(this, tr("Not enough free disk space"), tr("You don't have enough free space on this disk, please make more space or choose a directory on another disk.")); return; diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 3420ef42e..47201a807 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -152,6 +152,11 @@ int main(int argc, char *argv[]) return 1; } + // init log + CLogHelper logHelper(config.getInstallationDirectory()); + + nlinfo("Launched %s", Q2C(config.getInstallerCurrentFilePath())); + #if defined(Q_OS_WIN) && !defined(_DEBUG) // under Windows, Ryzom Installer should always be copied in TEMP directory QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); @@ -159,6 +164,8 @@ int main(int argc, char *argv[]) // check if launched from TEMP directory if (step == Done && !config.getInstallerCurrentDirPath().startsWith(tempPath)) { + nlinfo("Not launched from TEMP directory"); + // try to delete all temporary installers QDir tempDir(tempPath); @@ -173,17 +180,25 @@ int main(int argc, char *argv[]) QDir dirToRemove(tempDir); dirToRemove.cd(dir); dirToRemove.removeRecursively(); + + nlinfo("Delete directory %s", Q2C(dir)); } tempPath += QString("/ryzom_installer_%1").arg(QDateTime::currentMSecsSinceEpoch()); + nlinfo("Creating directory %s", Q2C(tempPath)); + // copy installer and required files to TEMP directory if (QDir().mkdir(tempPath) && copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath)) { QString tempFile = tempPath + "/" + QFileInfo(config.getInstallerCurrentFilePath()).fileName(); + nlinfo("Launching %s", Q2C(tempFile)); + // launch copy in TEMP directory with same arguments if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0; + + nlwarning("Unable to launch %s", Q2C(tempFile)); } } #endif @@ -193,6 +208,8 @@ int main(int argc, char *argv[]) if (parser.isSet(uninstallOption)) { + nlinfo("Uninstalling..."); + SComponents components; // add all servers by default @@ -227,6 +244,8 @@ int main(int argc, char *argv[]) if (step == ShowMigrateWizard) { + nlinfo("Display migration dialog"); + CMigrateDialog dialog; if (!dialog.exec()) return 1; @@ -235,6 +254,8 @@ int main(int argc, char *argv[]) } else if (step == ShowInstallWizard) { + nlinfo("Display installation dialog"); + CInstallDialog dialog; if (!dialog.exec()) return 1; @@ -242,6 +263,8 @@ int main(int argc, char *argv[]) step = config.getInstallNextStep(); } + nlinfo("Next step is %s", Q2C(stepToString(step))); + bool restartInstaller = false; if (step != Done) @@ -254,6 +277,8 @@ int main(int argc, char *argv[]) step = config.getInstallNextStep(); + nlinfo("Last step is %s", Q2C(stepToString(step))); + if (step == LaunchInstalledInstaller) { // restart more recent installed Installer version @@ -271,6 +296,8 @@ int main(int argc, char *argv[]) if (restartInstaller) { #ifndef _DEBUG + nlinfo("Restart Installer %s", Q2C(config.getInstallerInstalledFilePath())); + #ifndef Q_OS_WIN32 // fix executable permissions under UNIX QFile::setPermissions(config.getInstallerInstalledFilePath(), QFile::permissions(config.getInstallerInstalledFilePath()) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther); diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp index 5f645042a..0aec91d09 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp @@ -147,16 +147,16 @@ void CMigrateDialog::accept() // check free disk space qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); + // shouldn't happen if (freeSpace == 0) { - QString error = qFromUtf8(NLMISC::formatErrorMessage(NLMISC::getLastError())); + int error = NLMISC::getLastError(); - QMessageBox::StandardButton res = QMessageBox::warning(this, tr("Error"), tr("Error '%1' occured when trying to check free disk space on %2.").arg(error).arg(m_dstDirectory)); - return; + nlwarning("Error '%s' (%d) occured when trying to check free disk space on %s, continue anyway", NLMISC::formatErrorMessage(error).c_str(), error, Q2C(m_dstDirectory)); } // compare with exact size of current directory - if (freeSpace < getDirectorySize(m_currentDirectory, true)) + if (freeSpace && freeSpace < getDirectorySize(m_currentDirectory, true)) { QMessageBox::StandardButton res = QMessageBox::warning(this, tr("Not enough free disk space"), tr("You don't have enough free space on this disk, please make more space or choose a directory on another disk.")); return; diff --git a/code/ryzom/tools/client/ryzom_installer/src/operation.h b/code/ryzom/tools/client/ryzom_installer/src/operation.h index 71627363e..341e93a74 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operation.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operation.h @@ -73,6 +73,8 @@ enum OperationStep Done }; +QString stepToString(OperationStep); + enum OperationType { OperationNone, diff --git a/code/ryzom/tools/client/ryzom_installer/src/stdpch.h b/code/ryzom/tools/client/ryzom_installer/src/stdpch.h index 4ebe147f0..d066915d7 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/stdpch.h +++ b/code/ryzom/tools/client/ryzom_installer/src/stdpch.h @@ -54,8 +54,10 @@ #include -#include -#include +#include "nel/misc/types_nl.h" +#include "nel/misc/debug.h" +#include "nel/misc/path.h" +#include "nel/misc/system_info.h" #endif diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index 0a31629f9..25f084726 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -563,3 +563,51 @@ CCOMHelper::~CCOMHelper() if (m_mustUninit) CoUninitialize(); #endif } + +CLogHelper::CLogHelper(const QString &logPath) +{ + // disable nldebug messages in logs in Release +#ifdef NL_RELEASE + NLMISC::DisableNLDebug = true; +#endif + + // don't create a file for the moment, we'll create it manually + NLMISC::createDebug(NULL, false); + + // ryzom_installer.Log displayer + NLMISC::CFileDisplayer *LogDisplayer = new NLMISC::CFileDisplayer(qToUtf8(logPath) + "/ryzom_installer.log", true, "DEFAULT_FD"); + NLMISC::DebugLog->addDisplayer(LogDisplayer); + NLMISC::InfoLog->addDisplayer(LogDisplayer); + NLMISC::WarningLog->addDisplayer(LogDisplayer); + NLMISC::ErrorLog->addDisplayer(LogDisplayer); + NLMISC::AssertLog->addDisplayer(LogDisplayer); + + std::string type; + +#ifdef NL_RELEASE + type = "RELEASE"; +#else + type = "DEBUG"; +#endif + + // Display installer version + nlinfo("RYZOM INSTALLER VERSION: %s (%s)", Q2C(QApplication::applicationVersion()), type.c_str()); + nlinfo("Memory: %s/%s", NLMISC::bytesToHumanReadable(NLMISC::CSystemInfo::availablePhysicalMemory()).c_str(), NLMISC::bytesToHumanReadable(NLMISC::CSystemInfo::totalPhysicalMemory()).c_str()); + nlinfo("OS: %s", NLMISC::CSystemInfo::getOS().c_str()); + nlinfo("Processor: %s", NLMISC::CSystemInfo::getProc().c_str()); +} + +CLogHelper::~CLogHelper() +{ + NLMISC::IDisplayer *LogDisplayer = NLMISC::ErrorLog->getDisplayer("DEFAULT_FD"); + + if (LogDisplayer) + { + NLMISC::DebugLog->removeDisplayer(LogDisplayer); + NLMISC::InfoLog->removeDisplayer(LogDisplayer); + NLMISC::WarningLog->removeDisplayer(LogDisplayer); + NLMISC::ErrorLog->removeDisplayer(LogDisplayer); + NLMISC::AssertLog->removeDisplayer(LogDisplayer); + delete LogDisplayer; + } +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index e3de8155b..980826a16 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -58,6 +58,8 @@ QString qFromWide(const wchar_t *str); // convert an QString to wchar_t* wchar_t* qToWide(const QString &str); +#define Q2C(x) qToUtf8(x).c_str() + // check if a shortcut already exists (the extension will be added) bool shortcutExists(const QString &shortcut); @@ -92,4 +94,12 @@ public: ~CCOMHelper(); }; +// a little helper class to init/uninit log +class CLogHelper +{ +public: + CLogHelper(const QString &logPath); + ~CLogHelper(); +}; + #endif From 9321323ba45c0d1c8689981c95187883cac6a45b Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 20 Oct 2016 13:07:56 +0200 Subject: [PATCH 8/8] Changed: Use sender() instead of member --HG-- branch : develop --- .../client/ryzom_installer/src/downloader.cpp | 65 ++++++++++++------- .../client/ryzom_installer/src/downloader.h | 1 - 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp index 19e5793ee..e74b92e89 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/downloader.cpp @@ -26,7 +26,7 @@ #define new DEBUG_NEW #endif -CDownloader::CDownloader(QObject *parent, IOperationProgressListener *listener):QObject(parent), m_listener(listener), m_manager(NULL), m_reply(NULL), m_timer(NULL), +CDownloader::CDownloader(QObject *parent, IOperationProgressListener *listener):QObject(parent), m_listener(listener), m_manager(NULL), m_timer(NULL), m_offset(0), m_size(0), m_supportsAcceptRanges(false), m_supportsContentRange(false), m_downloadAfterHead(false), m_file(NULL) { @@ -169,10 +169,10 @@ void CDownloader::getFileHead() request.setRawHeader("Range", QString("bytes=%1-").arg(m_offset).toLatin1()); } - m_reply = m_manager->head(request); + QNetworkReply *reply = m_manager->head(request); - connect(m_reply, SIGNAL(finished()), SLOT(onHeadFinished())); - connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); + connect(reply, SIGNAL(finished()), SLOT(onHeadFinished())); + connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); startTimer(); } @@ -212,12 +212,12 @@ void CDownloader::downloadFile() request.setRawHeader("Range", QString("bytes=%1-%2").arg(m_offset).arg(m_size-1).toLatin1()); } - m_reply = m_manager->get(request); + QNetworkReply *reply = m_manager->get(request); - connect(m_reply, SIGNAL(finished()), SLOT(onDownloadFinished())); - connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); - connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(onDownloadProgress(qint64, qint64))); - connect(m_reply, SIGNAL(readyRead()), SLOT(onDownloadRead())); + connect(reply, SIGNAL(finished()), SLOT(onDownloadFinished())); + connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); + connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(onDownloadProgress(qint64, qint64))); + connect(reply, SIGNAL(readyRead()), SLOT(onDownloadRead())); if (m_listener) m_listener->operationStart(); @@ -254,18 +254,27 @@ void CDownloader::onHeadFinished() { stopTimer(); - int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + QNetworkReply *reply = qobject_cast(sender()); - QString redirection = m_reply->header(QNetworkRequest::LocationHeader).toString(); + int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + QString url = reply->url().toString(); - m_size = m_reply->header(QNetworkRequest::ContentLengthHeader).toInt(); - m_lastModified = m_reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toUTC(); + QString redirection = reply->header(QNetworkRequest::LocationHeader).toString(); - QString acceptRanges = QString::fromLatin1(m_reply->rawHeader("Accept-Ranges")); - QString contentRange = QString::fromLatin1(m_reply->rawHeader("Content-Range")); + m_size = reply->header(QNetworkRequest::ContentLengthHeader).toInt(); + m_lastModified = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toUTC(); - m_reply->deleteLater(); - m_reply = NULL; + QString acceptRanges = QString::fromLatin1(reply->rawHeader("Accept-Ranges")); + QString contentRange = QString::fromLatin1(reply->rawHeader("Content-Range")); + + reply->deleteLater(); + + nlinfo("HTTP status code %d on HEAD for %s", status, Q2C(url)); + + if (!redirection.isEmpty()) + { + nlinfo("Redirected to %s", Q2C(redirection)); + } // redirection if (status == 302) @@ -374,10 +383,14 @@ void CDownloader::onHeadFinished() void CDownloader::onDownloadFinished() { - int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + QNetworkReply *reply = qobject_cast(sender()); - m_reply->deleteLater(); - m_reply = NULL; + int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + QString url = reply->url().toString(); + + reply->deleteLater(); + + nlwarning("Download finished with HTTP status code %d when downloading %s", status, Q2C(url)); closeFile(); @@ -408,6 +421,10 @@ void CDownloader::onDownloadFinished() void CDownloader::onError(QNetworkReply::NetworkError error) { + QNetworkReply *reply = qobject_cast(sender()); + + nlwarning("Network error %s (%d) when downloading %s", Q2C(reply->errorString()), error, Q2C(m_url)); + if (!m_listener) return; if (error == QNetworkReply::OperationCanceledError) @@ -422,13 +439,17 @@ void CDownloader::onDownloadProgress(qint64 current, qint64 total) if (!m_listener) return; + QNetworkReply *reply = qobject_cast(sender()); + m_listener->operationProgress(m_offset + current, m_url); // abort download - if (m_listener->operationShouldStop() && m_reply) m_reply->abort(); + if (m_listener->operationShouldStop() && reply) reply->abort(); } void CDownloader::onDownloadRead() { - if (m_file) m_file->write(m_reply->readAll()); + QNetworkReply *reply = qobject_cast(sender()); + + if (m_file && reply) m_file->write(reply->readAll()); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/downloader.h b/code/ryzom/tools/client/ryzom_installer/src/downloader.h index af8c18c9e..5430d25b6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/downloader.h +++ b/code/ryzom/tools/client/ryzom_installer/src/downloader.h @@ -76,7 +76,6 @@ protected: bool checkDownloadedFile(); QNetworkAccessManager *m_manager; - QNetworkReply *m_reply; QTimer *m_timer; QString m_url;