Changed: Removed "using namespace" from *.h

This commit is contained in:
kervala 2010-09-23 19:29:14 +02:00
parent 2633b61040
commit 3076c68530
11 changed files with 30 additions and 38 deletions

View file

@ -28,9 +28,6 @@
#include <queue>
#include <string>
using namespace std;
namespace NLNET {
@ -41,10 +38,10 @@ enum TNetworkEvent { Sending, Receiving, Connecting, ConnFailing, Accepting, Dis
/// TNetworkEvent -> string
string EventToString( TNetworkEvent e );
std::string EventToString( TNetworkEvent e );
/// string -> TNetworkEvent
TNetworkEvent StringToEvent( string& s );
TNetworkEvent StringToEvent( std::string& s );
/*
@ -65,7 +62,7 @@ struct TMessageRecord
nlassert( stream.stringMode() );
uint32 len;
string s_event;
std::string s_event;
stream.serial( UpdateCounter );
if ( stream.isReading() )
{

View file

@ -25,9 +25,6 @@
#include "nel/misc/mutex.h"
using namespace std;
using namespace NLMISC;
/**
* class used to display console text commands in the chat window
* \author Nicolas Brigand
@ -57,8 +54,8 @@ public:
/// Display the string to the chat window
virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message )
{
string temp = message;
string str;
std::string temp = message;
std::string str;
CInterfaceManager::TSystemInfoMode mode;
if (args.LogType == NLMISC::CLog::LOG_ERROR)
{

View file

@ -30,7 +30,7 @@
#include "phrase_manager/phrase_utilities_functions.h"
//#include "creature_manager/creature_manager.h"
using namespace std;
using namespace EFFECT_FAMILIES;
using namespace NLLIGO;
using namespace NLMISC;
@ -66,7 +66,7 @@ CPVPFactionRewardManager::CPVPFactionRewardManager()
//----------------------------------------------------------------------------
void CPVPFactionRewardManager::_BuildTotemBasesRec( const IPrimitive* prim,
map<CTotemBase*, set<string> >& neighboursNames,
std::map<CTotemBase*, set<string> >& neighboursNames,
map<std::string, CTotemBase*>& totemBasesPerName )
{
if ( !prim )

View file

@ -22,9 +22,6 @@
#include "nel/ligo/primitive.h"
#include "game_share/effect_families.h"
using namespace std;
using namespace EFFECT_FAMILIES;
class CCharacter;
class CSEffect;
class CTotemBase;
@ -52,7 +49,7 @@ class CPVPFactionRewardManager
{
DECLARE_PERSISTENCE_METHODS
public :
typedef vector<int> TPossessionsPerEffect;
typedef std::vector<int> TPossessionsPerEffect;
/// Totems levels with the number of totems needed to reach them
enum TotemLevel
@ -65,7 +62,7 @@ public :
};
/// Values of each effects
static sint32 EffectValues[ EndTotemEffects+1 ];
static sint32 EffectValues[ EFFECT_FAMILIES::EndTotemEffects+1 ];
/// Returns the totem base for a given region using its ID
const CTotemBase* getTotemBaseFromId( uint16 regionId ) { return _GetTotemBaseFromId( regionId ); }
@ -91,12 +88,12 @@ private :
/// Get the effects a character would get on a totem
void _GetTotemsEffectsRec( CCharacter* user, CTotemBase* pTotem,
vector<CSEffect*>& outEffects, vector<CTotemBase*>& processed );
std::vector<CSEffect*>& outEffects, std::vector<CTotemBase*>& processed );
/// Remove all totem effects from a given player
void _removeTotemsEffects( CCharacter* user );
/// Totem bases sorted by region
map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
std::map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
/// Number of totems
uint32 _NbTotems;
@ -106,8 +103,8 @@ private :
/// Build the totem bases using the a LIGO primitive
void _BuildTotemBasesRec( const NLLIGO::IPrimitive* prim,
map<CTotemBase*, std::set<std::string> >& neighboursNames,
map<std::string, CTotemBase*>& totemBasesPerName );
std::map<CTotemBase*, std::set<std::string> >& neighboursNames,
std::map<std::string, CTotemBase*>& totemBasesPerName );
/// Have the totem bases been setup ?
bool _InitDone;
@ -146,7 +143,7 @@ public :
bool destroyTotem( uint16 regionIndex, TDataSetRow killerRowId );
/// Get the list of reward effects for a character depending on its coordinates
vector<CSEffect*> getTotemsEffects( CCharacter* user, std::vector<CTotemBase*>& processed );
std::vector<CSEffect*> getTotemsEffects( CCharacter* user, std::vector<CTotemBase*>& processed );
/// Give totem rewards to a player
void giveTotemsEffects( CCharacter* user );
@ -176,7 +173,7 @@ public :
PVP_CLAN::TPVPClan getRegionOwner( uint16 regionId );
/// send event message to ai
void sendEventToAI( const CTotemBase * totem, const string& event );
void sendEventToAI( const CTotemBase * totem, const std::string& event );
/// send message when spire is attacked
void spireAttacked( CCharacter * actor, CCreature * spire );

View file

@ -26,6 +26,7 @@
#include "id_impulsions.h"
#include "uid_impulsions.h"
using namespace std;
using namespace NLMISC;
using namespace CLFECOMMON;

View file

@ -317,7 +317,7 @@ public:
/// Return the current maximum number of bits that can fit in the outbox
sint32 getCurrentThrottle() const
{
return min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) );
return std::min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) );
}
/// Update the average bits filled that determine the throttle
@ -364,7 +364,7 @@ public:
if ( _BitImpulsionUsageAvg < nominalBitSize )
availBitsize = nominalBitSize;
else
availBitsize = max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
availBitsize = std::max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
CMirrorPropValue<uint16> availableImpulseBitsize( TheDataset, _EntityIndex, DSFirstPropertyAvailableImpulseBitSize );
#ifdef NL_DEBUG
@ -402,16 +402,16 @@ public:
TUid Uid;
/// User name (put on the NeL Launcher, transmitted by the login system)
string UserName;
std::string UserName;
/// User privilege (put on the NeL Launcher, transmitted by the login system)
string UserPriv;
std::string UserPriv;
/// User extended data (put on the NeL Launcher, transmitted by the login system)
string UserExtended;
std::string UserExtended;
/// Language Id
string LanguageId;
std::string LanguageId;
/// Login cookie
NLNET::CLoginCookie LoginCookie;

View file

@ -32,6 +32,7 @@
#include <nel/misc/variable.h>
#endif
using namespace std;
using namespace CLFECOMMON;
using namespace NLMISC;
using namespace NLNET;

View file

@ -30,7 +30,6 @@
#include "client_id_lookup.h"
#include <list>
using namespace std;
extern bool verbosePacketLost;
@ -55,7 +54,7 @@ typedef std::list< std::pair<TClientId,uint8> > TClientsToRemove;
enum TBadMessageFormatType { InsufficientSize=1, NotSystemLoginCode=2, BadCookie=4, BadSystemCode=8, HackedSizeInBuffer=16, AccessClosed=32, IrrelevantSystemMessage=64, MalformedAction=128, UnknownExceptionType=256, UnknownFormatType=512, UnauthorizedCharacterSlot=1024 };
/// Return the string for the message invalidity reasons
string getBadMessageString( uint32 reasons );
std::string getBadMessageString( uint32 reasons );
/// Hacking description
struct THackingDesc
@ -121,7 +120,7 @@ public:
void release();
/// Add client
CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const string &userName, const string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true );
CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const std::string &userName, const std::string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true );
/// Add to the list of clients which will be removed by addr at the three cycles later (leaving the time to send an impulsion to the client)
void addToRemoveList( TClientId clientid ) { _ClientsToRemove.push_back( std::make_pair(clientid,3) ); }

View file

@ -30,7 +30,6 @@
#include "nel/net/udp_sock.h"
#include <vector>
using namespace std;
const uint32 MsgHeaderSize = 1;
@ -72,12 +71,12 @@ struct TReceivedMessage
uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; }
/// Return the data vector (event type header byte + user data)
vector<uint8>& data() { return _Data; }
std::vector<uint8>& data() { return _Data; }
private:
/// One byte for event type (header), followed by user data
vector<uint8> _Data;
std::vector<uint8> _Data;
public:
@ -85,7 +84,7 @@ public:
NLNET::CInetAddress AddrFrom;
/// Placeholder vector for address info
vector<uint8> VAddrFrom;
std::vector<uint8> VAddrFrom;
};

View file

@ -61,6 +61,7 @@
# include <windows.h>
#endif // NL_OS_WINDOWS
using namespace std;
using namespace NLNET;
using namespace NLMISC;
using namespace CLFECOMMON;

View file

@ -83,7 +83,7 @@ void CProcessingSpreader::getProcessingBounds( THostMap::iterator& firstit, sint
}
sint maxNbClientsProcessedPerTick = MaxNbClients / ExecutionPeriod;
outerboundindex = firstindex + min( maxNbClientsProcessedPerTick, nbClients - firstindex );
outerboundindex = firstindex + std::min( maxNbClientsProcessedPerTick, nbClients - firstindex );
_ClientMapIndex = outerboundindex;
}