Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv20028
Modified Files:
tmpeff.cpp world.cpp
Log Message:
sql fix effects_properties.key -> keyname
Index: tmpeff.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tmpeff.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** tmpeff.cpp 10 Oct 2003 21:13:46 -0000 1.65
--- tmpeff.cpp 23 Nov 2003 15:09:45 -0000 1.66
***************
*** 117,121 ****
bool cTempEffect::loadFloat( unsigned int id, QString key, double &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'float'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
--- 117,121 ----
bool cTempEffect::loadFloat( unsigned int id, QString key, double &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND keyname = '%2' AND type = 'float'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
***************
*** 137,141 ****
bool cTempEffect::loadInt( unsigned int id, QString key, int &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'int'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
--- 137,141 ----
bool cTempEffect::loadInt( unsigned int id, QString key, int &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND keyname = '%2' AND type = 'int'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
***************
*** 157,161 ****
bool cTempEffect::loadString( unsigned int id, QString key, QString &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'string'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
--- 157,161 ----
bool cTempEffect::loadString( unsigned int id, QString key, QString &value )
{
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND keyname = '%2' AND type = 'string'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
if( !result.fetchrow() )
***************
*** 277,280 ****
--- 277,282 ----
cDBResult result = persistentBroker->query( "SELECT id,objectid,expiretime,dispellable,source,destination FROM effects ORDER BY expiretime ASC;" );
+ persistentBroker->driver()->setActiveConnection( CONN_SECOND );
+
while( result.fetchrow() )
{
***************
*** 298,305 ****
const char **res = (const char**)result.data(); // Skip id, objectid
effect->load( id, res );
!
insert( effect );
}
}
--- 300,310 ----
const char **res = (const char**)result.data(); // Skip id, objectid
+
effect->load( id, res );
!
insert( effect );
}
+ result.free();
+ persistentBroker->driver()->setActiveConnection();
}
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** world.cpp 29 Oct 2003 12:31:17 -0000 1.49
--- world.cpp 23 Nov 2003 15:09:46 -0000 1.50
***************
*** 319,326 ****
{ "effects_properties", "CREATE TABLE effects_properties (\
id int NOT NULL,\
! key varchar(64) NOT NULL,\
type varchar(64) NOT NULL,\
value text NOT NULL,\
! PRIMARY KEY (id,key)\
);" },
--- 319,326 ----
{ "effects_properties", "CREATE TABLE effects_properties (\
id int NOT NULL,\
! keyname varchar(64) NOT NULL,\
type varchar(64) NOT NULL,\
value text NOT NULL,\
! PRIMARY KEY (id,keyname)\
);" },
|