Changed: Removed "using namespace" from *.h
This commit is contained in:
parent
940de867ee
commit
a69f0050b6
11 changed files with 30 additions and 38 deletions
|
@ -28,9 +28,6 @@
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
namespace NLNET {
|
namespace NLNET {
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,10 +38,10 @@ enum TNetworkEvent { Sending, Receiving, Connecting, ConnFailing, Accepting, Dis
|
||||||
|
|
||||||
|
|
||||||
/// TNetworkEvent -> string
|
/// TNetworkEvent -> string
|
||||||
string EventToString( TNetworkEvent e );
|
std::string EventToString( TNetworkEvent e );
|
||||||
|
|
||||||
/// string -> TNetworkEvent
|
/// string -> TNetworkEvent
|
||||||
TNetworkEvent StringToEvent( string& s );
|
TNetworkEvent StringToEvent( std::string& s );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -65,7 +62,7 @@ struct TMessageRecord
|
||||||
nlassert( stream.stringMode() );
|
nlassert( stream.stringMode() );
|
||||||
|
|
||||||
uint32 len;
|
uint32 len;
|
||||||
string s_event;
|
std::string s_event;
|
||||||
stream.serial( UpdateCounter );
|
stream.serial( UpdateCounter );
|
||||||
if ( stream.isReading() )
|
if ( stream.isReading() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
|
|
||||||
#include "nel/misc/mutex.h"
|
#include "nel/misc/mutex.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace NLMISC;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class used to display console text commands in the chat window
|
* class used to display console text commands in the chat window
|
||||||
* \author Nicolas Brigand
|
* \author Nicolas Brigand
|
||||||
|
@ -57,8 +54,8 @@ public:
|
||||||
/// Display the string to the chat window
|
/// Display the string to the chat window
|
||||||
virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message )
|
virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message )
|
||||||
{
|
{
|
||||||
string temp = message;
|
std::string temp = message;
|
||||||
string str;
|
std::string str;
|
||||||
CInterfaceManager::TSystemInfoMode mode;
|
CInterfaceManager::TSystemInfoMode mode;
|
||||||
if (args.LogType == NLMISC::CLog::LOG_ERROR)
|
if (args.LogType == NLMISC::CLog::LOG_ERROR)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "phrase_manager/phrase_utilities_functions.h"
|
#include "phrase_manager/phrase_utilities_functions.h"
|
||||||
//#include "creature_manager/creature_manager.h"
|
//#include "creature_manager/creature_manager.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
using namespace EFFECT_FAMILIES;
|
using namespace EFFECT_FAMILIES;
|
||||||
using namespace NLLIGO;
|
using namespace NLLIGO;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
@ -66,7 +66,7 @@ CPVPFactionRewardManager::CPVPFactionRewardManager()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
void CPVPFactionRewardManager::_BuildTotemBasesRec( const IPrimitive* prim,
|
void CPVPFactionRewardManager::_BuildTotemBasesRec( const IPrimitive* prim,
|
||||||
map<CTotemBase*, set<string> >& neighboursNames,
|
std::map<CTotemBase*, set<string> >& neighboursNames,
|
||||||
map<std::string, CTotemBase*>& totemBasesPerName )
|
map<std::string, CTotemBase*>& totemBasesPerName )
|
||||||
{
|
{
|
||||||
if ( !prim )
|
if ( !prim )
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#include "nel/ligo/primitive.h"
|
#include "nel/ligo/primitive.h"
|
||||||
#include "game_share/effect_families.h"
|
#include "game_share/effect_families.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace EFFECT_FAMILIES;
|
|
||||||
|
|
||||||
class CCharacter;
|
class CCharacter;
|
||||||
class CSEffect;
|
class CSEffect;
|
||||||
class CTotemBase;
|
class CTotemBase;
|
||||||
|
@ -52,7 +49,7 @@ class CPVPFactionRewardManager
|
||||||
{
|
{
|
||||||
DECLARE_PERSISTENCE_METHODS
|
DECLARE_PERSISTENCE_METHODS
|
||||||
public :
|
public :
|
||||||
typedef vector<int> TPossessionsPerEffect;
|
typedef std::vector<int> TPossessionsPerEffect;
|
||||||
|
|
||||||
/// Totems levels with the number of totems needed to reach them
|
/// Totems levels with the number of totems needed to reach them
|
||||||
enum TotemLevel
|
enum TotemLevel
|
||||||
|
@ -65,7 +62,7 @@ public :
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Values of each effects
|
/// 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
|
/// Returns the totem base for a given region using its ID
|
||||||
const CTotemBase* getTotemBaseFromId( uint16 regionId ) { return _GetTotemBaseFromId( regionId ); }
|
const CTotemBase* getTotemBaseFromId( uint16 regionId ) { return _GetTotemBaseFromId( regionId ); }
|
||||||
|
@ -91,12 +88,12 @@ private :
|
||||||
|
|
||||||
/// Get the effects a character would get on a totem
|
/// Get the effects a character would get on a totem
|
||||||
void _GetTotemsEffectsRec( CCharacter* user, CTotemBase* pTotem,
|
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
|
/// Remove all totem effects from a given player
|
||||||
void _removeTotemsEffects( CCharacter* user );
|
void _removeTotemsEffects( CCharacter* user );
|
||||||
|
|
||||||
/// Totem bases sorted by region
|
/// Totem bases sorted by region
|
||||||
map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
|
std::map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
|
||||||
|
|
||||||
/// Number of totems
|
/// Number of totems
|
||||||
uint32 _NbTotems;
|
uint32 _NbTotems;
|
||||||
|
@ -106,8 +103,8 @@ private :
|
||||||
|
|
||||||
/// Build the totem bases using the a LIGO primitive
|
/// Build the totem bases using the a LIGO primitive
|
||||||
void _BuildTotemBasesRec( const NLLIGO::IPrimitive* prim,
|
void _BuildTotemBasesRec( const NLLIGO::IPrimitive* prim,
|
||||||
map<CTotemBase*, std::set<std::string> >& neighboursNames,
|
std::map<CTotemBase*, std::set<std::string> >& neighboursNames,
|
||||||
map<std::string, CTotemBase*>& totemBasesPerName );
|
std::map<std::string, CTotemBase*>& totemBasesPerName );
|
||||||
|
|
||||||
/// Have the totem bases been setup ?
|
/// Have the totem bases been setup ?
|
||||||
bool _InitDone;
|
bool _InitDone;
|
||||||
|
@ -146,7 +143,7 @@ public :
|
||||||
bool destroyTotem( uint16 regionIndex, TDataSetRow killerRowId );
|
bool destroyTotem( uint16 regionIndex, TDataSetRow killerRowId );
|
||||||
|
|
||||||
/// Get the list of reward effects for a character depending on its coordinates
|
/// 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
|
/// Give totem rewards to a player
|
||||||
void giveTotemsEffects( CCharacter* user );
|
void giveTotemsEffects( CCharacter* user );
|
||||||
|
@ -176,7 +173,7 @@ public :
|
||||||
PVP_CLAN::TPVPClan getRegionOwner( uint16 regionId );
|
PVP_CLAN::TPVPClan getRegionOwner( uint16 regionId );
|
||||||
|
|
||||||
/// send event message to ai
|
/// 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
|
/// send message when spire is attacked
|
||||||
void spireAttacked( CCharacter * actor, CCreature * spire );
|
void spireAttacked( CCharacter * actor, CCreature * spire );
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "id_impulsions.h"
|
#include "id_impulsions.h"
|
||||||
#include "uid_impulsions.h"
|
#include "uid_impulsions.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
using namespace CLFECOMMON;
|
using namespace CLFECOMMON;
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ public:
|
||||||
/// Return the current maximum number of bits that can fit in the outbox
|
/// Return the current maximum number of bits that can fit in the outbox
|
||||||
sint32 getCurrentThrottle() const
|
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
|
/// Update the average bits filled that determine the throttle
|
||||||
|
@ -364,7 +364,7 @@ public:
|
||||||
if ( _BitImpulsionUsageAvg < nominalBitSize )
|
if ( _BitImpulsionUsageAvg < nominalBitSize )
|
||||||
availBitsize = nominalBitSize;
|
availBitsize = nominalBitSize;
|
||||||
else
|
else
|
||||||
availBitsize = max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
|
availBitsize = std::max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
|
||||||
|
|
||||||
CMirrorPropValue<uint16> availableImpulseBitsize( TheDataset, _EntityIndex, DSFirstPropertyAvailableImpulseBitSize );
|
CMirrorPropValue<uint16> availableImpulseBitsize( TheDataset, _EntityIndex, DSFirstPropertyAvailableImpulseBitSize );
|
||||||
#ifdef NL_DEBUG
|
#ifdef NL_DEBUG
|
||||||
|
@ -402,16 +402,16 @@ public:
|
||||||
TUid Uid;
|
TUid Uid;
|
||||||
|
|
||||||
/// User name (put on the NeL Launcher, transmitted by the login system)
|
/// 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)
|
/// 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)
|
/// User extended data (put on the NeL Launcher, transmitted by the login system)
|
||||||
string UserExtended;
|
std::string UserExtended;
|
||||||
|
|
||||||
/// Language Id
|
/// Language Id
|
||||||
string LanguageId;
|
std::string LanguageId;
|
||||||
|
|
||||||
/// Login cookie
|
/// Login cookie
|
||||||
NLNET::CLoginCookie LoginCookie;
|
NLNET::CLoginCookie LoginCookie;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <nel/misc/variable.h>
|
#include <nel/misc/variable.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
using namespace CLFECOMMON;
|
using namespace CLFECOMMON;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
using namespace NLNET;
|
using namespace NLNET;
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include "client_id_lookup.h"
|
#include "client_id_lookup.h"
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
extern bool verbosePacketLost;
|
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 };
|
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
|
/// Return the string for the message invalidity reasons
|
||||||
string getBadMessageString( uint32 reasons );
|
std::string getBadMessageString( uint32 reasons );
|
||||||
|
|
||||||
/// Hacking description
|
/// Hacking description
|
||||||
struct THackingDesc
|
struct THackingDesc
|
||||||
|
@ -121,7 +120,7 @@ public:
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
/// Add client
|
/// 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)
|
/// 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) ); }
|
void addToRemoveList( TClientId clientid ) { _ClientsToRemove.push_back( std::make_pair(clientid,3) ); }
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include "nel/net/udp_sock.h"
|
#include "nel/net/udp_sock.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
const uint32 MsgHeaderSize = 1;
|
const uint32 MsgHeaderSize = 1;
|
||||||
|
@ -72,12 +71,12 @@ struct TReceivedMessage
|
||||||
uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; }
|
uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; }
|
||||||
|
|
||||||
/// Return the data vector (event type header byte + user data)
|
/// Return the data vector (event type header byte + user data)
|
||||||
vector<uint8>& data() { return _Data; }
|
std::vector<uint8>& data() { return _Data; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// One byte for event type (header), followed by user data
|
/// One byte for event type (header), followed by user data
|
||||||
vector<uint8> _Data;
|
std::vector<uint8> _Data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -85,7 +84,7 @@ public:
|
||||||
NLNET::CInetAddress AddrFrom;
|
NLNET::CInetAddress AddrFrom;
|
||||||
|
|
||||||
/// Placeholder vector for address info
|
/// Placeholder vector for address info
|
||||||
vector<uint8> VAddrFrom;
|
std::vector<uint8> VAddrFrom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
using namespace NLNET;
|
using namespace NLNET;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
using namespace CLFECOMMON;
|
using namespace CLFECOMMON;
|
||||||
|
|
|
@ -83,7 +83,7 @@ void CProcessingSpreader::getProcessingBounds( THostMap::iterator& firstit, sint
|
||||||
}
|
}
|
||||||
|
|
||||||
sint maxNbClientsProcessedPerTick = MaxNbClients / ExecutionPeriod;
|
sint maxNbClientsProcessedPerTick = MaxNbClients / ExecutionPeriod;
|
||||||
outerboundindex = firstindex + min( maxNbClientsProcessedPerTick, nbClients - firstindex );
|
outerboundindex = firstindex + std::min( maxNbClientsProcessedPerTick, nbClients - firstindex );
|
||||||
_ClientMapIndex = outerboundindex;
|
_ClientMapIndex = outerboundindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue