本文整理汇总了C++中nlmisc::CLog::displayNL方法的典型用法代码示例。如果您正苦于以下问题:C++ CLog::displayNL方法的具体用法?C++ CLog::displayNL怎么用?C++ CLog::displayNL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::CLog
的用法示例。
在下文中一共展示了CLog::displayNL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CDirectoryRateStat::display(NLMISC::CLog& log)
{
uint pathsize = 0;
TDirectoryMap::iterator first = _DirectoryMap.begin(), last = _DirectoryMap.end();
for (; first != last; ++first)
if ((*first).first.size() > pathsize)
pathsize = (uint)(*first).first.size();
NLMISC::TTime limit = NLMISC::CTime::getLocalTime()-60*1000;
std::string format = "%-"+NLMISC::toString(pathsize)+"s %6s %10s %6s %10s";
log.displayNL(format.c_str(), "directory", "rdfile", "read", "wrfile", "write");
for (first=_DirectoryMap.begin(); first != last; ++first)
{
(*first).second.updateTime(limit);
uint64 rdrate = (*first).second.ReadBytes/60;
uint64 wrrate = (*first).second.WrittenBytes/60;
log.displayNL(format.c_str(),
(*first).first.c_str(),
NLMISC::toString((*first).second.ReadFiles).c_str(),
(NLMISC::bytesToHumanReadable(uint32(rdrate))+"/s").c_str(),
NLMISC::toString((*first).second.WrittenFiles).c_str(),
(NLMISC::bytesToHumanReadable(uint32(wrrate))+"/s").c_str());
}
}
示例2: dump
void CFileReceiver::dump(NLMISC::CLog& log) const
{
log.displayNL("-----------------------------------");
log.displayNL("File requests");
log.displayNL("-----------------------------------");
for (TFileRequests::const_iterator fit= _FileRequests.begin(); fit!= _FileRequests.end(); ++fit)
{
SFileRequest& request= *(*fit);
log.displayNL("- File: '%s' %s (%d..%d/%d)",
request.FileName.c_str(),
(request.Emitter==NULL)? "No emitter": request.Emitter->getModuleName().c_str(),
request.DataSoFar.size(),
request.TotalDataRequested,
request.ExpectedFileSize );
}
log.displayNL("-----------------------------------");
log.displayNL("Connected proxies");
log.displayNL("-----------------------------------");
for (TProxies::const_iterator pit= _Proxies.begin(); pit!= _Proxies.end(); ++pit)
{
log.displayNL("- Repository %s (%d files): Current Request: %s",
pit->second.Proxy->getModuleName().c_str(),
pit->second.FileInfo.size(),
(pit->second.CurrentRequest==NULL)? "None": pit->second.CurrentRequest->FileName.c_str());
}
log.displayNL("-----------------------------------");
}
示例3: dumpBuilding
//----------------------------------------------------------------------------
void CBuildingPhysicalPlayer::dumpBuilding(NLMISC::CLog & log) const
{
log.displayNL("<BUILDING_DUMP> CBuildingPhysicalPlayer");
log.displayNL("Name: %s, alias: %s", _Name.c_str(), CPrimitivesParser::aliasToString( _Alias ).c_str());
for (uint i = 0; i < _UsersInside.size(); i++)
{
const TDataSetRow rowId = _UsersInside[i];
CCharacter * c = PlayerManager.getChar( rowId );
if ( !c )
{
log.displayNL("\tError: cannot find character with row id: %s", rowId.toString().c_str());
continue;
}
const string charName = c->getName().toUtf8();
const string charEId = c->getId().toString();
CMirrorPropValueRO<TYPE_CELL> mirrorCell(TheDataset, rowId, DSPropertyCELL);
const sint32 cell = mirrorCell;
IRoomInstance * room = CBuildingManager::getInstance()->getRoomInstanceFromCell( cell );
if ( !room )
{
log.displayNL("\tError: character %s %s is in cell %d but no room was found", charName.c_str(), charEId.c_str(), cell);
continue;
}
CRoomInstancePlayer * playerRoom = dynamic_cast<CRoomInstancePlayer *>(room);
if ( !playerRoom )
{
log.displayNL("\tError: character %s %s is in cell %d but room is not a player room but a %s",
charName.c_str(), charEId.c_str(), cell, room->getRoomDescription().c_str()
);
continue;
}
log.displayNL("\tCharacter %s %s is in cell %d, room desc: %s",
charName.c_str(), charEId.c_str(), cell, room->getRoomDescription().c_str()
);
}
for (uint i = 0; i < _Players.size(); i++)
{
CEntityId id = _Players[i];
CCharacter * c = PlayerManager.getChar( id );
if ( !c )
{
log.displayNL("\tError: cannot find character with eid: %s", id.toString().c_str());
continue;
}
const string charName = c->getName().toUtf8();
const string charEId = c->getId().toString();
log.displayNL("\t> Player registered in building at index %u: %s %s", i, charName.c_str(), charEId.c_str());
}
}
示例4: receiveTockFromClient
void CTickProxy::receiveTockFromClient( CMessage& msgin, TServiceId senderId, bool real )
{
// Receive measures of client service
TimeMeasures.ServiceMeasures.push_back( CServiceGameCycleTimeMeasure() );
CServiceGameCycleTimeMeasure& stm = TimeMeasures.ServiceMeasures.back();
stm.ClientServiceId = senderId;
if ( real )
{
stm.ServiceMeasure[TickTockInterval] = accTimeToMs( getAccurateTime() - _BeginOfTickTime );
msgin.serial( stm.ServiceMeasure[TickUpdateDuration] );
msgin.serial( stm.ServiceMeasure[PrevProcessMirrorUpdateDuration] );
msgin.serial( stm.ServiceMeasure[PrevReceiveMsgsViaMirrorDuration] );
msgin.serial( stm.ServiceMeasure[PrevTotalGameCycleDuration] );
}
else
{
for ( uint i=0; i!=NbServiceTimeMeasureTypes; ++i )
stm.ServiceMeasure[i] = 0;
}
//nldebug( "TCK-%u: %hu tocking", getGameCycle(), senderId );
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: %hu tocking", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), senderId.get() );
++_NbTocked;
_TockedServices.push_back( senderId );
cbDoNextTask();
}
示例5: dumpUnaffectedFaunaGroups
//---------------------------------------------------
// dumpUnaffectedFaunaDesc
//---------------------------------------------------
void CCreatureManager::dumpUnaffectedFaunaGroups(NLMISC::CLog & log)
{
for (uint i = 0; i < _UnaffectedFaunaGroups.size(); i++ )
{
log.displayNL("row %d, group %d",_UnaffectedFaunaGroups[i].EntityIndex.getIndex(),_UnaffectedFaunaGroups[i].GroupAlias);
}
} // dumpUnaffectedFaunaDesc
示例6: dumpFileInfo
void CFileReceiver::dumpFileInfo(const std::string &fileSpec,NLMISC::CLog& log) const
{
// setup a vector to hold fileInfo results and call getFileInfo() to fill it in
TFileInfoVector result;
getFileInfo(fileSpec,result);
// display a summary info message
log.displayNL("Result of info request '%s': %d matches",fileSpec.c_str(),result.size());
log.displayNL("- %-32s %10s %10s %s","checksum","time","size","name");
// iterate over results, displaying the info
for (TFileInfoVector::iterator it= result.begin(); it!=result.end(); ++it)
{
log.displayNL("- %-32s %10u %10u %s",it->Checksum.toString().c_str(),it->FileTime,it->FileSize,it->FileName.c_str());
}
}
示例7: displayAllLevelCaps
void CInterShardExchangeValidator::displayAllLevelCaps(NLMISC::CLog& log) const
{
log.displayNL("Level Caps:");
// iterate over the set of level caps in our singleton
TLevelCaps::const_iterator it= LevelCaps.begin();
TLevelCaps::const_iterator itEnd= LevelCaps.end();
for (;it!=itEnd;++it)
{
log.displayNL("- shard: %3u levelCap: %3u",it->first,it->second);
}
if (CInterShardExchangeValidator::getInstance()->LevelCaps.empty())
{
log.displayNL("- none");
}
}
示例8: dumpOutpostList
//----------------------------------------------------------------------------
void COutpostManager::dumpOutpostList(NLMISC::CLog & log) const
{
for (uint i = 0; i < _Outposts.size(); i++)
{
const CSmartPtr<COutpost> & outpost = _Outposts[i];
if (outpost != NULL)
log.displayNL("%u: %s", i, outpost->toString().c_str());
}
}
示例9: sendSyncToClient
void CTickProxy::sendSyncToClient( TServiceId serviceId )
{
CMessage msgout( "REGISTERED" );
msgout.serial( _GameTime );
msgout.serial( _GameTimeStep );
msgout.serial( _GameCycle );
CUnifiedNetwork::getInstance()->send( serviceId, msgout );
//nldebug( "TCK-%u: Sync %hu", getGameCycle(), serviceId );
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), serviceId.get() );
}
示例10:
/// Display contents
void display( NLMISC::CLog& log = *NLMISC::DebugLog )
{
CInstances::const_iterator ici;
for ( ici=_Instances.begin(); ici!=_Instances.end(); ++ici )
{
log.displayNL( "%s: %s (%u expected, %u running)",
(*ici).first.c_str(),
(*ici).second.Expected ? ((*ici).second.isOnlineAsExpected() ? "ONLINE" : "MISSING") : "OPTIONAL",
(*ici).second.Expected, (*ici).second.Running );
}
}
示例11: sendSyncs
void CTickProxy::sendSyncs()
{
vector<TServiceId>::const_iterator its;
for ( its=_Services.begin(); its!=_Services.end(); ++its )
{
CMessage msgout( "REGISTERED" );
msgout.serial( _GameTime );
msgout.serial( _GameTimeStep );
msgout.serial( _GameCycle );
CUnifiedNetwork::getInstance()->send( (*its), msgout );
//nldebug( "TCK-%u: Sync %hu", getGameCycle(), *its );
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Sync %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get());
}
}
示例12: dumpInventory
// ****************************************************************************
void CInventoryBase::dumpInventory(NLMISC::CLog & log, bool dumpItems) const
{
// inventory description
log.displayNL("Inventory: %s", INVENTORIES::toString(_InventoryId).c_str());
log.displayRawNL("Slots: max=%u, count=%u, free=%u", getMaxSlot(), _SlotCount, _FreeSlotCount);
log.displayRawNL("Weight: %u", _InventoryWeight);
log.displayRawNL("Bulk: %u", _InventoryBulk);
log.displayRawNL("Nb views: %u", _InventoryViews.size());
log.displayNL("(DEBUG) _Items.size() = %u", _Items.size());
if (dumpItems)
{
for (uint i = 0; i < _Items.size(); i++)
{
CGameItemPtr item = _Items[i];
if (item == NULL)
continue;
// short display of the item description
log.displayRawNL( "%u: ", i );
item->displayInLog( log );
}
}
}
示例13: sendTicks
void CTickProxy::sendTicks()
{
nlassert( CTickProxy::State == ExpectingMasterTick );
vector<TServiceId>::const_iterator its;
for ( its=_Services.begin(); its!=_Services.end(); ++its )
{
CMessage msgout( "TICK" );
CUnifiedNetwork::getInstance()->send( (*its), msgout ); // can produce the warning "Can't find selected connection id 0 to send message to METS because connection is not valid or connected, find a valid connection id", if the service is disconnecting but we aren't aware yet
//nldebug( "TCK-%u: Tick %hu", getGameCycle(), *its );
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Tick %hu", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle(), its->get() );
}
// nldebug( "Now expecting local tocks" );
State = ExpectingLocalTocks;
}
示例14: cbSyncFromMaster
//-----------------------------------------------
// cbRegistered
//
//-----------------------------------------------
static void cbSyncFromMaster(CMessage& msgin, const std::string &serviceName, TServiceId serviceId)
{
TGameTime gameTime = 0;
msgin.serial( gameTime );
CTickProxy::setGameTime( gameTime );
TGameTime gameTimeStep = 0;
msgin.serial( gameTimeStep );
CTickProxy::setGameTimeStep( gameTimeStep );
TGameCycle gameCycle = 0;
msgin.serial( gameCycle );
CTickProxy::setGameCycle( gameCycle );
//nldebug( "TCK-%u: Master Sync", gameCycle );
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Master Sync", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, gameCycle );
// user callback
onSync();
} // cbRegistered //
示例15: sendTockBack
//-----------------------------------------------
// sendTockBack
//
//-----------------------------------------------
void CTickProxy::sendTockBack( TServiceId serviceId )
{
// send back a tock
CMessage msgout( "TOCK" );
msgout.serial( TimeMeasures );
CUnifiedNetwork::getInstance()->send( serviceId, msgout );
TSockId host;
CCallbackNetBase *cnb;
cnb = CUnifiedNetwork::getInstance()->getNetBase((TServiceId)serviceId, host);
if( cnb )
{
cnb->flush( host );
//nlinfo( "TOCK sent at %.6f", CTime::ticksToSecond( CTime::getPerformanceTime() ) );
}
//nldebug( "TCK-%u: Tocked Master", getGameCycle() );
static uint32 prev = 0;
if ( getGameCycle() == prev )
nlwarning( "Tocked master twice in the same tick!" );
prev = getGameCycle();
//time_t t; time( &t );
_QuickLog.displayNL( "%"NL_I64"u: TCK-%u: Tocked Master", getPerfTime() /*IDisplayer::dateToHumanString( t )*/, getGameCycle() );
}