Skip to content

Commit

Permalink
Drop ammoId from db
Browse files Browse the repository at this point in the history
  • Loading branch information
zergtmn committed May 16, 2011
1 parent 7b71e2e commit 15e426c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion sql/400/01_characters.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
alter table `characters`.`characters`
add column `power8` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power7`,
add column `power9` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power8`,
add column `power10` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power9`;
add column `power10` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power9`,
drop column `ammoId`;

alter table `characters`.`character_stats`
add column `maxpower8` int(10) UNSIGNED DEFAULT '0' NOT NULL after `maxpower7`,
Expand Down
1 change: 0 additions & 1 deletion sql/characters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ CREATE TABLE `characters` (
`activeSpec` tinyint(3) UNSIGNED NOT NULL default '0',
`exploredZones` longtext,
`equipmentCache` longtext,
`ammoId` int(10) UNSIGNED NOT NULL default '0',
`knownTitles` longtext,
`actionBars` tinyint(3) UNSIGNED NOT NULL default '0',
`deleteInfos_Account` int(11) UNSIGNED default NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/game/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool LoginQueryHolder::Initialize()
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost,"
"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", m_guid.GetCounter());
"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars FROM characters WHERE guid = '%u'", m_guid.GetCounter());
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT groupId FROM group_member WHERE memberGuid ='%u'", m_guid.GetCounter());
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", m_guid.GetCounter());
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'", m_guid.GetCounter());
Expand Down
14 changes: 6 additions & 8 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15308,8 +15308,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder )
//"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
// 39 40 41 42 43 44 45 46 47 48 49
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
//"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);

if(!result)
Expand Down Expand Up @@ -15360,7 +15360,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder )
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());

_LoadIntoDataField(fields[63].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
_LoadIntoDataField(fields[66].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
_LoadIntoDataField(fields[65].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);

InitDisplayIds(); // model, scale and model data

Expand All @@ -15387,10 +15387,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder )

//SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64());

//SetUInt32Value(PLAYER_AMMO_ID, fields[63].GetUInt32());

// Action bars state
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[67].GetUInt8());
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[66].GetUInt8());

// cleanup inventory related item value fields (its will be filled correctly in _LoadInventory)
for(uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
Expand Down Expand Up @@ -17153,15 +17151,15 @@ void Player::SaveToDB()
"trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, "
"death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, "
"todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, "
"power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) VALUES ("
"power4, power5, power6, power7, power8, power9, power10, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars) VALUES ("
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
"?, ?, ?, ?, ?, ?, "
"?, ?, ?, "
"?, ?, ?, ?, ?, ?, ?, "
"?, ?, ?, ?, ?, ?, ?, ?, ?, "
"?, ?, ?, ?, ?, ?, ?, "
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ");
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ");

uberInsert.addUInt32(GetGUIDLow());
uberInsert.addUInt32(GetSession()->GetAccountId());
Expand Down

1 comment on commit 15e426c

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on 15e426c May 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm, you need to fix the prepared statement Player.cpp:17280

Please sign in to comment.