diff options
Diffstat (limited to 'source/cPlayer.cpp')
-rw-r--r-- | source/cPlayer.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 23c43ae25..0dd5695a4 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -43,13 +43,11 @@ #include "../iniFile/iniFile.h"
#include <json/json.h>
-#ifndef _WIN32 // for mkdir
-#include <sys/stat.h>
-#include <sys/types.h>
-#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ )
-#endif
#define float2int(x) ((x)<0 ? ((int)(x))-1 : (int)(x))
-extern std::vector< std::string > StringSplit( std::string str, std::string delim);
+
+
+
+
CLASS_DEFINITION( cPlayer, cPawn );
@@ -557,9 +555,13 @@ bool cPlayer::CanUseCommand( const char* a_Command ) return false;
}
+
+
+
+
bool cPlayer::HasPermission( const char* a_Permission )
{
- std::vector< std::string > Split = StringSplit( a_Permission, "." );
+ AStringVector Split = StringSplit( a_Permission, "." );
PermissionMap Possibilities = m_pState->ResolvedPermissions;
// Now search the namespaces
while( Possibilities.begin() != Possibilities.end() )
@@ -567,7 +569,7 @@ bool cPlayer::HasPermission( const char* a_Permission ) PermissionMap::iterator itr = Possibilities.begin();
if( itr->second )
{
- std::vector< std::string > OtherSplit = StringSplit( itr->first, "." );
+ AStringVector OtherSplit = StringSplit( itr->first, "." );
if( OtherSplit.size() <= Split.size() )
{
unsigned int i;
@@ -589,6 +591,10 @@ bool cPlayer::HasPermission( const char* a_Permission ) return false;
}
+
+
+
+
bool cPlayer::IsInGroup( const char* a_Group )
{
for( GroupList::iterator itr = m_pState->ResolvedGroups.begin(); itr != m_pState->ResolvedGroups.end(); ++itr )
@@ -743,7 +749,7 @@ void cPlayer::LoadPermissionsFromDisk() std::string Groups = IniFile.GetValue(m_pState->PlayerName, "Groups", "");
if( Groups.size() > 0 )
{
- std::vector< std::string > Split = StringSplit( Groups, "," );
+ AStringVector Split = StringSplit( Groups, "," );
for( unsigned int i = 0; i < Split.size(); i++ )
{
AddToGroup( Split[i].c_str() );
|