Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv31853
Modified Files:
boats.cpp books.cpp corpse.cpp guildstones.cpp house.cpp
items.cpp items.h npc.cpp player.cpp resources.cpp uobject.cpp
wolfpack.cpp world.cpp
Log Message:
moved some properties from cItem to python
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -d -r1.109 -r1.110
*** boats.cpp 27 Aug 2003 20:35:09 -0000 1.109
--- boats.cpp 27 Aug 2003 23:20:55 -0000 1.110
***************
*** 1241,1245 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBoat' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cBoat", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cBoat", sqlString );
--- 1241,1245 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBoat' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cBoat", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cBoat", sqlString );
Index: books.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** books.cpp 27 Aug 2003 16:06:12 -0000 1.44
--- books.cpp 27 Aug 2003 23:20:56 -0000 1.45
***************
*** 54,58 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBook' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerSqlQuery( "cBook", sqlString );
--- 54,58 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBook' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerSqlQuery( "cBook", sqlString );
Index: corpse.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** corpse.cpp 27 Aug 2003 16:06:12 -0000 1.33
--- corpse.cpp 27 Aug 2003 23:20:56 -0000 1.34
***************
*** 57,61 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cCorpse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cCorpse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cCorpse", sqlString );
--- 57,61 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cCorpse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cCorpse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cCorpse", sqlString );
Index: guildstones.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/guildstones.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** guildstones.cpp 20 Aug 2003 17:10:48 -0000 1.75
--- guildstones.cpp 27 Aug 2003 23:20:56 -0000 1.76
***************
*** 172,176 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cGuildStone' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cGuildStone", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cGuildStone", sqlString );
--- 172,176 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cGuildStone' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cGuildStone", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cGuildStone", sqlString );
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** house.cpp 23 Aug 2003 15:20:29 -0000 1.112
--- house.cpp 27 Aug 2003 23:20:56 -0000 1.113
***************
*** 363,367 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cHouse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cHouse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cHouse", sqlString );
--- 363,367 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cHouse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cHouse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cHouse", sqlString );
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.339
retrieving revision 1.340
diff -C2 -d -r1.339 -r1.340
*** items.cpp 27 Aug 2003 21:43:57 -0000 1.339
--- items.cpp 27 Aug 2003 23:20:56 -0000 1.340
***************
*** 104,108 ****
this->morez_ = src.morez_;
this->amount_ = src.amount_;
- this->dye_ = src.dye_;
this->def_ = src.def_;
this->lodamage_=src.lodamage_;
--- 104,107 ----
***************
*** 120,124 ****
this->sellprice_ = src.sellprice_;
this->restock_ = src.restock_;
- this->disabled_ = src.disabled_;
this->poisoned_ = src.poisoned_;
this->time_unused=src.time_unused;
--- 119,122 ----
***************
*** 127,131 ****
this->setTags( src.tags() );
- this->accuracy_ = 100;
this->container_ = src.container_;
this->totalweight_ = src.totalweight_;
--- 125,128 ----
***************
*** 460,464 ****
addField("morez", morez_);
addField("amount", amount_);
- addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
addField("def", def_);
--- 457,460 ----
***************
*** 479,484 ****
addField("buyprice", buyprice_);
addField("restock", restock_);
- addField("disabled", disabled_);
- addField("accuracy", accuracy_);
addCondition( "serial", serial() );
--- 475,478 ----
***************
*** 592,596 ****
this->morez_=0;
this->amount_ = 1; // Amount of items in pile
- this->dye_=0; // Reserved: Can item be dyed by dye kit
this->def_=0; // Item defense
this->lodamage_=0; //Minimum Damage weapon inflicts
--- 586,589 ----
***************
*** 606,614 ****
// Everything decays by default.
this->priv_ = 0; // Bit 0, nodecay off/on. Bit 1, newbie item off/on. Bit 2 Dispellable
- this->disabled_ = 0; //Item is disabled, cant trigger.
this->poisoned_ = 0; //AntiChrist -- for poisoning skill
this->time_unused = 0;
this->timeused_last=getNormalizedTime();
- this->accuracy_ = 100;
}
--- 599,605 ----
***************
*** 1289,1295 ****
// <nodye />
else if( TagName == "dye" )
! this->setDye(1);
else if( TagName == "nodye" )
! this->setDye(0);
// <corpse />
--- 1280,1286 ----
// <nodye />
else if( TagName == "dye" )
! this->setDye( true );
else if( TagName == "nodye" )
! this->setDye( false );
// <corpse />
***************
*** 1959,1963 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cItem", sqlString );
--- 1950,1954 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cItem", sqlString );
***************
*** 1982,1986 ****
if( containerSerial != INVALID_SERIAL ) // if it's invalid, we won't set.
! container_ = (cUObject*)containerSerial;
// ugly optimization ends here.
--- 1973,1977 ----
if( containerSerial != INVALID_SERIAL ) // if it's invalid, we won't set.
! container_ = reinterpret_cast<cUObject*>(containerSerial);
// ugly optimization ends here.
***************
*** 1997,2001 ****
morez_ = atoi( result[offset++] );
amount_ = atoi( result[offset++] );
- dye_ = atoi( result[offset++] );
decaytime_ = atoi( result[offset++] );
if( decaytime_ > 0 )
--- 1988,1991 ----
***************
*** 2018,2023 ****
buyprice_ = atoi( result[offset++] );
restock_ = atoi( result[offset++] );
- disabled_ = atoi( result[offset++] );
- accuracy_ = atoi( result[offset++] );
// Their own weight should already be set.
--- 2008,2011 ----
***************
*** 2030,2034 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2018,2022 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2248,2252 ****
}
else SET_INT_PROPERTY( "antispamtimer", antispamtimer_ )
- else SET_INT_PROPERTY( "accuracy", accuracy_ )
else if( name == "container" )
--- 2236,2239 ----
***************
*** 2289,2293 ****
else SET_INT_PROPERTY( "morey", morey_ )
else SET_INT_PROPERTY( "morez", morez_ )
- else SET_INT_PROPERTY( "dye", dye_ )
else SET_INT_PROPERTY( "defense", def_ )
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2276,2279 ----
***************
*** 2317,2321 ****
else SET_INT_PROPERTY( "buyprice", buyprice_ )
else SET_INT_PROPERTY( "restock", restock_ )
- else SET_INT_PROPERTY( "disabled", disabled_ )
else SET_INT_PROPERTY( "poisoned", poisoned_ )
else SET_INT_PROPERTY( "incognito", incognito )
--- 2303,2306 ----
***************
*** 2374,2377 ****
--- 2359,2366 ----
return 0;
}
+ else if( name == "dye" )
+ {
+ setDye( value.toInt() != 0 ? true : false );
+ }
else if( name == "corpse" )
{
***************
*** 2405,2409 ****
else GET_PROPERTY( "totalweight", totalweight_ )
else GET_PROPERTY( "antispamtimer", (int)antispamtimer_ )
- else GET_PROPERTY( "accuracy", accuracy_ )
// container
--- 2394,2397 ----
***************
*** 2427,2431 ****
else GET_PROPERTY( "morey", (int)morey_ )
else GET_PROPERTY( "morez", (int)morez_ )
- else GET_PROPERTY( "dye", dye_ )
else GET_PROPERTY( "defense", (int)def_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2415,2418 ----
***************
*** 2439,2443 ****
else GET_PROPERTY( "sellprice", sellprice_ )
else GET_PROPERTY( "restock", restock_ )
- else GET_PROPERTY( "disabled", (int)disabled_ )
else GET_PROPERTY( "poisoned", (int)poisoned_ )
else GET_PROPERTY( "incognito", incognito ? 1 : 0 )
--- 2426,2429 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.175
retrieving revision 1.176
diff -C2 -d -r1.175 -r1.176
*** items.h 27 Aug 2003 21:43:57 -0000 1.175
--- items.h 27 Aug 2003 23:20:56 -0000 1.176
***************
*** 90,93 ****
--- 90,94 ----
SI16 hp() const { return hp_; } // Number of hitpoints an item has
SI16 maxhp() const { return maxhp_; } // Maximum number of hitpoints an item has
+ bool dye() const { return priv_&0x80; } // Can the item be dyed
bool corpse() const { return priv_&0x40; } // Is the item a corpse
bool newbie() const { return priv_&0x02; } // Is the Item Newbie
***************
*** 96,100 ****
int totalweight() const { return totalweight_; }
uint antispamtimer() const { return antispamtimer_;}
- ushort accuracy() const { return accuracy_; } // for weapons, could be used for certain tools too.
cUObject* container() const { return container_; }
int sellprice() const { return sellprice_; } // Price this item is being bought at by normal vendors
--- 97,100 ----
***************
*** 107,116 ****
uint morex() const { return morex_; }
uint morey() const { return morey_; }
! uint morez() const { return morez_; }
! uchar dye() const { return dye_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
- uint disabled() const { return disabled_; }
uint poisoned() const { return poisoned_; }
uchar visible() const { return visible_;}
--- 107,114 ----
uint morex() const { return morex_; }
uint morey() const { return morey_; }
! uint morez() const { return morez_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
uint poisoned() const { return poisoned_; }
uchar visible() const { return visible_;}
***************
*** 125,132 ****
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
! void setTwohanded( bool nValue ) { nValue ? priv_ &= 0x20 : priv_ |= 0xDF; flagChanged(); changed( TOOLTIP );};
void setType( UI32 nValue ) { type_ = nValue; flagChanged();};
void setType2( UI32 nValue ) { type2_ = nValue; flagChanged();};
! void setSecured( bool nValue ) { ( nValue ) ? priv_ &= 0x08 : priv_ |= 0xF7; flagChanged(); changed( TOOLTIP );};
void setSpeed( SI16 nValue ) { speed_ = nValue; flagChanged(); changed( TOOLTIP );};
void setHidamage( SI16 nValue ) { hidamage_ = nValue; flagChanged(); changed( TOOLTIP );};
--- 123,131 ----
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
! void setTwohanded( bool nValue ) { nValue ? priv_ |= 0x20 : priv_ &= 0xDF; flagChanged(); changed( TOOLTIP );};
! void setDye( bool nValue ) { nValue ? priv_ |= 0x80 : priv_ &= 0x7F; flagChanged();}
void setType( UI32 nValue ) { type_ = nValue; flagChanged();};
void setType2( UI32 nValue ) { type2_ = nValue; flagChanged();};
! void setSecured( bool nValue ) { ( nValue ) ? priv_ |= 0x08 : priv_ &= 0xF7; flagChanged(); changed( TOOLTIP );};
void setSpeed( SI16 nValue ) { speed_ = nValue; flagChanged(); changed( TOOLTIP );};
void setHidamage( SI16 nValue ) { hidamage_ = nValue; flagChanged(); changed( TOOLTIP );};
***************
*** 142,146 ****
void setTotalweight( int data );
void setAntispamtimer ( uint data ) { antispamtimer_ = data; flagChanged();}
- void setAccuracy( ushort data ) { accuracy_ = data; flagChanged();}
cItem();
--- 141,144 ----
***************
*** 159,163 ****
void setMoreY( uint data ) { morey_ = data; flagChanged();}
void setMoreZ( uint data ) { morez_ = data; flagChanged();}
- void setDye( uchar data ) { dye_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 157,160 ----
***************
*** 166,170 ****
void setSellprice( int data ) { sellprice_ = data; flagChanged(); changed( TOOLTIP );}
- void setDisabled(uint data) { disabled_ = data; flagChanged();}
void setPoisoned(uint data) { poisoned_ = data; flagChanged();}
void setVisible( uchar d ) { visible_ = d; flagChanged();}
--- 163,166 ----
***************
*** 273,277 ****
int totalweight_;
uint antispamtimer_;
- ushort accuracy_; // for weapons, could be used for certain tools too.
int sellprice_;
int buyprice_;
--- 269,272 ----
***************
*** 287,295 ****
uint morey_;
uint morez_;
- uchar dye_; // Reserved: Can item be dyed by dye kit
uint def_; // Item defense
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
uint decaytime_;
- uint disabled_; //Item is disabled, cant trigger.
uint poisoned_; //AntiChrist -- for poisoning skill
SERIAL ownserial_;
--- 282,288 ----
***************
*** 305,309 ****
// 5 | 20 | Twohanded
// 6 | 40 | Corpse
! // 7 | 80 | <unused>
uchar priv_;
};
--- 298,302 ----
// 5 | 20 | Twohanded
// 6 | 40 | Corpse
! // 7 | 80 | Dye
uchar priv_;
};
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** npc.cpp 27 Aug 2003 21:11:41 -0000 1.35
--- npc.cpp 27 Aug 2003 23:20:56 -0000 1.36
***************
*** 98,102 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cNPC' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cNPC", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cNPC", sqlString );
--- 98,102 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cNPC' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cNPC", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cNPC", sqlString );
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** player.cpp 27 Aug 2003 21:43:57 -0000 1.30
--- player.cpp 27 Aug 2003 23:20:56 -0000 1.31
***************
*** 91,95 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cPlayer' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cPlayer", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cPlayer", sqlString );
--- 91,95 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cPlayer' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cPlayer", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cPlayer", sqlString );
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** resources.cpp 27 Aug 2003 20:35:10 -0000 1.43
--- resources.cpp 27 Aug 2003 23:20:56 -0000 1.44
***************
*** 1461,1465 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cResourceItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cResourceItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cResourceItem", sqlString );
--- 1461,1465 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cResourceItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cResourceItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cResourceItem", sqlString );
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** uobject.cpp 27 Aug 2003 20:35:10 -0000 1.110
--- uobject.cpp 27 Aug 2003 23:20:56 -0000 1.111
***************
*** 116,120 ****
void cUObject::load( char **result, UINT16 &offset )
{
! name_ = result[offset++];
serial_ = atoi(result[offset++]);
multis_ = atoi(result[offset++]);
--- 116,121 ----
void cUObject::load( char **result, UINT16 &offset )
{
! name_ = result[offset] == 0 ? QString::null : result[offset];
! offset++;
serial_ = atoi(result[offset++]);
multis_ = atoi(result[offset++]);
***************
*** 211,214 ****
--- 212,216 ----
void cUObject::buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions )
{
+ // We are requiring fixed order by now, so this *is* possible
fields.push_back( "uobject.name,uobject.serial,uobject.multis,uobject.direction,uobject.pos_x,uobject.pos_y,uobject.pos_z,uobject.pos_map,uobject.events,uobject.bindmenu,uobject.havetags" );
tables.push_back( "uobject" );
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.444
retrieving revision 1.445
diff -C2 -d -r1.444 -r1.445
*** wolfpack.cpp 27 Aug 2003 21:43:57 -0000 1.444
--- wolfpack.cpp 27 Aug 2003 23:20:56 -0000 1.445
***************
*** 560,580 ****
#endif
*/
- /*clConsole.send( QString::number( sizeof cUObject ) + "\n" );
- clConsole.send( QString::number( sizeof cItem ) + "\n" );
-
- clConsole.send( "STARTING UP\n" );
- Sleep( 5000 );
-
- for( unsigned int x = 0; x < 100000; ++x )
- {
- cItem *pItem = new cItem;
- pItem->Init();
- }
-
- clConsole.send( "STARTING UP\n" );
- Sleep( 5000 );
-
- return 0;*/
-
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
--- 560,563 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** world.cpp 27 Aug 2003 21:43:57 -0000 1.32
--- world.cpp 27 Aug 2003 23:20:56 -0000 1.33
***************
*** 217,223 ****
//UINT32 sTime = getNormalizedTime();
- UINT16 offset;
cUObject *object;
-
progress_display progress( count );
--- 217,221 ----
***************
*** 226,234 ****
while( res.fetchrow() )
{
char **row = res.data();
// do something with data
! object = UObjectFactory::instance()->createObject( type );
! offset = 2; // Skip the first two fields
object->load( row, offset );
--- 224,232 ----
while( res.fetchrow() )
{
+ unsigned short offset = 0;
char **row = res.data();
// do something with data
! object = UObjectFactory::instance()->createObject( type );
object->load( row, offset );
|