Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv475/src
Modified Files:
npc.cpp persistentbroker.cpp persistentbroker.h player.cpp
wolf.dsp wolfpack.cpp world.cpp
Log Message:
Improved SQL Loading and Saving speed.
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** npc.cpp 26 Aug 2003 15:01:05 -0000 1.32
--- npc.cpp 27 Aug 2003 15:29:18 -0000 1.33
***************
*** 173,176 ****
--- 173,180 ----
addStrField( "ai", ai_->name() );
}
+ else
+ {
+ addStrField( "ai", QString::null );
+ }
addField( "wandertype", (UINT8)wanderType() );
addField( "wanderx1", wanderX1() );
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** persistentbroker.cpp 26 Aug 2003 15:36:44 -0000 1.15
--- persistentbroker.cpp 27 Aug 2003 15:29:18 -0000 1.16
***************
*** 92,96 ****
--- 92,101 ----
// Disable fsynch for sqlite
if( sqlite )
+ {
connection->exec( "PRAGMA synchronous = OFF;" );
+ connection->exec( "PRAGMA default_synchronous = OFF;" );
+ connection->exec( "PRAGMA full_column_names = OFF;" );
+ connection->exec( "PRAGMA show_datatypes = OFF;" );
+ }
return true;
***************
*** 106,111 ****
{
// Start Transaction
! if( sqlite )
! connection->exec( "BEGIN TRANSACTION;" );
try
--- 111,116 ----
{
// Start Transaction
! /*if( sqlite )
! connection->exec( "BEGIN TRANSACTION;" );*/
try
***************
*** 116,127 ****
{
// Rollback
! if( sqlite )
! connection->exec( "ROLLBACK TRANSACTION;" );
throw;
}
// Commit
! if( sqlite )
! connection->exec( "COMMIT TRANSACTION;" );
return true;
--- 121,132 ----
{
// Rollback
! /*if( sqlite )
! connection->exec( "ROLLBACK TRANSACTION;" );*/
throw;
}
// Commit
! /*if( sqlite )
! connection->exec( "COMMIT TRANSACTION;" );*/
return true;
Index: persistentbroker.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** persistentbroker.h 26 Aug 2003 15:36:44 -0000 1.18
--- persistentbroker.h 27 Aug 2003 15:29:18 -0000 1.19
***************
*** 156,160 ****
else \
{ \
! fields.push_back( name ); \
values.push_back( QString::number( value ) ); \
}
--- 156,160 ----
else \
{ \
! /* fields.push_back( name ); */ \
values.push_back( QString::number( value ) ); \
}
***************
*** 165,169 ****
else \
{ \
! fields.push_back( name ); \
values.push_back( "'" + ( value.isNull() ? QString( "" ) : persistentBroker->quoteString( value ) ) + "'" ); \
}
--- 165,169 ----
else \
{ \
! /* fields.push_back( name ); */ \
values.push_back( "'" + ( value.isNull() ? QString( "" ) : persistentBroker->quoteString( value ) ) + "'" ); \
}
***************
*** 178,182 ****
else \
{ \
! persistentBroker->executeQuery( QString( "INSERT INTO %1 (%2) VALUES(%3)" ).arg( table ).arg( fields.join( "," ) ).arg( values.join( "," ) ) ); \
}
--- 178,182 ----
else \
{ \
! persistentBroker->executeQuery( QString( "INSERT INTO %1 VALUES(%3)" ).arg( table )/*.arg( fields.join( "," ) )*/.arg( values.join( "," ) ) ); \
}
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** player.cpp 27 Aug 2003 01:39:59 -0000 1.26
--- player.cpp 27 Aug 2003 15:29:18 -0000 1.27
***************
*** 129,134 ****
--- 129,142 ----
addField( "serial", serial() );
+
if( account_ )
+ {
addStrField( "account", account_->login() );
+ }
+ else
+ {
+ addStrField( "account", QString::null );
+ }
+
addField( "additionalflags", additionalFlags_ );
addField( "visualrange", visualRange_ );
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.206
retrieving revision 1.207
diff -C2 -d -r1.206 -r1.207
*** wolf.dsp 26 Aug 2003 15:05:38 -0000 1.206
--- wolf.dsp 27 Aug 2003 15:29:18 -0000 1.207
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O1 /Ob0 /I "lib/Python/PC" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTHREAD_SHARED" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTHREAD_SHARED" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.441
retrieving revision 1.442
diff -C2 -d -r1.441 -r1.442
*** wolfpack.cpp 27 Aug 2003 13:33:17 -0000 1.441
--- wolfpack.cpp 27 Aug 2003 15:29:18 -0000 1.442
***************
*** 559,573 ****
#endif
*/
- clConsole.send( "PAUSE" );
- Sleep( 10000 );
-
- for( unsigned int x = 0; x < 100000; ++x )
- {
- cItem *pItem = new cItem;
- }
-
- clConsole.send( "PAUSE" );
- Sleep( 10000 );
-
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
--- 559,562 ----
***************
*** 816,820 ****
serverState = RUNNING;
!
QWaitCondition niceLevel;
// This is our main loop
--- 805,809 ----
serverState = RUNNING;
!
QWaitCondition niceLevel;
// This is our main loop
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** world.cpp 26 Aug 2003 15:36:44 -0000 1.29
--- world.cpp 27 Aug 2003 15:29:18 -0000 1.30
***************
*** 65,69 ****
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! //#define WP_USE_HASH_MAP
// Important compile switch
--- 65,69 ----
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! #define WP_USE_HASH_MAP
// Important compile switch
***************
*** 467,470 ****
--- 467,472 ----
p->purgePendingObjects();
+ persistentBroker->executeQuery( "BEGIN;" );
+
try
{
***************
*** 479,482 ****
--- 481,486 ----
catch( QString &e )
{
+ persistentBroker->executeQuery( "ROLLBACK;" );
+
clConsole.ChangeColor( WPC_RED );
clConsole.send( " Failed" );
***************
*** 486,489 ****
--- 490,495 ----
return;
}
+
+ persistentBroker->executeQuery( "COMMIT;" );
ISerialization *archive = cPluginFactory::serializationArchiver( "xml" );
|