Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2016-10-20 13:08:48 +02:00
commit 2e7af6ab0d
44 changed files with 302 additions and 184 deletions

View file

@ -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);

View file

@ -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)

View file

@ -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;

View file

@ -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
{

View file

@ -501,7 +501,7 @@ retry_pending_command:
//
// for (uint i=0; i<graphDatas.getDatas().size(); ++i)
// {
// nldebug(" At %10"NL_I64"u %f",
// nldebug(" At %10" NL_I64 "u %f",
// graphDatas.getDatas()[i].getSampleTick(),
// graphDatas.getDatas()[i].getValue());
// }
@ -869,7 +869,7 @@ retry_pending_command:
{
// output this sample
uint32 date = startTime + uint32((buffer.Datas[i].SampleTick - startMilli)/1000);
ret.push_back(toString("%u : %"NL_I64"u : %f %f %f", date, buffer.Datas[i].SampleTick, minSample, meanSample/nbMergedSample, maxSample));
ret.push_back(toString("%u : %" NL_I64 "u : %f %f %f", date, buffer.Datas[i].SampleTick, minSample, meanSample/nbMergedSample, maxSample));
lastSampleTick = buffer.Datas[i].SampleTick;
minSample = DBL_MAX;

View file

@ -1107,7 +1107,7 @@ void CBotNpc::setVisualProperties(std::string input) // AJM
// load val from tail
// accept 64bit hex value
uint64 val;
sscanf( tail.c_str(), "%"NL_I64"x", &val );
sscanf( tail.c_str(), "%" NL_I64 "x", &val );
// can't set into mirror row until bot is spawned, so save away
if( NLMISC::nlstricmp( keyword,"VPA")==0 ) // VisualPropertyA

View file

@ -148,7 +148,7 @@ void CAISActions::execute(uint64 action,const std::vector <CAIActions::CArg> &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());
}

View file

@ -3122,8 +3122,8 @@ static void setRyzomDebugDate(CRyzomDate &rd)
NLMISC_COMMAND(setDebugHour, "set the current debug hour", "<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", "<hour>")
NLMISC_COMMAND(setDebugDayOfYear, "set the current debug day of year (first day has index 1)", "<day>")
{
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'

View file

@ -1002,7 +1002,7 @@ ENTITY_VARIABLE(Money, "Money")
if (get)
{
value = toString("%"NL_I64"u", c->getMoney());
value = toString(c->getMoney());
}
else
{
@ -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());
}
}
@ -1054,7 +1054,7 @@ ENTITY_VARIABLE(MoneyGuild, "MoneyGuild")
if (get)
{
value = toString("%"NL_I64"u", guild->getMoney());
value = toString(guild->getMoney());
}
else
{
@ -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());
}
}

View file

@ -3864,7 +3864,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value","<entity i
try
{
sint64 value = e->_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 &)
{
@ -3873,7 +3873,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value","<entity i
}
else
{
log.displayNL("Unknown entity %s ",id.toString().c_str());
log.displayNL("Unknown entity %s ", id.toString().c_str());
}
return true;
}
@ -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& )
@ -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 );
@ -4005,7 +4006,7 @@ NLMISC_COMMAND(displayMoney," display_seed","<entity id(id:type:crea:dyn)>")
CCharacter *e = PlayerManager.getChar(id);
if( e )
{
log.displayNL("displayMoney: %"NL_I64"%u", e->getMoney() );
log.displayNL("displayMoney: %" NL_I64 "%u", e->getMoney() );
}
else
{

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)
{

View file

@ -1011,7 +1011,7 @@ NLMISC_COMMAND(getMoney, "get money of player", "<uid>")
{
GET_ACTIVE_CHARACTER
string value = toString("%"NL_I64"u", c->getMoney());
string value = toString(c->getMoney());
log.displayNL(value.c_str());

View file

@ -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));
}
//----------------------------------------------------------------------------

View file

@ -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.

View file

@ -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;
}

View file

@ -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 );

View file

@ -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<TYPE_VPA> 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();

View file

@ -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<T> 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<TEntityIndex> 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);

View file

@ -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() );

View file

@ -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 );

View file

@ -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 );

View file

@ -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 );

View file

@ -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);

View file

@ -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() );
}

View file

@ -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)
{

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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);
@ -1217,7 +1217,7 @@ NLMISC_COMMAND(dumpToXml, "dump the content of an object into an xml file", "<da
if (id == NLMISC::CEntityId::Unknown)
{
if (sscanf(args[1].c_str(), "%"NL_I64"u", &key) != 1)
if (!fromString(args[1], key))
{
log.displayNL("id '%s' is not recognized as an EntityId, an ObjectIndex nor a 64 bits raw key", args[1].c_str());
return false;

View file

@ -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());
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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();

View file

@ -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,24 +254,35 @@ void CDownloader::onHeadFinished()
{
stopTimer();
int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
QNetworkReply *reply = qobject_cast<QNetworkReply*>(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)
{
if (redirection.isEmpty())
{
nlwarning("No redirection defined");
if (m_listener) m_listener->operationFail(tr("Redirection URL is not defined"));
return;
}
@ -298,6 +309,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 +322,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 +341,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));
}
}
@ -367,10 +383,14 @@ void CDownloader::onHeadFinished()
void CDownloader::onDownloadFinished()
{
int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
QNetworkReply *reply = qobject_cast<QNetworkReply*>(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();
@ -401,6 +421,10 @@ void CDownloader::onDownloadFinished()
void CDownloader::onError(QNetworkReply::NetworkError error)
{
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
nlwarning("Network error %s (%d) when downloading %s", Q2C(reply->errorString()), error, Q2C(m_url));
if (!m_listener) return;
if (error == QNetworkReply::OperationCanceledError)
@ -415,13 +439,17 @@ void CDownloader::onDownloadProgress(qint64 current, qint64 total)
if (!m_listener) return;
QNetworkReply *reply = qobject_cast<QNetworkReply*>(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<QNetworkReply*>(sender());
if (m_file && reply) m_file->write(reply->readAll());
}

View file

@ -76,7 +76,6 @@ protected:
bool checkDownloadedFile();
QNetworkAccessManager *m_manager;
QNetworkReply *m_reply;
QTimer *m_timer;
QString m_url;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -73,6 +73,8 @@ enum OperationStep
Done
};
QString stepToString(OperationStep);
enum OperationType
{
OperationNone,

View file

@ -54,8 +54,10 @@
#include <string>
#include <nel/misc/types_nl.h>
#include <nel/misc/config_file.h>
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/misc/system_info.h"
#endif

View file

@ -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;
}
}

View file

@ -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