Merge with develop

This commit is contained in:
kervala 2016-10-20 13:08:48 +02:00
parent afc03e63ee
commit c3bcfb42b8
44 changed files with 302 additions and 184 deletions

View file

@ -422,7 +422,7 @@ namespace NLGUI
{ {
nlassert(key); nlassert(key);
nlassert(isValid()); 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); CLuaStackChecker lsc(_LuaState);
push(); push();
_LuaState->push(key); _LuaState->push(key);

View file

@ -1082,7 +1082,7 @@ NLMISC_CATEGORISED_COMMAND(nel,displayMeasures, "display hierarchical timer", "[
} }
sint depth = 0; 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(NoSort, -3)
CASE_DISPLAYMEASURES(TotalTime, -2) CASE_DISPLAYMEASURES(TotalTime, -2)

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "zone_utility.h" #include "zone_utility.h"
// //
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
@ -54,7 +54,7 @@ struct CPatchVertexInfo
uint patchIndex, uint patchIndex,
uint patchVertex, uint patchVertex,
const CVector &pos const CVector &pos
) )
: ZoneIndex(zoneIndex), : ZoneIndex(zoneIndex),
PatchIndex(patchIndex), PatchIndex(patchIndex),
PatchVertex(patchVertex), PatchVertex(patchVertex),
@ -95,7 +95,7 @@ static CZone *LoadZone(uint16 xPos, uint16 yPos, std::string zoneExt)
{ {
std::string zoneName; std::string zoneName;
::getZoneNameByCoord(xPos, yPos, zoneName); ::getZoneNameByCoord(xPos, yPos, zoneName);
std::auto_ptr<CZone> zone(new CZone); std::auto_ptr<CZone> zone(new CZone);
std::string lookedUpZoneName = CPath::lookup(zoneName + zoneExt, false, false, false); std::string lookedUpZoneName = CPath::lookup(zoneName + zoneExt, false, false, false);
if (lookedUpZoneName.empty()) return NULL; if (lookedUpZoneName.empty()) return NULL;
CIFile iF; CIFile iF;
@ -128,7 +128,7 @@ static void GetCandidateVertices(const CVector &pos,
float weldThreshold float weldThreshold
) )
{ {
dest.clear(); dest.clear();
CVector half(weldThreshold, weldThreshold, weldThreshold); CVector half(weldThreshold, weldThreshold, weldThreshold);
qg.select(pos - half, pos + half); qg.select(pos - half, pos + half);
for (TPVQuadGrid::CIterator it = qg.begin(); it != qg.end(); ++it) 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 /** Search a vertex of a patch that can be welded with the given vertex
* return -1 if none * 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) 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) static uint CheckZone(std::string middleZoneFile, float weldThreshold, float middleEdgeWeldThreshold)
{ {
uint numErrors = 0; 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) // This avoid reporting errors twice (for readability)
std::set<CPatchIdentPair> errorPairs; std::set<CPatchIdentPair> errorPairs;
@ -176,7 +176,7 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid
std::auto_ptr<CZone> zones[9]; std::auto_ptr<CZone> zones[9];
std::string zoneNames[9]; std::string zoneNames[9];
CZoneInfo zoneInfos[9]; CZoneInfo zoneInfos[9];
uint16 xPos, yPos; 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} }; 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()); nlinfo("Zones loading failed : %d", e.what());
return 0; return 0;
} }
/////////////////////////////// ///////////////////////////////
// retrieve datas from zones // // retrieve datas from zones //
/////////////////////////////// ///////////////////////////////
for (k = 0; k < 9; ++k) 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]); if (zones[k].get() != NULL) zones[k]->retrieve(zoneInfos[k]);
} }
// fill the quad grid // fill the quad grid
CAABBox zoneBBox = zones[0]->getZoneBB().getAABBox(); CAABBox zoneBBox = zones[0]->getZoneBB().getAABBox();
@ -222,7 +222,7 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid
// insert vertices in quadgrid // insert vertices in quadgrid
for (k = 0; k < 9; ++k) for (k = 0; k < 9; ++k)
{ {
for (l = 0; l < zoneInfos[k].Patchs.size(); ++l) for (l = 0; l < zoneInfos[k].Patchs.size(); ++l)
{ {
CPatchInfo &patch = zoneInfos[k].Patchs[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); CVector half(weldThreshold, weldThreshold, weldThreshold);
// yes, insert it in the tree // yes, insert it in the tree
qg.insert(pos - half, pos + half, CPatchVertexInfo(k, l, m, pos)); 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) for (l = 0; l < zoneInfos[0].Patchs.size(); ++l)
{ {
CPatchInfo &patch = zoneInfos[0].Patchs[l]; CPatchInfo &patch = zoneInfos[0].Patchs[l];
// deals with each border // deals with each border
for (m = 0; m < 4; ++m) for (m = 0; m < 4; ++m)
{ {
// if this border is said to be bound, no need to test.. // if this border is said to be bound, no need to test..
if (patch.BindEdges[m].NPatchs == 0) 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); ::GetCandidateVertices(patch.Patch.Vertices[vIndex[q]], qg, verts[q], l, 0, weldThreshold);
} }
/////////////////////////// ///////////////////////////
// 1 - 1 connectivity ? // // 1 - 1 connectivity ? //
/////////////////////////// ///////////////////////////
// If there is a patch that is present in the 2 lists, then this is a 1-1 error // 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) 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); CPatchIdentPair errPair = std::make_pair(pi1, pi2);
// //
if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? 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", 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)); errorPairs.insert(std::make_pair(pi2, pi1));
++numErrors; ++numErrors;
} }
@ -303,10 +303,10 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid
////////////////////////// //////////////////////////
// 1 - 2 connectivity ? // // 1 - 2 connectivity ? //
////////////////////////// //////////////////////////
// get the position at the middle of that border // get the position at the middle of that border
CVector middlePos = patch.Patch.eval( 0.5f * (indexToST[vIndex[0]][0] + indexToST[vIndex[1]][0]), 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 each vertex of this border
for (q = 0; q < 2 && !errorFound; ++q) 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); CPatchIdentPair errPair = std::make_pair(pi1, pi2);
// //
if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? 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", 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)); errorPairs.insert(std::make_pair(pi2, pi1));
++numErrors; ++numErrors;
} }
errorFound = true; errorFound = true;
break; break;
} }
} }
} }
if (errorFound) continue; if (errorFound) continue;
////////////////////////// //////////////////////////
// 1 - 4 connectivity ? // // 1 - 4 connectivity ? //
////////////////////////// //////////////////////////
// compute points along the border. // compute points along the border.
CVector borderPos[5]; CVector borderPos[5];
float lambda = 0.f; 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], 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]); (1.f - lambda) * indexToST[vIndex[0]][1] + lambda * indexToST[vIndex[1]][1]);
lambda += 0.25f; lambda += 0.25f;
} }
// Try to find a patch that shares 2 consecutives vertices // Try to find a patch that shares 2 consecutives vertices
for (k = 0; k < 4 && !errorFound; ++k) 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) for (p = 0; p < verts[0].size() && !errorFound; ++p)
{ {
const CPatchVertexInfo &pv = *(verts[0][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); CPatchIdentPair errPair = std::make_pair(pi1, pi2);
// //
if (std::find(errorPairs.begin(), errorPairs.end(), errPair) == errorPairs.end()) // error already displayed ? 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", 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; ++numErrors;
errorPairs.insert(std::make_pair(pi2, pi1)); errorPairs.insert(std::make_pair(pi2, pi1));
} }
errorFound = true; errorFound = true;
} }
} }
} }
} }
} }
} }
@ -406,26 +406,26 @@ static uint CheckZone(std::string middleZoneFile, float weldThreshold, float mid
//========================================================================================================================= //=========================================================================================================================
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
NLMISC::createDebug(); NLMISC::createDebug();
InfoLog->addNegativeFilter("adding the path"); InfoLog->addNegativeFilter("adding the path");
if (argc < 4) if (argc < 4)
{ {
std::string appName = CFile::getFilename(std::string(argv[0])); std::string appName = CFile::getFilename(std::string(argv[0]));
nlinfo("usage : %s <zonesDirectory><weldTheshold><middleEdgeWeldTheshold>\n", appName.empty() ? "zone_check_bind" : appName.c_str()); nlinfo("usage : %s <zonesDirectory><weldTheshold><middleEdgeWeldTheshold>\n", appName.empty() ? "zone_check_bind" : appName.c_str());
return -1; return -1;
} }
float weldThreshold, middleEdgeWeldThreshold; float weldThreshold, middleEdgeWeldThreshold;
if (::sscanf(argv[2], "%f", &weldThreshold) != 1) if (!fromString(argv[2], weldThreshold))
{ {
nlinfo("invalid weldThreshold"); nlinfo("invalid weldThreshold");
return -1; return -1;
} }
if (::sscanf(argv[3], "%f", &middleEdgeWeldThreshold) != 1) if (!fromString(argv[3], middleEdgeWeldThreshold))
{ {
nlinfo("invalid middleEdgeWeldThreshold"); nlinfo("invalid middleEdgeWeldThreshold");
return -1; return -1;
@ -442,10 +442,10 @@ int main(int argc, char* argv[])
// Filter addSearchPath // Filter addSearchPath
CPath::addSearchPath(zonePaths); CPath::addSearchPath(zonePaths);
// Contains all the zone in the directory // Contains all the zone in the directory
std::vector<std::string> zoneNames; std::vector<std::string> zoneNames;
CPath::getPathContent(zonePaths, true, false, true, zoneNames); CPath::getPathContent(zonePaths, true, false, true, zoneNames);
uint numErrors = 0; uint numErrors = 0;
@ -461,4 +461,4 @@ int main(int argc, char* argv[])
nlinfo("%d errors were found", numErrors); nlinfo("%d errors were found", numErrors);
} }

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 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) // 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].getSampleTick(),
// graphDatas.getDatas()[i].getValue()); // graphDatas.getDatas()[i].getValue());
// } // }
@ -869,7 +869,7 @@ retry_pending_command:
{ {
// output this sample // output this sample
uint32 date = startTime + uint32((buffer.Datas[i].SampleTick - startMilli)/1000); 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; lastSampleTick = buffer.Datas[i].SampleTick;
minSample = DBL_MAX; minSample = DBL_MAX;

View file

@ -1107,7 +1107,7 @@ void CBotNpc::setVisualProperties(std::string input) // AJM
// load val from tail // load val from tail
// accept 64bit hex value // accept 64bit hex value
uint64 val; 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 // can't set into mirror row until bot is spawned, so save away
if( NLMISC::nlstricmp( keyword,"VPA")==0 ) // VisualPropertyA 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; uint64 id=action;
for (uint j=0;j<8 && ((char*)&id)[j]!=0;++j) for (uint j=0;j<8 && ((char*)&id)[j]!=0;++j)
txt+=((char*)&id)[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>") NLMISC_COMMAND(setDebugHour, "set the current debug hour", "<hour>")
{ {
if (args.size() != 1) return false; if (args.size() != 1) return false;
int hour; sint hour;
if (sscanf(args[0].c_str(), "%d", &hour) != 1) return false; if (!fromString(args[0], hour)) return false;
CRyzomDate rd; CRyzomDate rd;
getRyzomDebugDate(rd); getRyzomDebugDate(rd);
rd.Time = fmodf(rd.Time, 1.f) + (float) hour; 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>") NLMISC_COMMAND(setDebugDayOfYear, "set the current debug day of year (first day has index 1)", "<day>")
{ {
if (args.size() != 1) return false; if (args.size() != 1) return false;
int day; sint day;
if (sscanf(args[0].c_str(), "%d", &day) != 1) return false; if (!fromString(args[0], day)) return false;
CRyzomDate rd; CRyzomDate rd;
getRyzomDebugDate(rd); getRyzomDebugDate(rd);
rd.Day = day - 1; // for the user, days start at '1' rd.Day = day - 1; // for the user, days start at '1'

View file

@ -1002,7 +1002,7 @@ ENTITY_VARIABLE(Money, "Money")
if (get) if (get)
{ {
value = toString("%"NL_I64"u", c->getMoney()); value = toString(c->getMoney());
} }
else else
{ {
@ -1037,7 +1037,7 @@ ENTITY_VARIABLE(Money, "Money")
c->spendMoney(val); 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) if (get)
{ {
value = toString("%"NL_I64"u", guild->getMoney()); value = toString(guild->getMoney());
} }
else else
{ {
@ -1090,7 +1090,7 @@ ENTITY_VARIABLE(MoneyGuild, "MoneyGuild")
guild->spendMoney(val); 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 ); msgout.serial( ignore );
CUnifiedNetwork::getInstance()->send("IOS", msgout); 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

@ -1618,7 +1618,7 @@ nlassert(nodeLeaf->getType() == ICDBStructNode::TEXT);
// { // {
// if( args.size() == 0 ) // if( args.size() == 0 )
// return false; // return false;
// //
// NLMEMORY::StatisticsReport( args[0].c_str(), args.size() > 1 ); // NLMEMORY::StatisticsReport( args[0].c_str(), args.size() > 1 );
// return true; // return true;
//} //}
@ -3864,7 +3864,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value","<entity i
try try
{ {
sint64 value = e->_PropertyDatabase.x_getProp(entry); 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 &) catch (const CCDBSynchronised::ECDBNotFound &)
{ {
@ -3873,7 +3873,7 @@ NLMISC_COMMAND(displayDatabaseEntry," display a database entry value","<entity i
} }
else else
{ {
log.displayNL("Unknown entity %s ",id.toString().c_str()); log.displayNL("Unknown entity %s ", id.toString().c_str());
} }
return true; return true;
} }
@ -3904,7 +3904,7 @@ NLMISC_COMMAND( db, "Display or set the value of a property in the database", "<
try try
{ {
sint64 value = e->_PropertyDatabase.x_getProp( entry ); sint64 value = e->_PropertyDatabase.x_getProp( entry );
log.displayNL( "%"NL_I64"d", value ); log.displayNL( "%" NL_I64 "d", value );
res = true; res = true;
} }
catch (const CCDBSynchronised::ECDBNotFound& ) catch (const CCDBSynchronised::ECDBNotFound& )
@ -3916,7 +3916,8 @@ NLMISC_COMMAND( db, "Display or set the value of a property in the database", "<
{ {
// Set // Set
sint64 value; sint64 value;
sscanf( args[2].c_str(), "%"NL_I64"d", &value ); fromString(args[2], value);
if ( (args.size() > 3) && (args[3]!="0") ) if ( (args.size() > 3) && (args[3]!="0") )
{ {
res = e->_PropertyDatabase.x_setPropButDontSend( entry, value ); 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); CCharacter *e = PlayerManager.getChar(id);
if( e ) if( e )
{ {
log.displayNL("displayMoney: %"NL_I64"%u", e->getMoney() ); log.displayNL("displayMoney: %" NL_I64 "%u", e->getMoney() );
} }
else else
{ {

View file

@ -1180,7 +1180,7 @@ void cbDeleteChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
CPlayer* player = PlayerManager.getPlayer( userId ); CPlayer* player = PlayerManager.getPlayer( userId );
if ( player == NULL ) 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; return;
} }

View file

@ -137,7 +137,7 @@ void CGuild::spendMoney(uint64 money)
{ {
if ( money > _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; return;
} }
@ -463,7 +463,7 @@ void CGuild::dumpGuildInfos( NLMISC::CLog & log )
getId()>>20 == IService::getInstance()->getShardId() ? "(Local)" : "(Foreign)", getId()>>20 == IService::getInstance()->getShardId() ? "(Local)" : "(Foreign)",
getName().toUtf8().c_str(), getEId().toString().c_str() ); getName().toUtf8().c_str(), getEId().toString().c_str() );
log.displayNL("\tDescription: '%s'", getDescription().toUtf8().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("\tVillage: %hu", getVillage() );
log.displayNL("\tCreation date: %u", getCreationDate() ); log.displayNL("\tCreation date: %u", getCreationDate() );
// log.displayNL("\tXP: %u", getXP() ); // log.displayNL("\tXP: %u", getXP() );
@ -471,7 +471,7 @@ void CGuild::dumpGuildInfos( NLMISC::CLog & log )
log.displayNL("\tMax bulk: %d", _Inventory->getMaxBulk() ); log.displayNL("\tMax bulk: %d", _Inventory->getMaxBulk() );
// log.displayNL("\tCharge points: %u", getChargesPoints() ); // log.displayNL("\tCharge points: %u", getChargesPoints() );
log.displayNL("\tRace: %s", EGSPD::CPeople::toString(getRace()).c_str() ); 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("\tCiv Allegiance: %s", PVP_CLAN::toString(_DeclaredCiv).c_str());
log.displayNL("\tCult Allegiance: %s", PVP_CLAN::toString(_DeclaredCult).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 ) 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; return;
} }
if ( ! _GuildInventoryView->checkMoneySession( session ) ) if ( ! _GuildInventoryView->checkMoneySession( session ) )
@ -1183,7 +1183,7 @@ void CGuild::putMoney( CCharacter * user, uint64 money, uint16 session )
if ( money > user->getMoney() ) 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; 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->getClientDBProp( args[1] );
sint64 val = guild->_DbGroup.Database.x_getProp(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) catch (const CCDBSynchronised::ECDBNotFound &e)
{ {

View file

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

View file

@ -757,7 +757,7 @@ void COutpostManager::saveAll()
} }
TTime endTime = NLMISC::CTime::getLocalTime(); 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 ); s.serialAndLog2( value, 32 );
bitsize += 32; bitsize += 32;
if ( VerboseDatabase ) 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 else
{ {
s.serialAndLog2( value, (uint)node->type() ); s.serialAndLog2( value, (uint)node->type() );
bitsize += (uint32)node->type(); bitsize += (uint32)node->type();
if ( VerboseDatabase ) 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 else
@ -571,14 +571,14 @@ void CCDBSynchronised::pushDeltaPermanent( NLMISC::CBitMemStream& s, CCDBStructN
s.serialAndLog2( value, 32 ); s.serialAndLog2( value, 32 );
bitsize += 32; bitsize += 32;
if ( VerboseDatabase ) 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 else
{ {
s.serialAndLog2( value, (uint)node->type() ); s.serialAndLog2( value, (uint)node->type() );
bitsize += (uint32)node->type(); bitsize += (uint32)node->type();
if ( VerboseDatabase ) 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 else
@ -806,7 +806,7 @@ bool CCDBSynchronised::x_setProp( ICDBStructNode * node, sint64 value, bool forc
{ {
std::string const* pname = node->getName(); std::string const* pname = node->getName();
std::string name = pname?*pname:"'Unknown'"; 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 #endif
@ -825,7 +825,7 @@ bool CCDBSynchronised::x_setProp( ICDBStructNode * node, sint64 value, bool forc
{ {
std::string const* pname = node->getName(); std::string const* pname = node->getName();
std::string name = pname?*pname:"'Unknown'"; 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 #endif
} }
@ -874,7 +874,7 @@ bool CCDBSynchronised::x_setPropButDontSend( const std::string& name, sint64 val
#ifdef TRACE_SET_VALUE #ifdef TRACE_SET_VALUE
if ( VerboseDatabase ) 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 #endif
// Set the property. // 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; uint64 NOT_TELEPORTING_FLAG= (((uint64)0x12345678)<<32)| (uint64)0x87654321;
if ( _WhoSeesMeBeforeTP != NOT_TELEPORTING_FLAG ) 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); nlwarning("INVISIBILITY (teleportCharacter) Current Coordinates :(%d, %d, %d) TP coordinates : (%d, %d, %d)", x,y,z);
} }
else else
@ -19371,7 +19371,7 @@ bool CCharacter::setGuildId( uint32 guildId )
_GuildId = guildId; _GuildId = guildId;
#ifdef HAVE_MONGO #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 #endif
return true; return true;
@ -20375,7 +20375,7 @@ void CCharacter::setIntangibleEndDate(NLMISC::TGameCycle date)
void CCharacter::setWhoSeesMeBeforeTP(const uint64 &whoSeesMe) void CCharacter::setWhoSeesMeBeforeTP(const uint64 &whoSeesMe)
{ {
uint64 NOT_TELEPORTING_FLAG= (((uint64)0x12345678)<<32)| (uint64)0x87654321; 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; _WhoSeesMeBeforeTP= whoSeesMe;
} }

View file

@ -1104,7 +1104,7 @@ NLMISC_COMMAND(follow, "follow an entity", "entityId")
uint creatorId; uint creatorId;
uint dynamicId; 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; return false;
sid.setShortId( id ); sid.setShortId( id );

View file

@ -981,7 +981,7 @@ void fillSHEET( TOutBox& outbox, TPropIndex )
TDataSetIndex compressedRow = TVPNodeServer::PrioContext.EntityIndex.getCompressedIndex(); TDataSetIndex compressedRow = TVPNodeServer::PrioContext.EntityIndex.getCompressedIndex();
uint64 value = (uint64)sheetValue | (((uint64)compressedRow) << 32); uint64 value = (uint64)sheetValue | (((uint64)compressedRow) << 32);
ap->setValue64( value ); 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 // Add row into the action
ap->packFast( outbox ); ap->packFast( outbox );
@ -1026,7 +1026,7 @@ void fillBEHAVIOUR( TOutBox& outbox, TPropIndex )
//CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_BEHAVIOUR ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_BEHAVIOUR );
DECLARE_AP(BEHAVIOUR); DECLARE_AP(BEHAVIOUR);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_NAME_STRING_ID );
DECLARE_AP(NAME_STRING_ID); DECLARE_AP(NAME_STRING_ID);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_BARS );
DECLARE_AP(BARS); DECLARE_AP(BARS);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap );
@ -1189,7 +1189,7 @@ void fillVisualPropertyABC( TOutBox& outbox, TPropIndex propIndex )
DECLARE_AP_INDEX(propIndex); DECLARE_AP_INDEX(propIndex);
CMirrorPropValueRO<TYPE_VPA> prop( TheDataset, TVPNodeServer::PrioContext.EntityIndex, propIndex-PROPERTY_VPA+DSPropertyVPA ); \ CMirrorPropValueRO<TYPE_VPA> prop( TheDataset, TVPNodeServer::PrioContext.EntityIndex, propIndex-PROPERTY_VPA+DSPropertyVPA ); \
ap->setValue64( prop() ); 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_CONTEXTUAL );
DECLARE_AP(CONTEXTUAL); DECLARE_AP(CONTEXTUAL);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_VISUAL_FX );
DECLARE_AP(VISUAL_FX); DECLARE_AP(VISUAL_FX);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_NAME_ID );
DECLARE_AP(GUILD_NAME_ID); DECLARE_AP(GUILD_NAME_ID);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_GUILD_SYMBOL );
DECLARE_AP(GUILD_SYMBOL); DECLARE_AP(GUILD_SYMBOL);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_EVENT_FACTION_ID );
DECLARE_AP(EVENT_FACTION_ID); DECLARE_AP(EVENT_FACTION_ID);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_MODE );
DECLARE_AP(PVP_MODE); DECLARE_AP(PVP_MODE);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)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 ); //CActionSint64 *ap = (CActionSint64*)CActionFactory::getInstance()->createByPropIndex( TVPNodeServer::PrioContext.Slot, PROPERTY_PVP_CLAN );
DECLARE_AP(PVP_CLAN); DECLARE_AP(PVP_CLAN);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
//CActionFactory::getInstance()->remove( (CAction*&)ap ); //CActionFactory::getInstance()->remove( (CAction*&)ap );
@ -1403,7 +1403,7 @@ void fillOWNER_PEOPLE( TOutBox& outbox, TPropIndex )
outbox.serialBitAndLog( payloadBit ); outbox.serialBitAndLog( payloadBit );
DECLARE_AP(OWNER_PEOPLE); DECLARE_AP(OWNER_PEOPLE);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
REMOVE_AP(); REMOVE_AP();
@ -1420,7 +1420,7 @@ void fillOUTPOST_INFOS( TOutBox& outbox, TPropIndex )
outbox.serialBitAndLog( payloadBit ); outbox.serialBitAndLog( payloadBit );
DECLARE_AP(OUTPOST_INFOS); DECLARE_AP(OUTPOST_INFOS);
caseFillAction( 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 ); ap->packFast( outbox );
CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap ); CFrontEndService::instance()->history()->store( TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.ClientHost->sendNumber(), ap );
REMOVE_AP(); REMOVE_AP();

View file

@ -589,7 +589,7 @@ public:
{ {
if (entry.HasValue) 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))); return (currentValue().getIndex() != *((TDataSetIndex*)&(entry.LastSent)));
} }
else else
@ -621,7 +621,7 @@ public:
if (entry.HasValue) 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 ); CMirrorPropValueRO<T> currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex );
#ifdef NL_DEBUG #ifdef NL_DEBUG
@ -661,7 +661,7 @@ public:
if (entry.HasValue) 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 ); CMirrorPropValueRO<TEntityIndex> currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex );
return (currentValue().getIndex() != *((TDataSetIndex*)&(entry.LastSent))); return (currentValue().getIndex() != *((TDataSetIndex*)&(entry.LastSent)));
@ -688,7 +688,7 @@ public:
if (entry.HasValue) 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 ); NLMISC::TGameCycle mirrorCycle = TheDataset.getChangeTimestamp( dsPropertyIndex, TVPNodeServer::PrioContext.EntityIndex );
return (mirrorCycle != entry.LastSent); 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"; lsSheet = histohasvalue ? toString( "%u", (uint32)lastsent_value ) : "NOT SENT YET";
dispDist(lsSheet,THRESHOLD_SHEET); dispDist(lsSheet,THRESHOLD_SHEET);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_BEHAVIOUR, histohasvalue ).LastSent; 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); dispDist(lsBehav,THRESHOLD_BEHAVIOUR);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_NAME_STRING_ID, histohasvalue ).LastSent; lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_NAME_STRING_ID, histohasvalue ).LastSent;
lsName = histohasvalue ? toString( "%u", (uint32)lastsent_value ) : "NOT SENT YET"; 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"; lsMode = histohasvalue ? toString( "%hu", (uint32)lastsent_value ) : "NOT SENT YET";
dispDist(lsMode,THRESHOLD_MODE); dispDist(lsMode,THRESHOLD_MODE);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPA, histohasvalue ).LastSent; 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); dispDist(lsVPA,THRESHOLD_VPA);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPB, histohasvalue ).LastSent; 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); dispDist(lsVPB,THRESHOLD_VPB);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_VPC, histohasvalue ).LastSent; 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); dispDist(lsVPC,THRESHOLD_VPC);
lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_ENTITY_MOUNTED_ID, histohasvalue ).LastSent; lastsent_value = history->getPropertyEntry( optClientId, optSlot, PROPERTY_ENTITY_MOUNTED_ID, histohasvalue ).LastSent;
lsMount = histohasvalue ? toString( "%d", (uint32)lastsent_value ) : "NOT SENT YET"; 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); 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( "| Target %d \t %s", target, lsTarget.c_str() );
log->displayNL( "| Mode %hu \t %s", (uint8)PV(PROPERTY_MODE), lsMode.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( "| 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( "| 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( "| VPC %" NL_I64 "u \t %s", PV(PROPERTY_VPC), lsVPC.c_str() );
log->displayNL( "| Mount %d \t %s", mount, lsMount.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( "| Rider %d \t \t %s", rider, lsRider.c_str() );
log->displayNL( "| Contextual %hu \t %s", (uint16)PV(PROPERTY_CONTEXTUAL), lsContextual.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 ); // pos2x = getAbsoluteCoordinateFrom64( vlastposx );
// pos2y = getAbsoluteCoordinateFrom64( vlastposy ); // 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 /*#ifdef NL_DEBUG
TCoord d = (TCoord)(abs(pos1x-pos2x) + abs(pos1y-pos2y)); TCoord d = (TCoord)(abs(pos1x-pos2x) + abs(pos1y-pos2y));
if ( d < 0 ) if ( d < 0 )
@ -757,7 +757,7 @@ NLMISC_COMMAND( displayEntityInfoById, "Display the properties of an entity, by
uint type; uint type;
uint creatorId; uint creatorId;
uint dynamicId; 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; return false;
eid.setShortId( id ); eid.setShortId( id );
eid.setType( type ); eid.setType( type );

View file

@ -602,7 +602,7 @@ NLMISC_COMMAND(trackEntity, "get track of an entity position", "id")
uint creatorId; uint creatorId;
uint dynamicId; 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; return false;
eid.setShortId( id ); eid.setShortId( id );

View file

@ -328,7 +328,7 @@ void CWorldEntity::createPrimitive(NLPACS::UMoveContainer *pMoveContainer, uint8
return; return;
} }
primitive->UserData = ((uint64)(Index.getIndex()) << 16); 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->setPrimitiveType( UMovePrimitive::_2DOrientedCylinder );
primitive->setReactionType( UMovePrimitive::Slide ); primitive->setReactionType( UMovePrimitive::Slide );
primitive->setTriggerType( UMovePrimitive::NotATrigger ); primitive->setTriggerType( UMovePrimitive::NotATrigger );

View file

@ -572,7 +572,7 @@ void CWorldPositionManager::processPacsTriggers(UMoveContainer *moveContainer)
uint64 trigger = info.Object0; uint64 trigger = info.Object0;
uint64 entity = info.Object1; 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) if ((entity&0xffff) != 0)
swap(trigger, entity); swap(trigger, entity);

View file

@ -115,7 +115,7 @@ static void cbSyncFromMaster(CMessage& msgin, const std::string &serviceName, TS
CTickProxy::setGameCycle( gameCycle ); CTickProxy::setGameCycle( gameCycle );
//nldebug( "TCK-%u: Master Sync", gameCycle ); //nldebug( "TCK-%u: Master Sync", gameCycle );
//time_t t; time( &t ); //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 // user callback
onSync(); onSync();
@ -257,7 +257,7 @@ void CTickProxy::receiveTockFromClient( CMessage& msgin, TServiceId senderId, bo
//nldebug( "TCK-%u: %hu tocking", getGameCycle(), senderId ); //nldebug( "TCK-%u: %hu tocking", getGameCycle(), senderId );
//time_t t; time( &t ); //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; ++_NbTocked;
_TockedServices.push_back( senderId ); _TockedServices.push_back( senderId );
@ -276,7 +276,7 @@ void CTickProxy::masterTickUpdate( TServiceId serviceId )
//nldebug( "TCK-%u: Master Tick", getGameCycle() ); //nldebug( "TCK-%u: Master Tick", getGameCycle() );
//time_t t; time( &t ); //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 ); //nldebug( "--GC-%u-->", _GameCycle );
@ -298,7 +298,7 @@ void CTickProxy::sendSyncToClient( TServiceId serviceId )
CUnifiedNetwork::getInstance()->send( serviceId, msgout ); CUnifiedNetwork::getInstance()->send( serviceId, msgout );
//nldebug( "TCK-%u: Sync %hu", getGameCycle(), serviceId ); //nldebug( "TCK-%u: Sync %hu", getGameCycle(), serviceId );
//time_t t; time( &t ); //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() void CTickProxy::sendSyncs()
@ -313,7 +313,7 @@ void CTickProxy::sendSyncs()
CUnifiedNetwork::getInstance()->send( (*its), msgout ); CUnifiedNetwork::getInstance()->send( (*its), msgout );
//nldebug( "TCK-%u: Sync %hu", getGameCycle(), *its ); //nldebug( "TCK-%u: Sync %hu", getGameCycle(), *its );
//time_t t; time( &t ); //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 ); //nldebug( "TCK-%u: Tick %hu", getGameCycle(), *its );
//time_t t; time( &t ); //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" ); // nldebug( "Now expecting local tocks" );
State = ExpectingLocalTocks; State = ExpectingLocalTocks;
@ -391,7 +391,7 @@ void CTickProxy::sendTockBack( TServiceId serviceId )
nlwarning( "Tocked master twice in the same tick!" ); nlwarning( "Tocked master twice in the same tick!" );
prev = getGameCycle(); prev = getGameCycle();
//time_t t; time( &t ); //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); // send to PDS alloc(table, row, key);
if (PDVerbose) 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); CDbMessage& msg = nextMessage((uint8)table, row);
msg.allocRow(key); 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); // send to PDS alloc(table, row, key);
if (PDVerbose) 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); CDbMessage& msg = nextMessage((uint8)table, row);
msg.allocRow(key, id); msg.allocRow(key, id);
@ -857,7 +857,7 @@ void CPDSLib::notifyFetchFailure(NLMISC::IStream &f)
if (table >= _FetchFailures.size() || _FetchFailures[table] == NULL) 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; return;
} }
@ -947,14 +947,14 @@ uint CPDSLib::getMessageQueueSize()
void CPDSLib::erase(TTableIndex table, uint64 key) void CPDSLib::erase(TTableIndex table, uint64 key)
{ {
if (PDVerbose) 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 // Load a row and its dependent rows from a mapped table
void CPDSLib::load(TTableIndex table, uint64 key) void CPDSLib::load(TTableIndex table, uint64 key)
{ {
if (PDVerbose) 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) if (!_UsePDS)
{ {

View file

@ -247,7 +247,7 @@ void CDbMessage::getHRContent(const CDBDescriptionParser& description, std::stri
if (getTable() >= db.Tables.size()) if (getTable() >= db.Tables.size())
return; return;
const CTableNode& table = db.Tables[getTable()]; 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; break;

View file

@ -642,7 +642,7 @@ inline bool CRowMapper::map(TKey key, const RY_PDS::CObjectIndex& index)
if (_KeyMap.find(key) != _KeyMap.end()) 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; return false;
} }
@ -678,7 +678,7 @@ inline RY_PDS::CObjectIndex CRowMapper::get(TKey key) const
if (it == _KeyMap.end()) 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(); return RY_PDS::CObjectIndex::null();
} }
@ -699,7 +699,7 @@ inline bool CRowMapper::unmap(TKey key)
if (it == _KeyMap.end()) 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; return false;
} }

View file

@ -789,11 +789,11 @@ bool CTableBuffer::processRow(CAccessor& accessor)
// already mapped // already mapped
if (!RY_PDS::ResolveDoubleMappedRows) 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; 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) if (RY_PDS::ResolveDoubleMappedKeepOlder)
{ {
@ -932,7 +932,7 @@ bool CTableBuffer::mapRow(const RY_PDS::CObjectIndex &index, uint64 key)
if (!_RowMapper.map(key, index)) 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; return false;
} }
@ -971,7 +971,7 @@ bool CTableBuffer::unmapRow(const RY_PDS::CObjectIndex &index, uint64 key)
if (!_RowMapper.unmap(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; return false;
} }
@ -980,7 +980,7 @@ bool CTableBuffer::unmapRow(const RY_PDS::CObjectIndex &index, uint64 key)
if (header->getKey() != 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); header->setKey(0);

View file

@ -395,7 +395,7 @@ bool CDbManager::mapRow(TDatabaseId id, const RY_PDS::CObjectIndex &index, uint6
CDatabase* db = getDatabase(id); CDatabase* db = getDatabase(id);
if (db == NULL) 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; return false;
} }
@ -415,7 +415,7 @@ bool CDbManager::unmapRow(TDatabaseId id, RY_PDS::TTableIndex tableIndex, uint64
CDatabase* db = getDatabase(id); CDatabase* db = getDatabase(id);
if (db == NULL) 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; 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; RY_PDS::TRowIndex rowId;
NLMISC::fromString(args[2], rowId); NLMISC::fromString(args[2], rowId);
uint64 key; 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); 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); NLMISC::fromString(args[0], databaseId);
const std::string& tableName = args[1]; const std::string& tableName = args[1];
uint64 key; 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); 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 (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()); log.displayNL("id '%s' is not recognized as an EntityId, an ObjectIndex nor a 64 bits raw key", args[1].c_str());
return false; return false;

View file

@ -129,7 +129,7 @@ public:
void display(NLMISC::CLog* log = NLMISC::InfoLog) 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("%.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()); 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] == '$') if (path[node].Name[0] == '$')
{ {
uint64 key; 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()); PDS_WARNING("getValue(): unable to select mapped row '%s'", path[node].Name.c_str());
return ""; return "";
@ -575,7 +575,7 @@ bool CDatabase::mapRow(const RY_PDS::CObjectIndex &index, uint64 key)
bool success = table->mapRow(index, key); bool success = table->mapRow(index, key);
if (success) 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; return success;
} }
@ -605,7 +605,7 @@ bool CDatabase::unmapRow(RY_PDS::TTableIndex tableIndex, uint64 key)
bool success = table->unmapRow(key); bool success = table->unmapRow(key);
if (success) if (success)
PDS_FULL_DEBUG("unmapped '%016"NL_I64"X' successfully", key); PDS_FULL_DEBUG("unmapped '%016" NL_I64 "X' successfully", key);
return success; return success;
} }
@ -890,7 +890,7 @@ bool CDatabase::set(RY_PDS::TTableIndex table, RY_PDS::TRowIndex row, RY_PDS::TC
case PDS_sint64: case PDS_sint64:
{ {
uint64 data; 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); return set(table, row, column, sizeof(data), &data);
} }
break; break;

View file

@ -268,7 +268,7 @@ void CTable::displayRow(RY_PDS::TRowIndex row, NLMISC::CLog* log, bool displayHe
(rowaccess.mapped() ? ", mapped" : ""), (rowaccess.mapped() ? ", mapped" : ""),
(rowaccess.dirty() ? ", dirty" : "")); (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) if (displayHeader)
{ {
@ -495,11 +495,11 @@ bool CTable::mapRow(const RY_PDS::CObjectIndex &index, uint64 key)
if (!_TableBuffer.mapRow(index, 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; 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; return true;
} }
@ -535,11 +535,11 @@ bool CTable::unmapRow(uint64 key)
if (!_TableBuffer.unmapRow(index, 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; 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; return true;
} }

View file

@ -418,7 +418,7 @@ void CTickService::checkTockReceived()
_TickSendTime = oldTime + dt; _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 // broadcast the tick
broadcastTick(); broadcastTick();

View file

@ -26,7 +26,7 @@
#define new DEBUG_NEW #define new DEBUG_NEW
#endif #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_offset(0), m_size(0), m_supportsAcceptRanges(false), m_supportsContentRange(false),
m_downloadAfterHead(false), m_file(NULL) m_downloadAfterHead(false), m_file(NULL)
{ {
@ -169,10 +169,10 @@ void CDownloader::getFileHead()
request.setRawHeader("Range", QString("bytes=%1-").arg(m_offset).toLatin1()); 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(reply, SIGNAL(finished()), SLOT(onHeadFinished()));
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError)));
startTimer(); startTimer();
} }
@ -212,12 +212,12 @@ void CDownloader::downloadFile()
request.setRawHeader("Range", QString("bytes=%1-%2").arg(m_offset).arg(m_size-1).toLatin1()); 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(reply, SIGNAL(finished()), SLOT(onDownloadFinished()));
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError))); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError)));
connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(onDownloadProgress(qint64, qint64))); connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(onDownloadProgress(qint64, qint64)));
connect(m_reply, SIGNAL(readyRead()), SLOT(onDownloadRead())); connect(reply, SIGNAL(readyRead()), SLOT(onDownloadRead()));
if (m_listener) m_listener->operationStart(); if (m_listener) m_listener->operationStart();
@ -254,24 +254,35 @@ void CDownloader::onHeadFinished()
{ {
stopTimer(); 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(); QString redirection = reply->header(QNetworkRequest::LocationHeader).toString();
m_lastModified = m_reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toUTC();
QString acceptRanges = QString::fromLatin1(m_reply->rawHeader("Accept-Ranges")); m_size = reply->header(QNetworkRequest::ContentLengthHeader).toInt();
QString contentRange = QString::fromLatin1(m_reply->rawHeader("Content-Range")); m_lastModified = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toUTC();
m_reply->deleteLater(); QString acceptRanges = QString::fromLatin1(reply->rawHeader("Accept-Ranges"));
m_reply = NULL; 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 // redirection
if (status == 302) if (status == 302)
{ {
if (redirection.isEmpty()) if (redirection.isEmpty())
{ {
nlwarning("No redirection defined");
if (m_listener) m_listener->operationFail(tr("Redirection URL is not defined")); if (m_listener) m_listener->operationFail(tr("Redirection URL is not defined"));
return; return;
} }
@ -298,6 +309,8 @@ void CDownloader::onHeadFinished()
if (!m_supportsAcceptRanges && acceptRanges == "bytes") if (!m_supportsAcceptRanges && acceptRanges == "bytes")
{ {
nlinfo("Server supports resume for %s", Q2C(url));
// server supports resume, part 1 // server supports resume, part 1
m_supportsAcceptRanges = true; m_supportsAcceptRanges = true;
@ -309,6 +322,7 @@ void CDownloader::onHeadFinished()
// server doesn't support resume or // server doesn't support resume or
// we requested range, but server always returns 200 // we requested range, but server always returns 200
// download from the beginning // download from the beginning
nlwarning("Server doesn't support resume, download %s from the beginning", Q2C(url));
} }
// we requested with a range // we requested with a range
@ -327,10 +341,12 @@ void CDownloader::onHeadFinished()
// update offset and size // update offset and size
if (m_listener) m_listener->operationInit(m_offset, m_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 else
{ {
qDebug() << "Unable to parse"; nlwarning("Unable to parse %s", Q2C(contentRange));
} }
} }
@ -367,10 +383,14 @@ void CDownloader::onHeadFinished()
void CDownloader::onDownloadFinished() void CDownloader::onDownloadFinished()
{ {
int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
m_reply->deleteLater(); int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
m_reply = NULL; QString url = reply->url().toString();
reply->deleteLater();
nlwarning("Download finished with HTTP status code %d when downloading %s", status, Q2C(url));
closeFile(); closeFile();
@ -401,6 +421,10 @@ void CDownloader::onDownloadFinished()
void CDownloader::onError(QNetworkReply::NetworkError error) 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 (!m_listener) return;
if (error == QNetworkReply::OperationCanceledError) if (error == QNetworkReply::OperationCanceledError)
@ -415,13 +439,17 @@ void CDownloader::onDownloadProgress(qint64 current, qint64 total)
if (!m_listener) return; if (!m_listener) return;
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
m_listener->operationProgress(m_offset + current, m_url); m_listener->operationProgress(m_offset + current, m_url);
// abort download // abort download
if (m_listener->operationShouldStop() && m_reply) m_reply->abort(); if (m_listener->operationShouldStop() && reply) reply->abort();
} }
void CDownloader::onDownloadRead() 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(); bool checkDownloadedFile();
QNetworkAccessManager *m_manager; QNetworkAccessManager *m_manager;
QNetworkReply *m_reply;
QTimer *m_timer; QTimer *m_timer;
QString m_url; QString m_url;

View file

@ -132,17 +132,18 @@ void CInstallDialog::accept()
// check free disk space // check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
// shouldn't happen
if (freeSpace == 0) 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)); 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));
return;
} }
const CServer &server = CConfigFile::getInstance()->getServer(); 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.")); 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; return;

View file

@ -152,6 +152,11 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
// init log
CLogHelper logHelper(config.getInstallationDirectory());
nlinfo("Launched %s", Q2C(config.getInstallerCurrentFilePath()));
#if defined(Q_OS_WIN) && !defined(_DEBUG) #if defined(Q_OS_WIN) && !defined(_DEBUG)
// under Windows, Ryzom Installer should always be copied in TEMP directory // under Windows, Ryzom Installer should always be copied in TEMP directory
QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
@ -159,6 +164,8 @@ int main(int argc, char *argv[])
// check if launched from TEMP directory // check if launched from TEMP directory
if (step == Done && !config.getInstallerCurrentDirPath().startsWith(tempPath)) if (step == Done && !config.getInstallerCurrentDirPath().startsWith(tempPath))
{ {
nlinfo("Not launched from TEMP directory");
// try to delete all temporary installers // try to delete all temporary installers
QDir tempDir(tempPath); QDir tempDir(tempPath);
@ -173,17 +180,25 @@ int main(int argc, char *argv[])
QDir dirToRemove(tempDir); QDir dirToRemove(tempDir);
dirToRemove.cd(dir); dirToRemove.cd(dir);
dirToRemove.removeRecursively(); dirToRemove.removeRecursively();
nlinfo("Delete directory %s", Q2C(dir));
} }
tempPath += QString("/ryzom_installer_%1").arg(QDateTime::currentMSecsSinceEpoch()); tempPath += QString("/ryzom_installer_%1").arg(QDateTime::currentMSecsSinceEpoch());
nlinfo("Creating directory %s", Q2C(tempPath));
// copy installer and required files to TEMP directory // copy installer and required files to TEMP directory
if (QDir().mkdir(tempPath) && copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath)) if (QDir().mkdir(tempPath) && copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath))
{ {
QString tempFile = tempPath + "/" + QFileInfo(config.getInstallerCurrentFilePath()).fileName(); QString tempFile = tempPath + "/" + QFileInfo(config.getInstallerCurrentFilePath()).fileName();
nlinfo("Launching %s", Q2C(tempFile));
// launch copy in TEMP directory with same arguments // launch copy in TEMP directory with same arguments
if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0; if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0;
nlwarning("Unable to launch %s", Q2C(tempFile));
} }
} }
#endif #endif
@ -193,6 +208,8 @@ int main(int argc, char *argv[])
if (parser.isSet(uninstallOption)) if (parser.isSet(uninstallOption))
{ {
nlinfo("Uninstalling...");
SComponents components; SComponents components;
// add all servers by default // add all servers by default
@ -227,6 +244,8 @@ int main(int argc, char *argv[])
if (step == ShowMigrateWizard) if (step == ShowMigrateWizard)
{ {
nlinfo("Display migration dialog");
CMigrateDialog dialog; CMigrateDialog dialog;
if (!dialog.exec()) return 1; if (!dialog.exec()) return 1;
@ -235,6 +254,8 @@ int main(int argc, char *argv[])
} }
else if (step == ShowInstallWizard) else if (step == ShowInstallWizard)
{ {
nlinfo("Display installation dialog");
CInstallDialog dialog; CInstallDialog dialog;
if (!dialog.exec()) return 1; if (!dialog.exec()) return 1;
@ -242,6 +263,8 @@ int main(int argc, char *argv[])
step = config.getInstallNextStep(); step = config.getInstallNextStep();
} }
nlinfo("Next step is %s", Q2C(stepToString(step)));
bool restartInstaller = false; bool restartInstaller = false;
if (step != Done) if (step != Done)
@ -254,6 +277,8 @@ int main(int argc, char *argv[])
step = config.getInstallNextStep(); step = config.getInstallNextStep();
nlinfo("Last step is %s", Q2C(stepToString(step)));
if (step == LaunchInstalledInstaller) if (step == LaunchInstalledInstaller)
{ {
// restart more recent installed Installer version // restart more recent installed Installer version
@ -271,6 +296,8 @@ int main(int argc, char *argv[])
if (restartInstaller) if (restartInstaller)
{ {
#ifndef _DEBUG #ifndef _DEBUG
nlinfo("Restart Installer %s", Q2C(config.getInstallerInstalledFilePath()));
#ifndef Q_OS_WIN32 #ifndef Q_OS_WIN32
// fix executable permissions under UNIX // fix executable permissions under UNIX
QFile::setPermissions(config.getInstallerInstalledFilePath(), QFile::permissions(config.getInstallerInstalledFilePath()) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther); 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 // check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
// shouldn't happen
if (freeSpace == 0) 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)); 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));
return;
} }
// compare with exact size of current directory // 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.")); 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; return;

View file

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

View file

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

View file

@ -563,3 +563,51 @@ CCOMHelper::~CCOMHelper()
if (m_mustUninit) CoUninitialize(); if (m_mustUninit) CoUninitialize();
#endif #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* // convert an QString to wchar_t*
wchar_t* qToWide(const QString &str); wchar_t* qToWide(const QString &str);
#define Q2C(x) qToUtf8(x).c_str()
// check if a shortcut already exists (the extension will be added) // check if a shortcut already exists (the extension will be added)
bool shortcutExists(const QString &shortcut); bool shortcutExists(const QString &shortcut);
@ -92,4 +94,12 @@ public:
~CCOMHelper(); ~CCOMHelper();
}; };
// a little helper class to init/uninit log
class CLogHelper
{
public:
CLogHelper(const QString &logPath);
~CLogHelper();
};
#endif #endif