mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[0096] Fixed up and cleaned up SMSG_CHAR_ENUM, implemented characters reordering
Signed-off-by: Yaki Khadafi <ElSolDolLo@gmail.com>
This commit is contained in:
parent
bd210e4097
commit
c30587a0a6
9 changed files with 139 additions and 169 deletions
|
|
@ -1,3 +1,3 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_0028_xxxxx_01_characters_character_phase_data required_0096_xxxxx_01_characters_characters bit;
|
||||
ALTER TABLE db_version CHANGE COLUMN required_0028_xxxxx_01_characters_character_phase_data required_0096_xxxxx_01_characters_characters bit;
|
||||
|
||||
ALTER TABLE `characters` ADD COLUMN `slot` tinyint(3) unsigned NOT NULL DEFAULT '255' AFTER `actionBars`;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,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, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars FROM characters WHERE guid = '%u'", m_guid.GetCounter());
|
||||
"health, power1, power2, power3, power4, power5, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars, slot 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());
|
||||
|
|
@ -137,109 +137,33 @@ class CharacterHandler
|
|||
}
|
||||
} chrHandler;
|
||||
|
||||
struct charEnumInfo
|
||||
{
|
||||
uint8 nameLenghts;
|
||||
bool firstLogin;
|
||||
};
|
||||
|
||||
void WorldSession::HandleCharEnum(QueryResult * result)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_ENUM, 270);
|
||||
|
||||
uint8 charCount = 0;
|
||||
ByteBuffer buffer;
|
||||
|
||||
data.WriteBits(0, 23);
|
||||
data.WriteBit(1);
|
||||
data.WriteBits(result ? (*result).GetRowCount() : 0 , 17);
|
||||
|
||||
std::vector<charEnumInfo> charInfoList;
|
||||
charInfoList.resize(result ? (*result).GetRowCount() : 0);
|
||||
data.WriteBits(result ? result->GetRowCount() : 0, 17);
|
||||
|
||||
if (result)
|
||||
{
|
||||
typedef std::pair<uint64, uint64> Guids;
|
||||
std::vector<Guids> guidsVect;
|
||||
_allowedCharsToLogin.clear();
|
||||
|
||||
do
|
||||
{
|
||||
uint32 GuidLow = (*result)[0].GetUInt32();
|
||||
uint32 atLoginFlags = (*result)[15].GetUInt32();
|
||||
uint64 GuildGuid = (*result)[13].GetUInt64();
|
||||
sLog.outDetail("Loading char guid %u from account %u.", (*result)[0].GetUInt32(), GetAccountId());
|
||||
|
||||
charEnumInfo charInfo = charEnumInfo();
|
||||
std::string name = (*result)[1].GetString();
|
||||
uint32 nameLen = name.length();
|
||||
charInfo.nameLenghts = nameLen;
|
||||
charInfo.firstLogin = atLoginFlags & AT_LOGIN_FIRST ? true : false;
|
||||
charInfoList[charCount] = charInfo;
|
||||
charCount++;
|
||||
|
||||
guidsVect.push_back(std::make_pair(GuidLow, atLoginFlags));
|
||||
|
||||
sLog.outDetail("Loading char guid %u from account %u.", GuidLow, GetAccountId());
|
||||
|
||||
if (!Player::BuildEnumData(result, &buffer))
|
||||
if (!Player::BuildEnumData(result, &data, &buffer))
|
||||
{
|
||||
sLog.outError("Building enum data for SMSG_CHAR_ENUM has failed, aborting");
|
||||
return;
|
||||
}
|
||||
_allowedCharsToLogin.insert(GuidLow);
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
int counter = 0;
|
||||
for (std::vector<Guids>::iterator itr = guidsVect.begin(); itr != guidsVect.end(); ++itr)
|
||||
{
|
||||
uint32 Guid = (*itr).first;
|
||||
uint64 GuildGuid = (*itr).second;
|
||||
|
||||
uint8 Guid0 = uint8(Guid);
|
||||
uint8 Guid1 = uint8(Guid >> 8);
|
||||
uint8 Guid2 = uint8(Guid >> 16);
|
||||
uint8 Guid3 = uint8(Guid >> 24);
|
||||
|
||||
for (int i = 0; i < 18; ++i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 14:
|
||||
data.WriteBit(Guid0 ? 1 : 0);
|
||||
break;
|
||||
case 10:
|
||||
data.WriteBit(Guid1 ? 1 : 0);
|
||||
break;
|
||||
case 15:
|
||||
data.WriteBit(Guid2 ? 1 : 0);
|
||||
break;
|
||||
case 0:
|
||||
data.WriteBit(Guid3 ? 1 : 0);
|
||||
break;
|
||||
case 4:
|
||||
data.WriteBits(charInfoList[counter].nameLenghts, 7);
|
||||
break;
|
||||
case 13:
|
||||
data.WriteBit(charInfoList[counter].firstLogin ? 1 : 0);
|
||||
break;
|
||||
default:
|
||||
data.WriteBit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
|
||||
data.FlushBits();
|
||||
data.append(buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.WriteBit(1);
|
||||
data.FlushBits();
|
||||
}
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
@ -254,8 +178,8 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket& /*recv_data*/)
|
|||
"SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
// 8 9 10 11 12 13 14
|
||||
"characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
|
||||
// 15 16 17 18 19
|
||||
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache "
|
||||
// 15 16 17 18 19 20
|
||||
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, characters.slot "
|
||||
"FROM characters LEFT JOIN character_pet ON characters.guid=character_pet.owner AND character_pet.slot='%u' "
|
||||
"LEFT JOIN guild_member ON characters.guid = guild_member.guid "
|
||||
"WHERE characters.account = '%u' ORDER BY characters.guid"
|
||||
|
|
@ -265,8 +189,8 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket& /*recv_data*/)
|
|||
"SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
// 8 9 10 11 12 13 14
|
||||
"characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
|
||||
// 15 16 17 18 19 20
|
||||
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, character_declinedname.genitive "
|
||||
// 15 16 17 18 19 20 21
|
||||
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, characters.slot, character_declinedname.genitive "
|
||||
"FROM characters LEFT JOIN character_pet ON characters.guid = character_pet.owner AND character_pet.slot='%u' "
|
||||
"LEFT JOIN character_declinedname ON characters.guid = character_declinedname.guid "
|
||||
"LEFT JOIN guild_member ON characters.guid = guild_member.guid "
|
||||
|
|
@ -1438,3 +1362,38 @@ void WorldSession::HandleEquipmentSetUseOpcode(WorldPacket& recv_data)
|
|||
data << uint8(0); // 4 - equipment swap failed - inventory is full
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleReorderCharactersOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
uint32 charCount = recv_data.ReadBits(10);
|
||||
|
||||
if (charCount > sWorld.getConfig(CONFIG_UINT32_CHARACTERS_PER_REALM))
|
||||
{
|
||||
DEBUG_LOG("SESSION: received CMSG_REORDER_CHARACTERS, but characters count %u is beyond server limit.", charCount);
|
||||
recv_data.rfinish();
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<ObjectGuid> guids;
|
||||
std::vector<uint8> slots;
|
||||
|
||||
for (uint32 i = 0; i < charCount; ++i)
|
||||
{
|
||||
ObjectGuid guid;
|
||||
recv_data.ReadGuidMask<1, 4, 5, 3, 0, 7, 6, 2>(guid);
|
||||
guids.push_back(guid);
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < charCount; ++i)
|
||||
{
|
||||
recv_data.ReadGuidBytes<6, 5, 1, 4, 0, 3>(guids[i]);
|
||||
slots.push_back(recv_data.ReadUInt8());
|
||||
recv_data.ReadGuidBytes<2, 7>(guids[i]);
|
||||
}
|
||||
|
||||
CharacterDatabase.BeginTransaction();
|
||||
for (uint32 i = 0; i < charCount; ++i)
|
||||
CharacterDatabase.PExecute("UPDATE `characters` SET `slot` = '%u' WHERE `guid` = '%u' AND `account` = '%u'",
|
||||
slots[i], guids[i].GetCounter(), GetAccountId());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1380,4 +1380,5 @@ void InitializeOpcodes()
|
|||
//OPCODE(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//OPCODE(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
OPCODE(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
OPCODE(CMSG_REORDER_CHARACTERS, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReorderCharactersOpcode );
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1398,6 +1398,7 @@ enum Opcodes
|
|||
SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x59A1, // 4.3.4 15595
|
||||
SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x78B5, // 4.3.4 15595
|
||||
SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x34A5, // 4.3.4 15595
|
||||
CMSG_REORDER_CHARACTERS = 0x0593, // 4.3.4 15595
|
||||
};
|
||||
|
||||
#define MAX_OPCODE_TABLE_SIZE 0xFFFF
|
||||
|
|
|
|||
|
|
@ -570,6 +570,8 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_
|
|||
m_lastFallZ = 0;
|
||||
|
||||
m_cachedGS = 0;
|
||||
|
||||
m_slot = 255;
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
|
|
@ -1452,22 +1454,31 @@ void Player::SetDeathState(DeathState s)
|
|||
}
|
||||
}
|
||||
|
||||
bool Player::BuildEnumData( QueryResult * result, ByteBuffer * p_data )
|
||||
bool Player::BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* buffer)
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
// 8 9 10 11 12 13 14
|
||||
// "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
|
||||
// 15 16 17 18 19 20
|
||||
// "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, character_declinedname.genitive "
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
uint32 Guid = fields[0].GetUInt32();
|
||||
uint64 GuildGuid = fields[13].GetUInt64();
|
||||
// 15 16 17 18 19 20 21
|
||||
// "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, characters.slot, character_declinedname.genitive "
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
ObjectGuid guid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());
|
||||
uint8 pRace = fields[2].GetUInt8();
|
||||
uint8 pClass = fields[3].GetUInt8();
|
||||
|
||||
PlayerInfo const* info = sObjectMgr.GetPlayerInfo(pRace, pClass);
|
||||
if (!info)
|
||||
{
|
||||
sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
//ObjectGuid guildGuid = ObjectGuid(HIGHGUID_GUILD, fields[13].GetUInt32());
|
||||
ObjectGuid guildGuid = ObjectGuid(uint64(fields[13].GetUInt32()));
|
||||
std::string name = fields[1].GetCppString();
|
||||
uint8 gender = fields[4].GetUInt8();
|
||||
uint32 playerBytes = fields[5].GetUInt32();
|
||||
uint8 level = fields[7].GetUInt8();
|
||||
|
|
@ -1479,10 +1490,18 @@ bool Player::BuildEnumData( QueryResult * result, ByteBuffer * p_data )
|
|||
uint32 petFamily = 0;
|
||||
uint32 char_flags = 0;
|
||||
|
||||
uint8 Guid0 = uint8(Guid);
|
||||
uint8 Guid1 = uint8(Guid >> 8);
|
||||
uint8 Guid2 = uint8(Guid >> 16);
|
||||
uint8 Guid3 = uint8(Guid >> 24);
|
||||
data->WriteGuidMask<3>(guid);
|
||||
data->WriteGuidMask<1, 7, 2>(guildGuid);
|
||||
data->WriteBits(name.length(), 7);
|
||||
data->WriteGuidMask<4, 7>(guid);
|
||||
data->WriteGuidMask<3>(guildGuid);
|
||||
data->WriteGuidMask<5>(guid);
|
||||
data->WriteGuidMask<6>(guildGuid);
|
||||
data->WriteGuidMask<1>(guid);
|
||||
data->WriteGuidMask<5, 4>(guildGuid);
|
||||
data->WriteBit(atLoginFlags & AT_LOGIN_FIRST);
|
||||
data->WriteGuidMask<0, 2, 6>(guid);
|
||||
data->WriteGuidMask<0>(guildGuid);
|
||||
|
||||
// show pet at selection character in character list only for non-ghost character
|
||||
if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (pClass == CLASS_WARLOCK || pClass == CLASS_HUNTER || pClass == CLASS_DEATH_KNIGHT))
|
||||
|
|
@ -1507,39 +1526,31 @@ bool Player::BuildEnumData( QueryResult * result, ByteBuffer * p_data )
|
|||
char_flags |= CHARACTER_FLAG_RENAME;
|
||||
if(sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED))
|
||||
{
|
||||
if(!fields[20].GetCppString().empty())
|
||||
if(!fields[21].GetCppString().empty())
|
||||
char_flags |= CHARACTER_FLAG_DECLINED;
|
||||
}
|
||||
else
|
||||
char_flags |= CHARACTER_FLAG_DECLINED;
|
||||
|
||||
*buffer << uint8(pClass); // class
|
||||
|
||||
PlayerInfo const *info = sObjectMgr.GetPlayerInfo(pRace, pClass);
|
||||
if(!info)
|
||||
{
|
||||
sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", Guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
*p_data << uint8(pClass); // Race
|
||||
|
||||
Tokens data = StrSplit(fields[19].GetCppString(), " ");
|
||||
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; slot++)
|
||||
Tokens tdata = StrSplit(fields[19].GetCppString(), " ");
|
||||
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot)
|
||||
{
|
||||
uint32 visualbase = slot * 2;
|
||||
uint32 item_id = GetUInt32ValueFromArray(data, visualbase);
|
||||
uint32 item_id = GetUInt32ValueFromArray(tdata, visualbase);
|
||||
const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id);
|
||||
if(!proto)
|
||||
{
|
||||
*p_data << uint8(0);
|
||||
*p_data << uint32(0);
|
||||
*p_data << uint32(0);
|
||||
*buffer << uint8(0);
|
||||
*buffer << uint32(0);
|
||||
*buffer << uint32(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellItemEnchantmentEntry const *enchant = NULL;
|
||||
|
||||
uint32 enchants = GetUInt32ValueFromArray(data, visualbase + 1);
|
||||
uint32 enchants = GetUInt32ValueFromArray(tdata, visualbase + 1);
|
||||
for(uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot)
|
||||
{
|
||||
// values stored in 2 uint16
|
||||
|
|
@ -1551,56 +1562,56 @@ bool Player::BuildEnumData( QueryResult * result, ByteBuffer * p_data )
|
|||
break;
|
||||
}
|
||||
|
||||
*p_data << uint8(proto->InventoryType);
|
||||
*p_data << uint32(proto->DisplayInfoID);
|
||||
*p_data << uint32(enchant ? enchant->aura_id : 0);
|
||||
*buffer << uint8(proto->InventoryType);
|
||||
*buffer << uint32(proto->DisplayInfoID);
|
||||
*buffer << uint32(enchant ? enchant->aura_id : 0);
|
||||
}
|
||||
|
||||
for (int32 i = 0; i < 4; i++)
|
||||
{
|
||||
*p_data << uint8(0);
|
||||
*p_data << uint32(0);
|
||||
*p_data << uint32(0);
|
||||
*buffer << uint8(0);
|
||||
*buffer << uint32(0);
|
||||
*buffer << uint32(0);
|
||||
}
|
||||
|
||||
*p_data << uint32(petDisplayId); // Pet DisplayID
|
||||
*p_data << uint8(0); // char order id
|
||||
*p_data << uint8(playerBytes >> 16); // Hair style
|
||||
*p_data << uint32(petDisplayId); // Pet DisplayID
|
||||
*p_data << uint32(char_flags); // character flags
|
||||
*p_data << uint8(playerBytes >> 24); // Hair color
|
||||
*p_data << uint32(fields[9].GetUInt32()); // map
|
||||
*p_data << fields[12].GetFloat(); // z
|
||||
*p_data << uint32(petLevel); // pet level
|
||||
|
||||
if (Guid3)
|
||||
*p_data << uint8(Guid3 ^ 1);
|
||||
|
||||
*p_data << fields[11].GetFloat(); // y
|
||||
*buffer << uint32(petFamily); // Pet DisplayID
|
||||
buffer->WriteGuidBytes<2>(guildGuid);
|
||||
*buffer << uint8(fields[20].GetUInt8()); // char order id
|
||||
*buffer << uint8((playerBytes >> 16) & 0xFF); // Hair style
|
||||
buffer->WriteGuidBytes<3>(guildGuid);
|
||||
*buffer << uint32(petDisplayId); // Pet DisplayID
|
||||
*buffer << uint32(char_flags); // character flags
|
||||
*buffer << uint8((playerBytes >> 24) & 0xFF); // Hair color
|
||||
buffer->WriteGuidBytes<4>(guid);
|
||||
*buffer << uint32(fields[9].GetUInt32()); // map
|
||||
buffer->WriteGuidBytes<5>(guildGuid);
|
||||
*buffer << fields[12].GetFloat(); // z
|
||||
buffer->WriteGuidBytes<6>(guildGuid);
|
||||
*buffer << uint32(petLevel); // pet level
|
||||
buffer->WriteGuidBytes<3>(guid);
|
||||
*buffer << fields[11].GetFloat(); // y
|
||||
// character customize flags
|
||||
*p_data << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? CHAR_CUSTOMIZE_FLAG_CUSTOMIZE : CHAR_CUSTOMIZE_FLAG_NONE);
|
||||
*buffer << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? CHAR_CUSTOMIZE_FLAG_CUSTOMIZE : CHAR_CUSTOMIZE_FLAG_NONE);
|
||||
|
||||
uint32 playerBytes2 = fields[6].GetUInt32();
|
||||
*p_data << uint8(playerBytes2 & 0xFF); // facial hair
|
||||
*p_data << uint8(gender); // Gender
|
||||
p_data->append(fields[1].GetCppString().c_str(), fields[1].GetCppString().size());
|
||||
*p_data << uint8(playerBytes >> 8); // face
|
||||
*buffer << uint8(playerBytes2 & 0xFF); // facial hair
|
||||
buffer->WriteGuidBytes<7>(guid);
|
||||
*buffer << uint8(gender); // Gender
|
||||
buffer->append(name.c_str(), name.length());
|
||||
*buffer << uint8((playerBytes >> 8) & 0xFF); // face
|
||||
|
||||
if (Guid0)
|
||||
*p_data << uint8(Guid0 ^ 1);
|
||||
buffer->WriteGuidBytes<0, 2>(guid);
|
||||
buffer->WriteGuidBytes<1, 7>(guildGuid);
|
||||
|
||||
if (Guid2)
|
||||
*p_data << uint8(Guid2 ^ 1);
|
||||
*buffer << fields[10].GetFloat(); // x
|
||||
*buffer << uint8(playerBytes & 0xFF); // skin
|
||||
*buffer << uint8(pRace); // Race
|
||||
*buffer << uint8(level); // Level
|
||||
buffer->WriteGuidBytes<6>(guid);
|
||||
buffer->WriteGuidBytes<4, 0>(guildGuid);
|
||||
buffer->WriteGuidBytes<5, 1>(guid);
|
||||
|
||||
*p_data << fields[10].GetFloat(); // x
|
||||
*p_data << uint8(playerBytes); // skin
|
||||
*p_data << uint8(pRace); // Race
|
||||
*p_data << uint8(level); // Level
|
||||
|
||||
if (Guid1)
|
||||
*p_data << uint8(Guid1 ^ 1);
|
||||
|
||||
*p_data << uint32(zone); // Zone id
|
||||
*buffer << uint32(zone); // Zone id
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -15643,8 +15654,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
|
||||
//"health, power1, power2, power3, power4, power5, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
// 50 51 52 53 54 55 56 57 58 59 60 61 62
|
||||
//"health, power1, power2, power3, power4, power5, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars, slot FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
|
||||
if (!result)
|
||||
|
|
@ -15725,6 +15736,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
|
|||
// Action bars state
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[61].GetUInt8());
|
||||
|
||||
m_slot = fields[62].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)
|
||||
{
|
||||
|
|
@ -17497,7 +17510,7 @@ 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, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars) "
|
||||
"power4, power5, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars, slot) "
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
|
||||
"?, ?, ?, ?, ?, ?, "
|
||||
"?, ?, ?, "
|
||||
|
|
@ -17505,7 +17518,7 @@ void Player::SaveToDB()
|
|||
"?, ?, ?, ?, ?, ?, ?, ?, ?, "
|
||||
"?, ?, ?, ?, ?, ?, ?, "
|
||||
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
|
||||
"?, ?, ?, ?, ?, ?, ?, ?) ");
|
||||
"?, ?, ?, ?, ?, ?, ?, ?, ?) ");
|
||||
|
||||
uberInsert.addUInt32(GetGUIDLow());
|
||||
uberInsert.addUInt32(GetSession()->GetAccountId());
|
||||
|
|
@ -17632,6 +17645,8 @@ void Player::SaveToDB()
|
|||
|
||||
uberInsert.addUInt32(uint32(GetByteValue(PLAYER_FIELD_BYTES, 2)));
|
||||
|
||||
uberInsert.addUInt8(m_slot);
|
||||
|
||||
uberInsert.Execute();
|
||||
|
||||
if (m_mailsUpdated) // save mails only when needed
|
||||
|
|
|
|||
|
|
@ -1065,7 +1065,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
|
||||
void Update(uint32 update_diff, uint32 time) override;
|
||||
|
||||
static bool BuildEnumData(QueryResult* result, ByteBuffer* p_data );
|
||||
static bool BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* buffer);
|
||||
|
||||
void SetInWater(bool apply);
|
||||
|
||||
|
|
@ -2589,6 +2589,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
DeclinedName* m_declinedname;
|
||||
Runes* m_runes;
|
||||
EquipmentSets m_EquipmentSets;
|
||||
uint8 m_slot;
|
||||
|
||||
/// class dependent melee diminishing constant for dodge/parry/missed chances
|
||||
static const float m_diminishing_k[MAX_CLASSES];
|
||||
|
|
|
|||
|
|
@ -411,6 +411,7 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void HandlePlayerLoginOpcode(WorldPacket& recvPacket);
|
||||
void HandleCharEnum(QueryResult* result);
|
||||
void HandlePlayerLogin(LoginQueryHolder* holder);
|
||||
void HandleReorderCharactersOpcode(WorldPacket& recvPacket);
|
||||
|
||||
// played time
|
||||
void HandlePlayedTime(WorldPacket& recvPacket);
|
||||
|
|
@ -873,14 +874,6 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void LogUnexpectedOpcode(WorldPacket* packet, const char* reason);
|
||||
void LogUnprocessedTail(WorldPacket* packet);
|
||||
|
||||
// EnumData helpers
|
||||
bool CharCanLogin(uint32 lowGUID)
|
||||
{
|
||||
return _allowedCharsToLogin.find(lowGUID) != _allowedCharsToLogin.end();
|
||||
}
|
||||
|
||||
std::set<uint64> _allowedCharsToLogin;
|
||||
|
||||
uint32 m_GUIDLow; // set logged or recently logout player (while m_playerRecentlyLogout set)
|
||||
Player* _player;
|
||||
WorldSocket* m_Socket;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "0097"
|
||||
#define REVISION_NR "0096"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_11785_02_characters_instance"
|
||||
#define REVISION_DB_MANGOS "required_12091_01_mangos_spell_template"
|
||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||
#define REVISION_DB_CHARACTERS "required_0096_xxxxx_01_characters_characters"
|
||||
#define REVISION_DB_MANGOS "required_0083_12090_01_mangos_spell_template"
|
||||
#define REVISION_DB_REALMD "required_0014_xxxxx_01_realmd_account_access"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue