Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv17417
Modified Files:
accounts.cpp accounts.h commands.cpp player.cpp
Log Message:
Added ability to toggle gm mode by using
.staff
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** accounts.cpp 11 Jun 2003 10:54:06 -0000 1.62
--- accounts.cpp 31 Aug 2003 20:06:42 -0000 1.63
***************
*** 189,192 ****
--- 189,197 ----
}
+ bool AccountRecord::isStaff() const
+ {
+ return flags_&0x00000020;
+ }
+
void AccountRecord::setBlocked( bool data )
{
***************
*** 227,230 ****
--- 232,243 ----
else
flags_ &= 0xFFFFFFEF;
+ }
+
+ void AccountRecord::setStaff( bool data )
+ {
+ if( data )
+ flags_ |= 0x00000020;
+ else
+ flags_ &= 0xFFFFFFDF;
}
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** accounts.h 24 May 2003 12:44:01 -0000 1.28
--- accounts.h 31 Aug 2003 20:06:42 -0000 1.29
***************
*** 72,75 ****
--- 72,76 ----
// 0x00000008 showserials
// 0x00000010 pagenotify
+ // 0x00000020 staff - gm mode on/off
UINT32 flags_;
int attempts_;
***************
*** 114,117 ****
--- 115,119 ----
bool isShowSerials() const;
bool isPageNotify() const;
+ bool isStaff() const;
void setBlocked( bool data );
***************
*** 120,123 ****
--- 122,126 ----
void setShowSerials( bool data );
void setPageNotify( bool data );
+ void setStaff( bool data );
};
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.195
retrieving revision 1.196
diff -C2 -d -r1.195 -r1.196
*** commands.cpp 20 Aug 2003 17:10:48 -0000 1.195
--- commands.cpp 31 Aug 2003 20:06:42 -0000 1.196
***************
*** 830,833 ****
--- 830,848 ----
}
+ void commandStaff( cUOSocket *socket, const QString &command, QStringList &args ) throw()
+ {
+ Q_UNUSED(command);
+ if( socket->account()->isStaff() || ( args.count() > 0 && args[0].toInt() == 0 ) )
+ {
+ socket->account()->setStaff( false );
+ socket->sysMessage( tr( "Staff is now '0'." ) );
+ }
+ else if( !socket->account()->isStaff() || ( args.count() > 0 && args[0].toInt() == 1 ) )
+ {
+ socket->account()->setStaff( true );
+ socket->sysMessage( tr( "Staff is now '1'." ) );
+ }
+ }
+
void commandReload( cUOSocket *socket, const QString &command, QStringList &args ) throw()
{
***************
*** 1249,1252 ****
--- 1264,1268 ----
{ "SHOWSERIALS", commandShowSerials },
{ "SHUTDOWN", commandShutDown },
+ { "STAFF", commandStaff },
{ "SPAWNREGION", commandSpawnRegion },
{ "TAGS", commandTags },
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** player.cpp 28 Aug 2003 20:56:16 -0000 1.32
--- player.cpp 31 Aug 2003 20:06:42 -0000 1.33
***************
*** 828,837 ****
bool cPlayer::isGM() const
{
! return account() && ( account()->acl() == "admin" || account()->acl() == "gm" );
}
bool cPlayer::isCounselor() const
{
! return account() && account()->acl() == "counselor";
}
--- 828,837 ----
bool cPlayer::isGM() const
{
! return account() && ( account()->acl() == "admin" || account()->acl() == "gm" ) && account()->isStaff();
}
bool cPlayer::isCounselor() const
{
! return account() && ( account()->acl() == "counselor" ) && account()->isStaff();
}
|