diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-01 10:12:54 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-01 10:12:54 +0100 |
commit | bb49f0e021fb1fbefad44d944233fb1cf72c495c (patch) | |
tree | ebb0f2b40a3987eddf126c368237c0c60e4e6518 /source/cPlayer.cpp | |
parent | Fixed a sigsegv on *nix (cFile double-closing files) (diff) | |
download | cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.gz cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.bz2 cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.lz cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.xz cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.zst cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.zip |
Diffstat (limited to '')
-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() );
|