diff options
| author | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
|---|---|---|
| committer | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
| commit | e47b96af3e3a41eae71e3e3da7eeee8bd3de86bc (patch) | |
| tree | 07d5ff1e6e39d792dbe1a89cc373c06702817787 /src/server/game/Entities | |
| parent | 06b46ba203d30cc5e2abc9741b2fc737ebdd7c38 (diff) | |
Core: Append single character to stream as character, not as a string
Diffstat (limited to 'src/server/game/Entities')
| -rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 48 | ||||
| -rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 36 | ||||
| -rwxr-xr-x | src/server/game/Entities/Item/Item.cpp | 8 | ||||
| -rwxr-xr-x | src/server/game/Entities/Object/Object.cpp | 2 | ||||
| -rwxr-xr-x | src/server/game/Entities/Pet/Pet.cpp | 36 | ||||
| -rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 184 |
6 files changed, 157 insertions, 157 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 40445dbc8fd..0896a6d603a 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -437,11 +437,11 @@ void Creature::Update(uint32 diff) switch(m_deathState) { case JUST_ALIVED: - // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. + // Must not be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: - // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. + // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry()); break; case DEAD: @@ -1052,7 +1052,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) dynamicflags = 0; } - // data->guid = guid don't must be update at save + // data->guid = guid must not be updated at save data.id = GetEntry(); data.mapid = mapid; data.phaseMask = phaseMask; @@ -1076,33 +1076,33 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.unit_flags = unit_flags; data.dynamicflags = dynamicflags; - // updated in DB + // update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); std::ostringstream ss; ss << "INSERT INTO creature VALUES (" - << m_DBTableGuid << ", " - << GetEntry() << ", " - << mapid <<", " - << uint32(spawnMask) << ", " // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ", " // prevent out of range error - << displayId <<", " - << GetEquipmentId() <<", " - << GetPositionX() << ", " - << GetPositionY() << ", " - << GetPositionZ() << ", " - << GetOrientation() << ", " - << m_respawnDelay << ", " //respawn time - << (float) m_respawnradius << ", " //spawn distance (float) - << (uint32) (0) << ", " //currentwaypoint - << GetHealth() << ", " //curhealth - << GetPower(POWER_MANA) << ", " //curmana - << GetDefaultMovementType() << ", " //default movement generator type - << npcflag << ", " - << unit_flags << ", " - << dynamicflags << ")"; + << m_DBTableGuid << ',' + << GetEntry() << ',' + << mapid << ',' + << uint32(spawnMask) << ',' // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ',' // prevent out of range error + << displayId << ',' + << GetEquipmentId() << ',' + << GetPositionX() << ',' + << GetPositionY() << ',' + << GetPositionZ() << ',' + << GetOrientation() << ',' + << m_respawnDelay << ',' //respawn time + << (float) m_respawnradius << ',' //spawn distance (float) + << (uint32) (0) << ',' //currentwaypoint + << GetHealth() << ',' //curhealth + << GetPower(POWER_MANA) << ',' //curmana + << GetDefaultMovementType() << ',' //default movement generator type + << npcflag << ',' + << unit_flags << ',' + << dynamicflags << ')'; trans->Append(ss.str().c_str()); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 10e7367bf0b..5d4eeb48111 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -668,7 +668,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // update in loaded data (changing data only in this place) GameObjectData& data = sObjectMgr->NewGOData(m_DBTableGuid); - // data->guid = guid don't must be update at save + // data->guid = guid must not be updated at save data.id = GetEntry(); data.mapid = mapid; data.phaseMask = phaseMask; @@ -686,25 +686,25 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.spawnMask = spawnMask; data.artKit = GetGoArtKit(); - // updated in DB + // update in DB std::ostringstream ss; ss << "INSERT INTO gameobject VALUES (" - << m_DBTableGuid << ", " - << GetEntry() << ", " - << mapid << ", " - << uint32(spawnMask) << ", " // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ", " // prevent out of range error - << GetPositionX() << ", " - << GetPositionY() << ", " - << GetPositionZ() << ", " - << GetOrientation() << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ", " - << m_respawnDelayTime << ", " - << uint32(GetGoAnimProgress()) << ", " - << uint32(GetGoState()) << ")"; + << m_DBTableGuid << ',' + << GetEntry() << ',' + << mapid << ',' + << uint32(spawnMask) << ',' // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ',' // prevent out of range error + << GetPositionX() << ',' + << GetPositionY() << ',' + << GetPositionZ() << ',' + << GetOrientation() << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ',' + << m_respawnDelayTime << ',' + << uint32(GetGoAnimProgress()) << ',' + << uint32(GetGoState()) << ')'; SQLTransaction trans = WorldDatabase.BeginTransaction(); trans->PAppend("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index fe99951eec8..0478bf6a71b 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -330,7 +330,7 @@ void Item::SaveToDB(SQLTransaction& trans) std::ostringstream ssSpells; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - ssSpells << GetSpellCharges(i) << " "; + ssSpells << GetSpellCharges(i) << ' '; stmt->setString(++index, ssSpells.str()); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_FLAGS)); @@ -338,9 +338,9 @@ void Item::SaveToDB(SQLTransaction& trans) std::ostringstream ssEnchants; for (uint8 i = 0; i < MAX_ENCHANTMENT_SLOT; ++i) { - ssEnchants << GetEnchantmentId(EnchantmentSlot(i)) << " "; - ssEnchants << GetEnchantmentDuration(EnchantmentSlot(i)) << " "; - ssEnchants << GetEnchantmentCharges(EnchantmentSlot(i)) << " "; + ssEnchants << GetEnchantmentId(EnchantmentSlot(i)) << ' '; + ssEnchants << GetEnchantmentDuration(EnchantmentSlot(i)) << ' '; + ssEnchants << GetEnchantmentCharges(EnchantmentSlot(i)) << ' '; } stmt->setString(++index, ssEnchants.str()); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f1567c4dadb..36961f99ef2 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -155,7 +155,7 @@ std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const { std::ostringstream ss; for (uint16 index = 0; index < size; ++index) - ss << GetUInt32Value(index + startIndex) << " "; + ss << GetUInt32Value(index + startIndex) << ' '; return ss.str(); } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index fc9d7f64545..0f8da71ccaa 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -402,30 +402,30 @@ void Pet::SavePetToDB(PetSaveMode mode) std::ostringstream ss; ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType) " << "VALUES (" - << m_charmInfo->GetPetNumber() << ", " - << GetEntry() << ", " - << owner << ", " - << GetNativeDisplayId() << ", " - << uint32(getLevel()) << ", " - << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ", " - << uint32(GetReactState()) << ", " + << m_charmInfo->GetPetNumber() << ',' + << GetEntry() << ',' + << owner << ',' + << GetNativeDisplayId() << ',' + << uint32(getLevel()) << ',' + << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ',' + << uint32(GetReactState()) << ',' << uint32(mode) << ", '" << name.c_str() << "', " - << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ", " - << curhealth << ", " - << curmana << ", " + << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ',' + << curhealth << ',' + << curmana << ',' << GetPower(POWER_HAPPINESS) << ", '"; for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i) { - ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << " " - << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << " "; + ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << ' ' + << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; }; ss << "', " - << time(NULL) << ", " - << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", " - << uint32(getPetType()) << ")"; + << time(NULL) << ',' + << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ',' + << uint32(getPetType()) << ')'; trans->Append(ss.str().c_str()); CharacterDatabase.CommitTransaction(trans); @@ -1640,7 +1640,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) uint32 id = fields[0].GetUInt32(); if (need_comma) - ss << ", "; + ss << ','; ss << id; @@ -1661,7 +1661,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) continue; if (need_execute) - ss << ", "; + ss << ','; ss << spell; @@ -1672,7 +1672,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) if (!need_execute) return; - ss << ")"; + ss << ')'; CharacterDatabase.Execute(ss.str().c_str()); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c293aef5f71..06ca30bf9cb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -258,7 +258,7 @@ std::string PlayerTaxi::SaveTaxiDestinationsToString() std::ostringstream ss; for (size_t i=0; i < m_TaxiDestinations.size(); ++i) - ss << m_TaxiDestinations[i] << " "; + ss << m_TaxiDestinations[i] << ' '; return ss.str(); } @@ -278,10 +278,10 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) { - ss << "'"; + ss << '\''; for (uint8 i = 0; i < TaxiMaskSize; ++i) - ss << taxi.m_taximask[i] << " "; - ss << "'"; + ss << taxi.m_taximask[i] << ' '; + ss << '\''; return ss; } @@ -4288,8 +4288,8 @@ void Player::_SaveSpellCooldowns(SQLTransaction& trans) } // next new/changed record prefix else - ss << ", "; - ss << "(" << GetGUIDLow() << ", " << itr->first << ", " << itr->second.itemid << ", " << uint64(itr->second.end) << ")"; + ss << ','; + ss << '(' << GetGUIDLow() << ',' << itr->first << ',' << itr->second.itemid << ',' << uint64(itr->second.end) << ')'; ++itr; } else @@ -11895,7 +11895,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update // save data std::ostringstream ss; for (AllowedLooterSet::iterator itr = allowedLooters->begin(); itr != allowedLooters->end(); ++itr) - ss << *itr << " "; + ss << *itr << ' '; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ITEM_BOP_TRADE); stmt->setUInt32(0, pItem->GetGUIDLow()); @@ -18187,118 +18187,118 @@ void Player::SaveToDB() "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " "power4, power5, power6, power7, latency, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) VALUES (" - << GetGUIDLow() << ", " + << GetGUIDLow() << ',' << GetSession()->GetAccountId() << ", '" << sql_name << "', " - << uint32(getRace()) << ", " - << uint32(getClass()) << ", " - << uint32(getGender()) << ", " - << uint32(getLevel()) << ", " - << GetUInt32Value(PLAYER_XP) << ", " - << GetMoney() << ", " - << GetUInt32Value(PLAYER_BYTES) << ", " - << GetUInt32Value(PLAYER_BYTES_2) << ", " - << GetUInt32Value(PLAYER_FLAGS) << ", "; + << uint32(getRace()) << ',' + << uint32(getClass()) << ',' + << uint32(getGender()) << ',' + << uint32(getLevel()) << ',' + << GetUInt32Value(PLAYER_XP) << ',' + << GetMoney() << ',' + << GetUInt32Value(PLAYER_BYTES) << ',' + << GetUInt32Value(PLAYER_BYTES_2) << ',' + << GetUInt32Value(PLAYER_FLAGS) << ','; if (!IsBeingTeleported()) { - ss << GetMapId() << ", " - << (uint32)GetInstanceId() << ", " - << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ", " - << finiteAlways(GetPositionX()) << ", " - << finiteAlways(GetPositionY()) << ", " - << finiteAlways(GetPositionZ()) << ", " - << finiteAlways(GetOrientation()) << ", "; + ss << GetMapId() << ',' + << (uint32)GetInstanceId() << ',' + << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ',' + << finiteAlways(GetPositionX()) << ',' + << finiteAlways(GetPositionY()) << ',' + << finiteAlways(GetPositionZ()) << ',' + << finiteAlways(GetOrientation()) << ','; } else { - ss << GetTeleportDest().GetMapId() << ", " - << (uint32)0 << ", " - << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ", " - << finiteAlways(GetTeleportDest().GetPositionX()) << ", " - << finiteAlways(GetTeleportDest().GetPositionY()) << ", " - << finiteAlways(GetTeleportDest().GetPositionZ()) << ", " - << finiteAlways(GetTeleportDest().GetOrientation()) << ", "; + ss << GetTeleportDest().GetMapId() << ',' + << (uint32)0 << ',' + << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ',' + << finiteAlways(GetTeleportDest().GetPositionX()) << ',' + << finiteAlways(GetTeleportDest().GetPositionY()) << ',' + << finiteAlways(GetTeleportDest().GetPositionZ()) << ',' + << finiteAlways(GetTeleportDest().GetOrientation()) << ','; } - ss << m_taxi << ", "; // string with TaxiMaskSize numbers + ss << m_taxi << ','; // string with TaxiMaskSize numbers - ss << (IsInWorld() ? 1 : 0) << ", "; + ss << (IsInWorld() ? 1 : 0) << ','; - ss << uint32(m_cinematic) << ", "; + ss << uint32(m_cinematic) << ','; - ss << m_Played_time[PLAYED_TIME_TOTAL] << ", "; - ss << m_Played_time[PLAYED_TIME_LEVEL] << ", "; + ss << m_Played_time[PLAYED_TIME_TOTAL] << ','; + ss << m_Played_time[PLAYED_TIME_LEVEL] << ','; - ss << finiteAlways(m_rest_bonus) << ", "; - ss << uint32(time(NULL)) << ", "; - ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", "; + ss << finiteAlways(m_rest_bonus) << ','; + ss << uint32(time(NULL)) << ','; + ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ','; //save, far from tavern/city //save, but in tavern/city - ss << m_resetTalentsCost << ", "; - ss << uint32(m_resetTalentsTime) << ", "; + ss << m_resetTalentsCost << ','; + ss << uint32(m_resetTalentsTime) << ','; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionX()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionY()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionZ()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetOrientation()) << ", "; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionX()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionY()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionZ()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetOrientation()) << ','; if (m_transport) ss << m_transport->GetGUIDLow(); else - ss << "0"; - ss << ", "; + ss << '0'; + ss << ','; - ss << m_ExtraFlags << ", "; + ss << m_ExtraFlags << ','; - ss << uint32(m_stableSlots) << ", "; // to prevent save uint8 as char + ss << uint32(m_stableSlots) << ','; // to prevent save uint8 as char - ss << uint32(m_atLoginFlags) << ", "; + ss << uint32(m_atLoginFlags) << ','; - ss << GetZoneId() << ", "; + ss << GetZoneId() << ','; ss << uint32(m_deathExpireTime) << ", '"; ss << m_taxi.SaveTaxiDestinationsToString() << "', "; - ss << GetArenaPoints() << ", "; + ss << GetArenaPoints() << ','; - ss << GetHonorPoints() << ", "; + ss << GetHonorPoints() << ','; - ss << GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION) << ','; - ss << GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION) << ','; - ss << GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) << ','; - ss << GetUInt16Value(PLAYER_FIELD_KILLS, 0) << ", "; + ss << GetUInt16Value(PLAYER_FIELD_KILLS, 0) << ','; - ss << GetUInt16Value(PLAYER_FIELD_KILLS, 1) << ", "; + ss << GetUInt16Value(PLAYER_FIELD_KILLS, 1) << ','; - ss << GetUInt32Value(PLAYER_CHOSEN_TITLE) << ", "; + ss << GetUInt32Value(PLAYER_CHOSEN_TITLE) << ','; - ss << GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES) << ", "; + ss << GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES) << ','; - ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ','; - ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ", "; + ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ','; ss << GetHealth(); for (uint32 i = 0; i < MAX_POWERS; ++i) - ss << ", " << GetPower(Powers(i)); - ss << ", "; + ss << ',' << GetPower(Powers(i)); + ss << ','; ss << GetSession()->GetLatency(); - ss << ", "; + ss << ','; ss << uint32(m_specsCount); - ss << ", "; + ss << ','; ss << uint32(m_activeSpec) << ", '"; for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) - ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << " "; + ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << ' '; // cache equipment... ss << "', '"; for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) - ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << " "; + ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' '; // ...and bags for enum opcode for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -18306,19 +18306,19 @@ void Player::SaveToDB() if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) ss << item->GetEntry(); else - ss << "0"; + ss << '0'; ss << " 0 "; } - ss << "', "; + ss << "',"; ss << GetUInt32Value(PLAYER_AMMO_ID) << ", '"; for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) - ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << " "; + ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << ' '; - ss << "', "; + ss << "',"; ss << uint32(GetByteValue(PLAYER_FIELD_BYTES, 2)); - ss << ")"; + ss << ')'; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -18785,25 +18785,25 @@ void Player::_SaveStats(SQLTransaction& trans) ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, " "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" - << GetGUIDLow() << ", " - << GetMaxHealth() << ", "; + << GetGUIDLow() << ',' + << GetMaxHealth() << ','; for (uint8 i = 0; i < MAX_POWERS; ++i) - ss << GetMaxPower(Powers(i)) << ", "; + ss << GetMaxPower(Powers(i)) << ','; for (uint8 i = 0; i < MAX_STATS; ++i) - ss << GetStat(Stats(i)) << ", "; + ss << GetStat(Stats(i)) << ','; // armor + school resistances for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) - ss << GetResistance(SpellSchools(i)) << ", "; - ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ", " - << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ", " - << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ", " - << GetBaseSpellPowerBonus() << ", " - << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ")"; + ss << GetResistance(SpellSchools(i)) << ','; + ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ',' + << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ',' + << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ',' + << GetBaseSpellPowerBonus() << ',' + << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ')'; trans->Append(ss.str().c_str()); } @@ -18878,10 +18878,10 @@ void Player::SendAttackSwingNotInRange() void Player::SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid) { std::ostringstream ss; - ss << "UPDATE characters SET position_x='"<<x<<"', position_y='"<<y - << "', position_z='"<<z<<"', orientation='"<<o<<"', map='"<<mapid - << "', zone='"<<zone<<"', trans_x='0', trans_y='0', trans_z='0', " - << "transguid='0', taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'"; + ss << "UPDATE characters SET position_x='" << x << "', position_y='" << y + << "', position_z='" << z << "', orientation='" << o << "', map='" << mapid + << "', zone='" << zone << "', trans_x='0', trans_y='0', trans_z='0', " + << "transguid='0', taxi_path='' WHERE guid='" << GUID_LOPART(guid) << '\''; sLog->outDebug(LOG_FILTER_UNITS, "%s", ss.str().c_str()); CharacterDatabase.Execute(ss.str().c_str()); } |
