mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 08:27:46 +00:00
add batch land select to get all land + houses in 1 query
This commit is contained in:
parent
0fd3bf4194
commit
cb96c26c3e
3 changed files with 9 additions and 0 deletions
|
@ -212,6 +212,13 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements()
|
||||||
"SELECT * FROM land WHERE LandSetId = ?;",
|
"SELECT * FROM land WHERE LandSetId = ?;",
|
||||||
CONNECTION_SYNC );
|
CONNECTION_SYNC );
|
||||||
|
|
||||||
|
prepareStatement( LAND_SEL_BATCH,
|
||||||
|
"SELECT land.*, house.Welcome, house.Aetheryte, house.Comment, house.HouseName, house.BuildTime, house.Endorsements"
|
||||||
|
"FROM land"
|
||||||
|
"LEFT JOIN house"
|
||||||
|
"ON land.HouseId = house.HouseId;",
|
||||||
|
CONNECTION_SYNC );
|
||||||
|
|
||||||
/*prepareStatement( LAND_INS,
|
/*prepareStatement( LAND_INS,
|
||||||
"INSERT INTO land ( LandSetId ) VALUES ( ? );",
|
"INSERT INTO land ( LandSetId ) VALUES ( ? );",
|
||||||
CONNECTION_BOTH );
|
CONNECTION_BOTH );
|
||||||
|
|
|
@ -80,6 +80,7 @@ namespace Sapphire::Db
|
||||||
|
|
||||||
LAND_INS,
|
LAND_INS,
|
||||||
LAND_SEL,
|
LAND_SEL,
|
||||||
|
LAND_SEL_BATCH,
|
||||||
LAND_UP,
|
LAND_UP,
|
||||||
LANDSET_SEL,
|
LANDSET_SEL,
|
||||||
HOUSING_HOUSE_INS,
|
HOUSING_HOUSE_INS,
|
||||||
|
|
|
@ -139,6 +139,7 @@ void Sapphire::Land::loadItemContainerContents()
|
||||||
items[ containerId ].push_back( std::make_pair( slotId, itemId ) );
|
items[ containerId ].push_back( std::make_pair( slotId, itemId ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fuck the query off
|
||||||
res.reset();
|
res.reset();
|
||||||
|
|
||||||
for( auto it = items.begin(); it != items.end(); it++ )
|
for( auto it = items.begin(); it != items.end(); it++ )
|
||||||
|
|
Loading…
Add table
Reference in a new issue