Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv24411
Modified Files:
accounts.cpp commands.cpp commands.h world.cpp
wpdefmanager.cpp
Log Message:
Fixed a release inlining and shutdown bug.
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** accounts.cpp 13 Sep 2003 01:46:58 -0000 1.68
--- accounts.cpp 13 Sep 2003 13:08:40 -0000 1.69
***************
*** 100,103 ****
--- 100,105 ----
}
+ //#include "console.h"
+
bool cAccount::authorized( const QString& group, const QString& value ) const
{
***************
*** 105,112 ****
if( !acl_ )
{// Let's try harder get one.
! acl_ = cCommands::instance()->getACL( aclName_ ); // loads if there was any specified.
if ( !acl_ )
{
! acl_ = cCommands::instance()->getACL( "player" );
if ( acl_ )
aclName_ = "player";
--- 107,114 ----
if( !acl_ )
{// Let's try harder get one.
! acl_ = Commands::instance()->getACL( aclName_ ); // loads if there was any specified.
if ( !acl_ )
{
! acl_ = Commands::instance()->getACL( "player" );
if ( acl_ )
aclName_ = "player";
***************
*** 115,118 ****
--- 117,121 ----
}
}
+
// No group? No Access!
QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
***************
*** 147,151 ****
void cAccount::refreshAcl()
{
! acl_ = cCommands::instance()->getACL( aclName_ );
}
--- 150,154 ----
void cAccount::refreshAcl()
{
! acl_ = Commands::instance()->getACL( aclName_ );
}
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -C2 -d -r1.201 -r1.202
*** commands.cpp 9 Sep 2003 23:09:30 -0000 1.201
--- commands.cpp 13 Sep 2003 13:08:40 -0000 1.202
***************
*** 179,182 ****
--- 179,183 ----
}
}
+
_acls.insert( ACLname, acl );
}
***************
*** 473,477 ****
else if( key == "acl" )
{
! if( !cCommands::instance()->getACL( value ) )
{
socket->sysMessage( tr( "You tried to specify an unknown acl '%1'" ).arg( value ) );
--- 474,478 ----
else if( key == "acl" )
{
! if( !Commands::instance()->getACL( value ) )
{
socket->sysMessage( tr( "You tried to specify an unknown acl '%1'" ).arg( value ) );
Index: commands.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** commands.h 4 Jul 2003 16:30:47 -0000 1.13
--- commands.h 13 Sep 2003 13:08:40 -0000 1.14
***************
*** 33,36 ****
--- 33,38 ----
#define __COMMANDS_H__
+ #include "singleton.h"
+
// Library Includes
#include <qmap.h>
***************
*** 57,63 ****
// Group -> Command -> Permitted
! class cCommands : public QObject
{
- Q_OBJECT
private:
QMap< QString, cAcl* > _acls;
--- 59,64 ----
// Group -> Command -> Permitted
! class cCommands
{
private:
QMap< QString, cAcl* > _acls;
***************
*** 68,77 ****
void dispatch( cUOSocket *socket, const QString &command, QStringList &arguments );
- static cCommands *instance()
- {
- static cCommands instance_;
- return &instance_;
- }
-
QMap< QString, cAcl* >::const_iterator aclbegin() const { return _acls.begin(); }
QMap< QString, cAcl* >::const_iterator aclend() const { return _acls.end(); }
--- 69,72 ----
***************
*** 84,93 ****
inline cAcl *cCommands::getACL( const QString& key )
{
! if( _acls.find( key ) == _acls.end() )
! return 0;
else
! return _acls.find( key ).data();
}
#endif
--- 79,91 ----
inline cAcl *cCommands::getACL( const QString& key )
{
! QMap< QString, cAcl* >::iterator it = _acls.find( key );
!
! if( it != _acls.end() )
! return it.data();
else
! return 0;
}
+ typedef SingletonHolder< cCommands > Commands;
#endif
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** world.cpp 12 Sep 2003 20:02:44 -0000 1.45
--- world.cpp 13 Sep 2003 13:08:41 -0000 1.46
***************
*** 736,739 ****
--- 736,742 ----
Console::instance()->log( LOG_ERROR, "Saving failed: " + e );
+
+ persistentBroker->disconnect();
+
return;
}
***************
*** 748,755 ****
Console::instance()->ChangeColor( WPC_NORMAL );
- persistentBroker->disconnect();
-
Console::instance()->send( QString( " [%1ms]\n" ).arg( uiCurrentTime - startTime ) );
}
--- 751,757 ----
Console::instance()->ChangeColor( WPC_NORMAL );
Console::instance()->send( QString( " [%1ms]\n" ).arg( uiCurrentTime - startTime ) );
+ persistentBroker->disconnect();
}
Index: wpdefmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** wpdefmanager.cpp 11 Sep 2003 16:19:50 -0000 1.65
--- wpdefmanager.cpp 13 Sep 2003 13:08:41 -0000 1.66
***************
*** 293,297 ****
Console::instance()->ProgressDone();
! cCommands::instance()->loadACLs();
BaseDefManager::instance()->load();
}
--- 293,297 ----
Console::instance()->ProgressDone();
! Commands::instance()->loadACLs();
BaseDefManager::instance()->load();
}
|