More works, update auth and char enum 5.4.8

This commit is contained in:
zamalaev 2020-02-20 20:53:47 +00:00 committed by Antz
parent a149adb835
commit c8d020c7ea
8 changed files with 1055 additions and 1011 deletions

View file

@ -1619,7 +1619,6 @@ bool Player::BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* bu
uint8 gender = fields[4].GetUInt8(); uint8 gender = fields[4].GetUInt8();
uint32 playerBytes = fields[5].GetUInt32(); uint32 playerBytes = fields[5].GetUInt32();
uint32 playerBytes2 = fields[6].GetUInt32(); uint32 playerBytes2 = fields[6].GetUInt32();
*buffer << uint8(playerBytes2 & 0xFF); // facial hair
uint8 level = fields[7].GetUInt8(); uint8 level = fields[7].GetUInt8();
uint32 playerFlags = fields[14].GetUInt32(); uint32 playerFlags = fields[14].GetUInt32();
uint32 atLoginFlags = fields[15].GetUInt32(); uint32 atLoginFlags = fields[15].GetUInt32();
@ -1629,20 +1628,6 @@ bool Player::BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* bu
uint32 petFamily = 0; uint32 petFamily = 0;
uint32 char_flags = 0; uint32 char_flags = 0;
data->WriteGuidMask<1>(guid);
data->WriteGuidMask<5, 6, 7>(guildGuid);
data->WriteGuidMask<5>(guid);
data->WriteGuidMask<3>(guildGuid);
data->WriteGuidMask<2>(guid);
data->WriteGuidMask<4>(guildGuid);
data->WriteGuidMask<7>(guid);
data->WriteBits(name.length(), 6);
data->WriteBit(atLoginFlags & AT_LOGIN_FIRST);
data->WriteGuidMask<1>(guildGuid);
data->WriteGuidMask<4>(guid);
data->WriteGuidMask<2, 0>(guildGuid);
data->WriteGuidMask<6, 3, 0>(guid);
// show pet at selection character in character list only for non-ghost character // 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)) if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (pClass == CLASS_WARLOCK || pClass == CLASS_HUNTER || pClass == CLASS_DEATH_KNIGHT))
{ {
@ -1672,6 +1657,49 @@ bool Player::BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* bu
else else
char_flags |= CHARACTER_FLAG_DECLINED; char_flags |= CHARACTER_FLAG_DECLINED;
data->WriteBit(guildGuid[4]);
data->WriteBit(guid[0]);
data->WriteBit(guildGuid[3]);
data->WriteBit(guid[3]);
data->WriteBit(guid[7]);
data->WriteBit(0); // Can boost ?
data->WriteBit(atLoginFlags & AT_LOGIN_FIRST);
data->WriteBit(guid[6]);
data->WriteBit(guildGuid[6]);
data->WriteBits(uint32(name.length()), 6);
data->WriteBit(guid[1]);
data->WriteBit(guildGuid[1]);
data->WriteBit(guildGuid[0]);
data->WriteBit(guid[4]);
data->WriteBit(guildGuid[7]);
data->WriteBit(guid[2]);
data->WriteBit(guid[5]);
data->WriteBit(guildGuid[2]);
data->WriteBit(guildGuid[5]);
// Character data
*buffer << uint32(0); // UNK02 - might be swapped with UNK03
buffer->WriteByteSeq(guid[1]);
*buffer << uint8(fields[20].GetUInt8()); // char order id
*buffer << uint8((playerBytes >> 16) & 0xFF); // Hair style
buffer->WriteByteSeq(guildGuid[2]);
buffer->WriteByteSeq(guildGuid[0]);
buffer->WriteByteSeq(guildGuid[6]);
buffer->append(name.c_str(), name.length()); // Name
buffer->WriteByteSeq(guildGuid[3]);
*buffer << fields[10].GetFloat(); // x
*buffer << uint32(0); // UNK00 new field - Boost fieldand the pet fields
*buffer << uint8((playerBytes >> 8) & 0xFF); // face
*buffer << uint8(pClass); // class
buffer->WriteByteSeq(guildGuid[5]);
Tokens tdata = StrSplit(fields[19].GetCppString(), " "); Tokens tdata = StrSplit(fields[19].GetCppString(), " ");
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot)
{ {
@ -1700,73 +1728,60 @@ bool Player::BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* bu
break; break;
} }
*buffer << uint32(enchant ? enchant->aura_id : 0);
*buffer << uint8(proto->InventoryType); *buffer << uint8(proto->InventoryType);
*buffer << uint32(proto->DisplayInfoID); *buffer << uint32(proto->DisplayInfoID);
*buffer << uint32(enchant ? enchant->aura_id : 0);
} }
for (int32 i = 0; i < 23; i++) for (int32 i = 0; i < 4; i++)
{ {
*buffer << uint32(0);
*buffer << uint32(0);
*buffer << uint8(0); *buffer << uint8(0);
*buffer << uint32(0);
*buffer << uint32(0);
} }
buffer->WriteGuidBytes<4>(guid);
*buffer << uint8(pRace); // Race
buffer->WriteGuidBytes<6>(guid);
buffer->WriteGuidBytes<1>(guildGuid);
*buffer << uint8(fields[20].GetUInt8()); // char order id
*buffer << uint8((playerBytes >> 16) & 0xFF); // Hair style
buffer->WriteGuidBytes<6>(guildGuid);
buffer->WriteGuidBytes<3>(guid);
*buffer << fields[10].GetFloat(); // x
*buffer << uint32(char_flags); // character flags
buffer->WriteGuidBytes< 0>(guildGuid);
*buffer << uint32(petLevel); // pet level
*buffer << uint32(fields[9].GetUInt32()); // map
buffer->WriteGuidBytes<7>(guildGuid);
// character customize flags
*buffer << 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);
buffer->WriteGuidBytes<4>(guildGuid); buffer->WriteByteSeq(guid[3]);
buffer->WriteGuidBytes<2, 5>(guid); buffer->WriteByteSeq(guid[5]);
*buffer << fields[11].GetFloat(); // y *buffer << uint32(petFamily); // Pet family
*buffer << uint32(petFamily); // Pet DisplayID
buffer->append(name.c_str(), name.length());
*buffer << uint32(petDisplayId); // Pet DisplayID
buffer->WriteGuidBytes<3>(guildGuid); buffer->WriteByteSeq(guildGuid[4]);
buffer->WriteGuidBytes<7>(guid);
*buffer << uint32(fields[9].GetUInt32()); // map
*buffer << uint8(pRace); // Race
*buffer << uint8(playerBytes & 0xFF); // skin
buffer->WriteByteSeq(guildGuid[1]);
*buffer << uint8(level); // Level *buffer << uint8(level); // Level
buffer->WriteGuidBytes<1>(guid); buffer->WriteByteSeq(guid[0]);
buffer->WriteGuidBytes<2>(guildGuid); buffer->WriteByteSeq(guid[2]);
*buffer << fields[12].GetFloat(); // z
*buffer << uint32(zone); // Zone id
*buffer << uint8(playerBytes2 & 0xFF); // facial hair
*buffer << uint8(pClass); // class
buffer->WriteGuidBytes<5>(guildGuid);
*buffer << uint8(playerBytes & 0xFF); // skin
*buffer << uint8(gender); // Gender
*buffer << uint8((playerBytes >> 8) & 0xFF); // face
buffer->WriteGuidBytes<0>(guid);
*buffer << uint8((playerBytes >> 24) & 0xFF); // Hair color *buffer << uint8((playerBytes >> 24) & 0xFF); // Hair color
*buffer << uint8(gender); // Gender
*buffer << uint8(playerBytes2 & 0xFF); // facial hair
*buffer << uint32(petLevel); // pet level
buffer->WriteByteSeq(guid[4]);
buffer->WriteByteSeq(guid[7]);
*buffer << fields[11].GetFloat(); // y
*buffer << uint32(petDisplayId); // Pet DisplayID
*buffer << uint32(0); // UNK03 - might be swaped with UNK02 and the pet fields
buffer->WriteByteSeq(guid[6]);
*buffer << uint32(char_flags); // character flags
*buffer << uint32(zone); // Zone id
buffer->WriteByteSeq(guildGuid[7]);
*buffer << fields[12].GetFloat(); // z
return true; return true;
} }
@ -21684,7 +21699,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
//SetMover(this); //SetMover(this);
/// Pass 'this' as argument because we're not stored in ObjectAccessor yet /// Pass 'this' as argument because we're not stored in ObjectAccessor yet
GetSocial()->SendSocialList(); GetSocial()->SendSocialList();
// guild bank list wtf? // guild bank list wtf?

File diff suppressed because it is too large Load diff

View file

@ -43,7 +43,7 @@ enum Opcodes
{ {
MSG_WOW_CONNECTION = 0x4F57, // 4.3.4 15595 MSG_WOW_CONNECTION = 0x4F57, // 4.3.4 15595
SMSG_AUTH_CHALLENGE = 0x0949, // 5.4.8 18414 SMSG_AUTH_CHALLENGE = 0x0949, // 5.4.8 18414
CMSG_AUTH_SESSION = 0x14DA, // 5.4.1 17538 CMSG_AUTH_SESSION = 0x00B2, // 5.4.8 18414
SMSG_AUTH_RESPONSE = 0x0ABA, // 5.4.8 18414 SMSG_AUTH_RESPONSE = 0x0ABA, // 5.4.8 18414
MSG_NULL_ACTION = 0x1001, MSG_NULL_ACTION = 0x1001,
CMSG_BOOTME = 0x1002, CMSG_BOOTME = 0x1002,
@ -100,12 +100,12 @@ enum Opcodes
CMSG_AUTH_SRP6_BEGIN = 0x1034, CMSG_AUTH_SRP6_BEGIN = 0x1034,
CMSG_AUTH_SRP6_PROOF = 0x1035, CMSG_AUTH_SRP6_PROOF = 0x1035,
CMSG_AUTH_SRP6_RECODE = 0x1036, CMSG_AUTH_SRP6_RECODE = 0x1036,
CMSG_CHAR_CREATE = 0x08CD, // 5.4.1 17538 CMSG_CHAR_CREATE = 0x0F1D, // 5.4.8 18414
CMSG_CHAR_ENUM = 0x0848, // 5.4.1 17538 CMSG_CHAR_ENUM = 0x00E0, // 5.4.8 18414
CMSG_CHAR_DELETE = 0x113B, // 5.4.7 18019 CMSG_CHAR_DELETE = 0x04E2, // 5.4.8 18414
SMSG_AUTH_SRP6_RESPONSE = 0x103A, SMSG_AUTH_SRP6_RESPONSE = 0x103A,
SMSG_CHAR_CREATE = 0x11C3, // 5.4.8 18414 SMSG_CHAR_CREATE = 0x11C3, // 5.4.8 18414
SMSG_CHAR_ENUM = 0x10B0, // 4.3.4 15595 SMSG_CHAR_ENUM = 0x11C3, // 5.4.8 18414
SMSG_CHAR_DELETE = 0x0C9F, // 5.4.8 18414 SMSG_CHAR_DELETE = 0x0C9F, // 5.4.8 18414
CMSG_PLAYER_LOGIN = 0x158F, // 5.4.8 18414 CMSG_PLAYER_LOGIN = 0x158F, // 5.4.8 18414
SMSG_NEW_WORLD = 0x04D9, // 5.3.0 SMSG_NEW_WORLD = 0x04D9, // 5.3.0
@ -246,7 +246,7 @@ enum Opcodes
CMSG_GAMEOBJ_USE = 0x4E17, // 4.3.4 15595 CMSG_GAMEOBJ_USE = 0x4E17, // 4.3.4 15595
CMSG_DESTROY_ITEMS = 0x10B3, CMSG_DESTROY_ITEMS = 0x10B3,
SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x4936, // 4.3.4 15595 SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x4936, // 4.3.4 15595
CMSG_AREATRIGGER = 0x155A, // 5.4.7 18019 CMSG_AREATRIGGER = 0x155A, // 5.4.7 18019
MSG_MOVE_START_FORWARD = 0x095A, // 5.4.8 18414 MSG_MOVE_START_FORWARD = 0x095A, // 5.4.8 18414
MSG_MOVE_START_BACKWARD = 0x09D8, // 5.4.8 18414 MSG_MOVE_START_BACKWARD = 0x09D8, // 5.4.8 18414
MSG_MOVE_STOP = 0x08F1, // 5.4.8 18414 MSG_MOVE_STOP = 0x08F1, // 5.4.8 18414
@ -319,7 +319,7 @@ enum Opcodes
SMSG_TRIGGER_CINEMATIC = 0x6C27, // 4.3.4 15595 SMSG_TRIGGER_CINEMATIC = 0x6C27, // 4.3.4 15595
CMSG_NEXT_CINEMATIC_CAMERA = 0x10FC, CMSG_NEXT_CINEMATIC_CAMERA = 0x10FC,
CMSG_COMPLETE_CINEMATIC = 0x2116, // 4.3.4 15595 CMSG_COMPLETE_CINEMATIC = 0x2116, // 4.3.4 15595
SMSG_TUTORIAL_FLAGS = 0x0D7E, // 5.3.0 SMSG_TUTORIAL_FLAGS = 0x1B90, // 5.4.8 18414
CMSG_TUTORIAL_FLAG = 0x6C26, // 4.3.4 15595 CMSG_TUTORIAL_FLAG = 0x6C26, // 4.3.4 15595
CMSG_TUTORIAL_CLEAR = 0x6515, // 4.3.4 15595 CMSG_TUTORIAL_CLEAR = 0x6515, // 4.3.4 15595
CMSG_TUTORIAL_RESET = 0x2726, // 4.3.4 15595 CMSG_TUTORIAL_RESET = 0x2726, // 4.3.4 15595
@ -382,13 +382,13 @@ enum Opcodes
SMSG_CHANNEL_START = 0x0A15, // 4.3.4 15595 SMSG_CHANNEL_START = 0x0A15, // 4.3.4 15595
SMSG_CHANNEL_UPDATE = 0x2417, // 4.3.4 15595 SMSG_CHANNEL_UPDATE = 0x2417, // 4.3.4 15595
CMSG_CANCEL_CHANNELLING = 0x6C25, // 4.3.4 15595 CMSG_CANCEL_CHANNELLING = 0x6C25, // 4.3.4 15595
SMSG_AI_REACTION = 0x06AF, // 5.4.8 18414 SMSG_AI_REACTION = 0x06AF, // 5.4.8 18414
CMSG_SET_SELECTION = 0x07CD, // 5.4.1 17538 CMSG_SET_SELECTION = 0x0740, // 5.4.8 18414
CMSG_EQUIPMENT_SET_DELETE = 0x4D07, // 4.3.4 15595 CMSG_EQUIPMENT_SET_DELETE = 0x4D07, // 4.3.4 15595
CMSG_INSTANCE_LOCK_RESPONSE = 0x1140, CMSG_INSTANCE_LOCK_RESPONSE = 0x1140,
CMSG_DEBUG_PASSIVE_AURA = 0x1141, CMSG_DEBUG_PASSIVE_AURA = 0x1141,
CMSG_ATTACKSWING = 0x1513, // 5.4.7 18019 CMSG_ATTACKSWING = 0x1513, // 5.4.7 18019
CMSG_ATTACKSTOP = 0x1E13, // 5.4.7 18019 CMSG_ATTACKSTOP = 0x1E13, // 5.4.7 18019
SMSG_ATTACKSTART = 0x11D5, // 5.3.0 17128 SMSG_ATTACKSTART = 0x11D5, // 5.3.0 17128
SMSG_ATTACKSTOP = 0x0690, // 5.3.0 17128 SMSG_ATTACKSTOP = 0x0690, // 5.3.0 17128
SMSG_ATTACKSWING_NOTINRANGE = 0x0B36, // 4.3.4 15595 SMSG_ATTACKSWING_NOTINRANGE = 0x0B36, // 4.3.4 15595
@ -459,10 +459,10 @@ enum Opcodes
SMSG_QUESTGIVER_STATUS = 0x2115, // 4.3.4 15595 SMSG_QUESTGIVER_STATUS = 0x2115, // 4.3.4 15595
CMSG_QUESTGIVER_HELLO = 0x0D17, // 4.3.4 15595 CMSG_QUESTGIVER_HELLO = 0x0D17, // 4.3.4 15595
SMSG_QUESTGIVER_QUEST_LIST = 0x0134, // 4.3.4 15595 SMSG_QUESTGIVER_QUEST_LIST = 0x0134, // 4.3.4 15595
CMSG_QUESTGIVER_QUERY_QUEST = 0x0474, // 5.4.7 18019 CMSG_QUESTGIVER_QUERY_QUEST = 0x0474, // 5.4.7 18019
CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x1188, CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x1188,
SMSG_QUESTGIVER_QUEST_DETAILS = 0x2425, // 4.3.4 15595 SMSG_QUESTGIVER_QUEST_DETAILS = 0x2425, // 4.3.4 15595
CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0356, // 5.4.7 18019 CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0356, // 5.4.7 18019
CMSG_QUESTGIVER_COMPLETE_QUEST = 0x0114, // 4.3.4 15595 CMSG_QUESTGIVER_COMPLETE_QUEST = 0x0114, // 4.3.4 15595
SMSG_QUESTGIVER_REQUEST_ITEMS = 0x07F4, // 5.3.0 17128 SMSG_QUESTGIVER_REQUEST_ITEMS = 0x07F4, // 5.3.0 17128
CMSG_QUESTGIVER_REQUEST_REWARD = 0x2534, // 4.3.4 15595 CMSG_QUESTGIVER_REQUEST_REWARD = 0x2534, // 4.3.4 15595
@ -527,8 +527,8 @@ enum Opcodes
SMSG_FISH_ESCAPED = 0x2205, // 4.3.4 15595 SMSG_FISH_ESCAPED = 0x2205, // 4.3.4 15595
CMSG_BUG = 0x4035, // 4.3.4 15595 CMSG_BUG = 0x4035, // 4.3.4 15595
SMSG_NOTIFICATION = 0x14A0, // 4.3.4 15595 SMSG_NOTIFICATION = 0x14A0, // 4.3.4 15595
CMSG_PLAYED_TIME = 0x0804, // 4.3.4 15595 CMSG_PLAYED_TIME = 0x03F6, // 5.4.8 18414
SMSG_PLAYED_TIME = 0x6037, // 4.3.4 15595 SMSG_PLAYED_TIME = 0x11E2, // 5.4.8 18414
CMSG_QUERY_TIME = 0x0A36, // 4.3.4 15595 CMSG_QUERY_TIME = 0x0A36, // 4.3.4 15595
SMSG_QUERY_TIME_RESPONSE = 0x2124, // 4.3.4 15595 SMSG_QUERY_TIME_RESPONSE = 0x2124, // 4.3.4 15595
SMSG_LOG_XPGAIN = 0x4514, // 4.3.4 15595 SMSG_LOG_XPGAIN = 0x4514, // 4.3.4 15595
@ -543,8 +543,8 @@ enum Opcodes
SMSG_START_MIRROR_TIMER = 0x6824, // 4.3.4 15595 SMSG_START_MIRROR_TIMER = 0x6824, // 4.3.4 15595
SMSG_PAUSE_MIRROR_TIMER = 0x4015, // 4.3.4 15595 SMSG_PAUSE_MIRROR_TIMER = 0x4015, // 4.3.4 15595
SMSG_STOP_MIRROR_TIMER = 0x0B06, // 4.3.4 15595 SMSG_STOP_MIRROR_TIMER = 0x0B06, // 4.3.4 15595
CMSG_PING = 0x11E6, // 5.4.1 17538 CMSG_PING = 0x0012, // 5.4.8 18414
SMSG_PONG = 0x1121, // 5.3.0 17055 SMSG_PONG = 0x1969, // 5.4.8 18414
SMSG_CLEAR_COOLDOWNS = 0x59B4, // 4.3.4 15595 SMSG_CLEAR_COOLDOWNS = 0x59B4, // 4.3.4 15595
SMSG_GAMEOBJECT_PAGETEXT = 0x2925, // 4.3.4 15595 SMSG_GAMEOBJECT_PAGETEXT = 0x2925, // 4.3.4 15595
CMSG_SETSHEATHED = 0x4326, // 4.3.4 15595 CMSG_SETSHEATHED = 0x4326, // 4.3.4 15595
@ -584,7 +584,7 @@ enum Opcodes
SMSG_GMTICKET_CREATE = 0x2107, // 4.3.4 15595 SMSG_GMTICKET_CREATE = 0x2107, // 4.3.4 15595
CMSG_GMTICKET_UPDATETEXT = 0x0636, // 4.3.4 15595 CMSG_GMTICKET_UPDATETEXT = 0x0636, // 4.3.4 15595
SMSG_GMTICKET_UPDATETEXT = 0x6535, // 4.3.4 15595 SMSG_GMTICKET_UPDATETEXT = 0x6535, // 4.3.4 15595
SMSG_ACCOUNT_DATA_TIMES = 0x0F40, // 5.4.7 18019 SMSG_ACCOUNT_DATA_TIMES = 0x162B, // 5.4.8 18414
CMSG_REQUEST_ACCOUNT_DATA = 0x6505, // 4.3.4 15595 CMSG_REQUEST_ACCOUNT_DATA = 0x6505, // 4.3.4 15595
CMSG_UPDATE_ACCOUNT_DATA = 0x4736, // 4.3.4 15595 CMSG_UPDATE_ACCOUNT_DATA = 0x4736, // 4.3.4 15595
SMSG_UPDATE_ACCOUNT_DATA = 0x0684, // 5.3.0 17128 SMSG_UPDATE_ACCOUNT_DATA = 0x0684, // 5.3.0 17128
@ -596,7 +596,7 @@ enum Opcodes
SMSG_GMTICKET_GETTICKET = 0x2C15, // 4.3.4 15595 SMSG_GMTICKET_GETTICKET = 0x2C15, // 4.3.4 15595
CMSG_LEARN_TALENT = 0x1776, // 5.4.1 17538 CMSG_LEARN_TALENT = 0x1776, // 5.4.1 17538
SMSG_INSTANCE_ENCOUNTER = 0x1215, SMSG_INSTANCE_ENCOUNTER = 0x1215,
SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0981, // 5.3.0 17128 SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0981, // 5.3.0 17128
MSG_CORPSE_QUERY = 0x4336, // 4.3.4 15595 MSG_CORPSE_QUERY = 0x4336, // 4.3.4 15595
CMSG_GMTICKET_DELETETICKET = 0x6B14, // 4.3.4 15595 CMSG_GMTICKET_DELETETICKET = 0x6B14, // 4.3.4 15595
SMSG_GMTICKET_DELETETICKET = 0x6D17, // 4.3.4 15595 SMSG_GMTICKET_DELETETICKET = 0x6D17, // 4.3.4 15595
@ -628,7 +628,7 @@ enum Opcodes
CMSG_GUILD_ADD_RANK = 0x3030, // 4.3.4 15595 CMSG_GUILD_ADD_RANK = 0x3030, // 4.3.4 15595
CMSG_GUILD_DEL_RANK = 0x3234, // 4.3.4 15595 CMSG_GUILD_DEL_RANK = 0x3234, // 4.3.4 15595
CMSG_GUILD_SET_NOTE = 0x1233, // 4.3.4 15595 CMSG_GUILD_SET_NOTE = 0x1233, // 4.3.4 15595
SMSG_LOGIN_VERIFY_WORLD = 0x0434, // 5.3.0 17128 SMSG_LOGIN_VERIFY_WORLD = 0x1C0F, // 5.4.8 18414
CMSG_CLEAR_EXPLORATION = 0x1238, CMSG_CLEAR_EXPLORATION = 0x1238,
CMSG_SEND_MAIL = 0x0523, // 4.3.4 15595 CMSG_SEND_MAIL = 0x0523, // 4.3.4 15595
SMSG_SEND_MAIL_RESULT = 0x4927, // 4.3.4 15595 SMSG_SEND_MAIL_RESULT = 0x4927, // 4.3.4 15595
@ -772,7 +772,7 @@ enum Opcodes
SMSG_INIT_WORLD_STATES = 0x0FDC, // 5.3.0 17128 SMSG_INIT_WORLD_STATES = 0x0FDC, // 5.3.0 17128
SMSG_UPDATE_WORLD_STATE = 0x4816, // 4.3.4 15595 SMSG_UPDATE_WORLD_STATE = 0x4816, // 4.3.4 15595
SMSG_PET_ACTION_FEEDBACK = 0x08C4, // 5.3.0 17128 SMSG_PET_ACTION_FEEDBACK = 0x08C4, // 5.3.0 17128
CMSG_CHAR_RENAME = 0x2327, // 4.3.4 15595 CMSG_CHAR_RENAME = 0x0963, // 5.4.8 18414
SMSG_CHAR_RENAME = 0x2024, // 4.3.4 15595 SMSG_CHAR_RENAME = 0x2024, // 4.3.4 15595
CMSG_MOVE_SPLINE_DONE = 0x790E, // 4.3.4 15595 CMSG_MOVE_SPLINE_DONE = 0x790E, // 4.3.4 15595
CMSG_MOVE_FALL_RESET = 0x310A, // 4.3.4 15595 CMSG_MOVE_FALL_RESET = 0x310A, // 4.3.4 15595
@ -819,7 +819,7 @@ enum Opcodes
SMSG_BATTLEGROUND_PLAYER_JOINED = 0x1281, // 5.3.0 17128 SMSG_BATTLEGROUND_PLAYER_JOINED = 0x1281, // 5.3.0 17128
SMSG_BATTLEGROUND_PLAYER_LEFT = 0x1581, // 5.3.0 17128 SMSG_BATTLEGROUND_PLAYER_LEFT = 0x1581, // 5.3.0 17128
CMSG_BATTLEMASTER_JOIN = 0x7902, // 4.3.4 15595 CMSG_BATTLEMASTER_JOIN = 0x7902, // 4.3.4 15595
SMSG_ADDON_INFO = 0x1136, // 5.4.1 17538 SMSG_ADDON_INFO = 0x160A, // 5.4.8 18414
CMSG_PET_UNLEARN = 0x12F1, CMSG_PET_UNLEARN = 0x12F1,
SMSG_PET_UNLEARN_CONFIRM = 0x12F2, SMSG_PET_UNLEARN_CONFIRM = 0x12F2,
SMSG_PARTY_MEMBER_STATS_FULL = 0x0215, // 4.3.4 15595 SMSG_PARTY_MEMBER_STATS_FULL = 0x0215, // 4.3.4 15595
@ -856,8 +856,8 @@ enum Opcodes
CMSG_GM_DESTROY_ONLINE_CORPSE = 0x1312, CMSG_GM_DESTROY_ONLINE_CORPSE = 0x1312,
CMSG_ACTIVATETAXIEXPRESS = 0x0515, // 4.3.4 15595 CMSG_ACTIVATETAXIEXPRESS = 0x0515, // 4.3.4 15595
SMSG_SET_FACTION_ATWAR = 0x1314, SMSG_SET_FACTION_ATWAR = 0x1314,
SMSG_SET_FACTION_NOT_VISIBLE = 0x0000, //TODO: Needs fixing up SMSG_SET_FACTION_NOT_VISIBLE = 0x0000, //TODO: Needs fixing up
SMSG_GAMETIMEBIAS_SET = 0x1315, SMSG_GAMETIMEBIAS_SET = 0x1315,
CMSG_DEBUG_ACTIONS_START = 0x1316, CMSG_DEBUG_ACTIONS_START = 0x1316,
CMSG_DEBUG_ACTIONS_STOP = 0x1317, CMSG_DEBUG_ACTIONS_STOP = 0x1317,
CMSG_SET_FACTION_INACTIVE = 0x0E37, // 4.3.4 15595 CMSG_SET_FACTION_INACTIVE = 0x0E37, // 4.3.4 15595
@ -874,7 +874,7 @@ enum Opcodes
MSG_RAID_READY_CHECK = 0x0DDC, // 5.3.0 17128 MSG_RAID_READY_CHECK = 0x0DDC, // 5.3.0 17128
CMSG_LUA_USAGE = 0x1324, CMSG_LUA_USAGE = 0x1324,
SMSG_PET_ACTION_SOUND = 0x13D1, // 5.3.0 17128 SMSG_PET_ACTION_SOUND = 0x13D1, // 5.3.0 17128
SMSG_PET_DISMISS_SOUND = 0x0ED1, // 5.3.0 17128 SMSG_PET_DISMISS_SOUND = 0x0ED1, // 5.3.0 17128
SMSG_GHOSTEE_GONE = 0x1327, SMSG_GHOSTEE_GONE = 0x1327,
CMSG_GM_UPDATE_TICKET_STATUS = 0x1328, CMSG_GM_UPDATE_TICKET_STATUS = 0x1328,
SMSG_GM_TICKET_STATUS_UPDATE = 0x2C25, // 4.3.4 15595 SMSG_GM_TICKET_STATUS_UPDATE = 0x2C25, // 4.3.4 15595
@ -898,7 +898,7 @@ enum Opcodes
SMSG_DEFENSE_MESSAGE = 0x0314, // 4.3.4 15595 SMSG_DEFENSE_MESSAGE = 0x0314, // 4.3.4 15595
SMSG_WORLD_SERVER_INFO = 0x0427, // 5.4.1 17538 SMSG_WORLD_SERVER_INFO = 0x0427, // 5.4.1 17538
MSG_GM_RESETINSTANCELIMIT = 0x133D, MSG_GM_RESETINSTANCELIMIT = 0x133D,
SMSG_MOTD = 0x12DC, // 5.3.0 17128 SMSG_MOTD = 0x183B, // 5.4.8 18414
SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x133F, SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x133F,
SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x1340, SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x1340,
CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK = 0x1341, CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK = 0x1341,
@ -976,8 +976,8 @@ enum Opcodes
SMSG_FLIGHT_SPLINE_SYNC = 0x1389, SMSG_FLIGHT_SPLINE_SYNC = 0x1389,
CMSG_SET_TAXI_BENCHMARK_MODE = 0x4314, // 4.3.4 15595 CMSG_SET_TAXI_BENCHMARK_MODE = 0x4314, // 4.3.4 15595
SMSG_JOINED_BATTLEGROUND_QUEUE = 0x138B, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x138B,
SMSG_REALM_SPLIT = 0x0884, // 5.4.1 17538 SMSG_REALM_SPLIT = 0x0000, // TODO:
CMSG_REALM_SPLIT = 0x2906, // 4.3.4 15595 CMSG_REALM_SPLIT = 0x0000, // TODO:
CMSG_MOVE_CHNG_TRANSPORT = 0x3102, // 4.3.4 15595 CMSG_MOVE_CHNG_TRANSPORT = 0x3102, // 4.3.4 15595
MSG_PARTY_ASSIGNMENT = 0x0424, // 4.3.4 15595 MSG_PARTY_ASSIGNMENT = 0x0424, // 4.3.4 15595
SMSG_OFFER_PETITION_ERROR = 0x2716, // 4.3.4 15595 SMSG_OFFER_PETITION_ERROR = 0x2716, // 4.3.4 15595
@ -1213,8 +1213,8 @@ enum Opcodes
CMSG_SET_CRITERIA_CHEAT = 0x1471, CMSG_SET_CRITERIA_CHEAT = 0x1471,
SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x1472, SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x1472,
CMSG_UNITANIMTIER_CHEAT = 0x1473, CMSG_UNITANIMTIER_CHEAT = 0x1473,
CMSG_CHAR_CUSTOMIZE = 0x2C34, // 4.3.4 15595 CMSG_CHAR_CUSTOMIZE = 0x0A13, // 5.4.8 18414
SMSG_CHAR_CUSTOMIZE = 0x4F16, // 4.3.4 15595 SMSG_CHAR_CUSTOMIZE = 0x1432, // 5.4.8 18414
SMSG_PET_RENAMEABLE = 0x2B27, // 4.3.4 15595 SMSG_PET_RENAMEABLE = 0x2B27, // 4.3.4 15595
CMSG_REQUEST_VEHICLE_EXIT = 0x2B35, // 4.3.4 15595 CMSG_REQUEST_VEHICLE_EXIT = 0x2B35, // 4.3.4 15595
CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x4C04, // 4.3.4 15595 CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x4C04, // 4.3.4 15595
@ -1269,7 +1269,7 @@ enum Opcodes
CMSG_RIDE_VEHICLE_INTERACT = 0x2705, // 4.3.4 15595 CMSG_RIDE_VEHICLE_INTERACT = 0x2705, // 4.3.4 15595
CMSG_CONTROLLER_EJECT_PASSENGER = 0x6927, // 4.3.4 15595 CMSG_CONTROLLER_EJECT_PASSENGER = 0x6927, // 4.3.4 15595
SMSG_PET_GUIDS = 0x15CD, // 5.3.0 17128 SMSG_PET_GUIDS = 0x15CD, // 5.3.0 17128
SMSG_CLIENTCACHE_VERSION = 0x2734, // 4.3.4 15595 SMSG_CLIENTCACHE_VERSION = 0x002A, // 5.4.8 18414
CMSG_CHANGE_GDF_ARENA_RATING = 0x14AD, CMSG_CHANGE_GDF_ARENA_RATING = 0x14AD,
CMSG_SET_ARENA_TEAM_RATING_BY_INDEX = 0x14AE, CMSG_SET_ARENA_TEAM_RATING_BY_INDEX = 0x14AE,
CMSG_SET_ARENA_TEAM_WEEKLY_GAMES = 0x14AF, CMSG_SET_ARENA_TEAM_WEEKLY_GAMES = 0x14AF,
@ -1353,7 +1353,7 @@ enum Opcodes
SMSG_DEBUG_SERVER_GEO = 0x14FD, SMSG_DEBUG_SERVER_GEO = 0x14FD,
SMSG_LOOT_UPDATE = 0x14FE, SMSG_LOOT_UPDATE = 0x14FE,
UMSG_UPDATE_GROUP_INFO = 0x14FF, UMSG_UPDATE_GROUP_INFO = 0x14FF,
CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x2B16, // 4.3.4 15595 CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x031C, // 5.4.8 18414
CMSG_QUERY_GET_ALL_QUESTS = 0x2317, // 4.3.4 15595 CMSG_QUERY_GET_ALL_QUESTS = 0x2317, // 4.3.4 15595
SMSG_ALL_QUESTS_COMPLETED = 0x6314, // 4.3.4 15595 SMSG_ALL_QUESTS_COMPLETED = 0x6314, // 4.3.4 15595
CMSG_GMLAGREPORT_SUBMIT = 0x1503, CMSG_GMLAGREPORT_SUBMIT = 0x1503,
@ -1435,7 +1435,7 @@ enum Opcodes
SMSG_PVP_OPTIONS_ENABLED = 0x0381, // 5.3.0 SMSG_PVP_OPTIONS_ENABLED = 0x0381, // 5.3.0
CMSG_REQUEST_HOTFIX = 0x2401, // 4.3.4 15595 CMSG_REQUEST_HOTFIX = 0x2401, // 4.3.4 15595
SMSG_DB_REPLY = 0x38A4, // 4.3.4 15595 SMSG_DB_REPLY = 0x38A4, // 4.3.4 15595
CMSG_OBJECT_UPDATE_FAILED = 0x0882, // 5.4.7 18019 CMSG_OBJECT_UPDATE_FAILED = 0x1061, // 5.4.8 18414
CMSG_REFORGE_ITEM = 0x331A, // 4.3.4 15595 CMSG_REFORGE_ITEM = 0x331A, // 4.3.4 15595
SMSG_REFORGE_RESULT = 0x58A4, // 4.3.4 15595 SMSG_REFORGE_RESULT = 0x58A4, // 4.3.4 15595
CMSG_LOAD_SCREEN = 0x1DBD, // 5.4.8 18414 CMSG_LOAD_SCREEN = 0x1DBD, // 5.4.8 18414

View file

@ -908,7 +908,11 @@ void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos)
{ {
bool hasAccountData = true; bool hasAccountData = true;
WorldPacket packet(SMSG_AUTH_RESPONSE, 80); WorldPacket packet(SMSG_AUTH_RESPONSE, 1 /*bits*/ + 4 + 1 + 4 + 1 + 4 + 1 + 1 + (queued ? 4 : 0));
packet << uint8(code);
packet.WriteBit(queued); // IsInQueue
if (queued)
packet.WriteBit(1); // unk
packet.WriteBit(hasAccountData); packet.WriteBit(hasAccountData);
@ -923,14 +927,6 @@ void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos)
packet.WriteBits(MAX_PLAYABLE_RACES, 23); packet.WriteBits(MAX_PLAYABLE_RACES, 23);
packet.WriteBit(0); packet.WriteBit(0);
packet.WriteBit(queued);
if (queued)
packet.WriteBit(1);
if (queued)
packet << uint32(queuePos);
for (uint8 i = 0; i < MAX_PLAYABLE_RACES; ++i) for (uint8 i = 0; i < MAX_PLAYABLE_RACES; ++i)
{ {
packet << uint8(raceExpansionInfo[i].expansion); packet << uint8(raceExpansionInfo[i].expansion);
@ -953,7 +949,8 @@ void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos)
packet << uint32(0); packet << uint32(0);
} }
packet << uint8(code); if (queued)
packet << uint32(queuePos);
SendPacket(&packet); SendPacket(&packet);
} }
@ -1052,13 +1049,14 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, const std:
void WorldSession::SendAccountDataTimes(uint32 mask) void WorldSession::SendAccountDataTimes(uint32 mask)
{ {
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + NUM_ACCOUNT_DATA_TYPES * 4); WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + NUM_ACCOUNT_DATA_TYPES * 4);
data << uint32(mask); // type mask
data << uint32(time(NULL)); // unix time of something data.WriteBit(1);
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i) for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
data << uint32(GetAccountData(AccountDataType(i))->Time);// also unix time data << uint32(GetAccountData(AccountDataType(i))->Time);// also unix time
data.WriteBit(1); data << uint32(mask); // type mask
data << uint32(time(NULL)); // unix time of something
SendPacket(&data); SendPacket(&data);
} }
@ -1192,6 +1190,7 @@ void WorldSession::ReadAddonsInfo(ByteBuffer &data)
{ {
uint32 addonsCount; uint32 addonsCount;
addonInfo >> addonsCount; // addons count addonInfo >> addonsCount; // addons count
DEBUG_LOG("Addon count: %u", addonsCount);
for (uint32 i = 0; i < addonsCount; ++i) for (uint32 i = 0; i < addonsCount; ++i)
{ {

View file

@ -852,33 +852,33 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
recvPacket.read_skip<uint32>(); recvPacket.read_skip<uint32>();
recvPacket.read_skip<uint32>(); recvPacket.read_skip<uint32>();
recvPacket.read_skip<uint8>();
recvPacket >> digest[10];
recvPacket >> digest[18]; recvPacket >> digest[18];
recvPacket >> digest[12]; recvPacket >> digest[14];
recvPacket >> digest[5];
recvPacket.read_skip<uint64>();
recvPacket >> digest[15];
recvPacket >> digest[9];
recvPacket >> digest[19];
recvPacket >> digest[4];
recvPacket >> digest[7];
recvPacket >> digest[16];
recvPacket >> digest[3]; recvPacket >> digest[3];
recvPacket >> clientBuild; recvPacket >> digest[4];
recvPacket >> digest[8];
recvPacket.read_skip<uint32>();
recvPacket.read_skip<uint8>();
recvPacket >> digest[17];
recvPacket >> digest[6];
recvPacket >> digest[0]; recvPacket >> digest[0];
recvPacket >> digest[1]; recvPacket.read_skip<uint32>();
recvPacket >> digest[11]; recvPacket >> digest[11];
recvPacket >> clientSeed; recvPacket >> clientSeed;
recvPacket >> digest[19];
recvPacket.read_skip<uint8>();
recvPacket.read_skip<uint8>();
recvPacket >> digest[2]; recvPacket >> digest[2];
recvPacket >> digest[9];
recvPacket >> digest[12];
recvPacket.read_skip<uint64>();
recvPacket.read_skip<uint32>(); recvPacket.read_skip<uint32>();
recvPacket >> digest[14]; recvPacket >> digest[16];
recvPacket >> digest[5];
recvPacket >> digest[6];
recvPacket >> digest[8];
recvPacket >> clientBuild;
recvPacket >> digest[17];
recvPacket >> digest[7];
recvPacket >> digest[13]; recvPacket >> digest[13];
recvPacket >> digest[15];
recvPacket >> digest[1];
recvPacket >> digest[10];
recvPacket >> m_addonSize; // addon data size recvPacket >> m_addonSize; // addon data size
@ -886,13 +886,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
addonsData.resize(m_addonSize); addonsData.resize(m_addonSize);
recvPacket.read((uint8*)addonsData.contents(), m_addonSize); recvPacket.read((uint8*)addonsData.contents(), m_addonSize);
uint8 nameLenLow, nameLenHigh; accountName = recvPacket.ReadString(recvPacket.ReadBits(11));
recvPacket >> nameLenHigh;
recvPacket >> nameLenLow;
uint8 accNameLen = (nameLenHigh << 5) | (nameLenLow >> 3);
accountName = recvPacket.ReadString(accNameLen);
DEBUG_LOG("WorldSocket::HandleAuthSession: client build %u, account %s, clientseed %X", DEBUG_LOG("WorldSocket::HandleAuthSession: client build %u, account %s, clientseed %X",
clientBuild, clientBuild,
@ -902,14 +896,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
// Check the version of client trying to connect // Check the version of client trying to connect
if(!IsAcceptableClientBuild(clientBuild)) if(!IsAcceptableClientBuild(clientBuild))
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_VERSION_MISMATCH);
packet.WriteBit(false); sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (version mismatch).");
packet.WriteBit(false);
packet << uint8(AUTH_VERSION_MISMATCH);
SendPacket(packet);
sLog.outError("WorldSocket::HandleAuthSession: Sent Auth Response (version mismatch).");
return -1; return -1;
} }
@ -937,14 +925,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
// Stop if the account is not found // Stop if the account is not found
if (!result) if (!result)
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_UNKNOWN_ACCOUNT);
packet.WriteBit(false); sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
packet.WriteBit(false);
packet << uint8(AUTH_UNKNOWN_ACCOUNT);
SendPacket(packet);
sLog.outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
return -1; return -1;
} }
@ -972,13 +954,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
///- Re-check ip locking (same check as in realmd). ///- Re-check ip locking (same check as in realmd).
if (fields[4].GetUInt8() == 1) // if ip is locked if (fields[4].GetUInt8() == 1) // if ip is locked
{ {
if (strcmp(fields[3].GetString(), GetRemoteAddress().c_str())) if (strcmp (fields[3].GetString(), GetRemoteAddress().c_str()))
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_FAILED);
packet.WriteBit(false);
packet.WriteBit(false);
packet << uint8(AUTH_FAILED);
SendPacket(packet);
delete result; delete result;
BASIC_LOG("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); BASIC_LOG("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
@ -1014,11 +992,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
if (banresult) // if account banned if (banresult) // if account banned
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_BANNED);
packet.WriteBit(false);
packet.WriteBit(false);
packet << uint8(AUTH_BANNED);
SendPacket(packet);
delete banresult; delete banresult;
@ -1031,12 +1005,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType) if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType)
{ {
WorldPacket Packet (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_UNAVAILABLE);
packet.WriteBit(false);
packet.WriteBit(false);
Packet << uint8(AUTH_UNAVAILABLE);
SendPacket(packet);
BASIC_LOG("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); BASIC_LOG("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
return -1; return -1;
@ -1055,16 +1024,10 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
sha.UpdateBigNumbers(&K, NULL); sha.UpdateBigNumbers(&K, NULL);
sha.Finalize(); sha.Finalize();
if (memcmp(sha.GetDigest(), digest, 20)) if (memcmp (sha.GetDigest (), digest, 20))
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 2); SendAuthResponseError(AUTH_FAILED);
packet.WriteBit(false); sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).");
packet.WriteBit(false);
packet << uint8(AUTH_FAILED);
SendPacket(packet);
sLog.outError("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).");
return -1; return -1;
} }
@ -1163,3 +1126,12 @@ int WorldSocket::HandlePing(WorldPacket& recvPacket)
packet << ping; packet << ping;
return SendPacket(packet); return SendPacket(packet);
} }
void WorldSocket::SendAuthResponseError(uint8 code)
{
WorldPacket packet(SMSG_AUTH_RESPONSE, 1);
packet.WriteBit(0); // has account info
packet.WriteBit(0); // has queue info
packet << uint8(code);
SendPacket(packet);
}

View file

@ -181,6 +181,7 @@ class WorldSocket : protected WorldHandler
int HandlePing(WorldPacket& recvPacket); int HandlePing(WorldPacket& recvPacket);
private: private:
void SendAuthResponseError(uint8);
/// Time in which the last ping was received /// Time in which the last ping was received
ACE_Time_Value m_LastPingTime; ACE_Time_Value m_LastPingTime;

View file

@ -171,8 +171,8 @@ void WorldSession::HandleCharEnum(QueryResult* result)
while (result->NextRow()); while (result->NextRow());
} }
data.WriteBit(1);
data.WriteBits(0, 21); data.WriteBits(0, 21);
data.WriteBit(1);
if (!buffer.empty()) if (!buffer.empty())
{ {
@ -726,11 +726,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
pCurrChar->SendDungeonDifficulty(false); pCurrChar->SendDungeonDifficulty(false);
WorldPacket data(SMSG_LOGIN_VERIFY_WORLD, 20); WorldPacket data(SMSG_LOGIN_VERIFY_WORLD, 20);
data << pCurrChar->GetMapId();
data << pCurrChar->GetPositionX(); data << pCurrChar->GetPositionX();
data << pCurrChar->GetPositionY();
data << pCurrChar->GetPositionZ();
data << pCurrChar->GetOrientation(); data << pCurrChar->GetOrientation();
data << pCurrChar->GetPositionY();
data << pCurrChar->GetMapId();
data << pCurrChar->GetPositionZ();
SendPacket(&data); SendPacket(&data);
// load player specific part before send times // load player specific part before send times
@ -1073,10 +1073,28 @@ void WorldSession::HandleShowingCloakOpcode(WorldPacket & /*recv_data*/)
void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
{ {
ObjectGuid guid; ObjectGuid guid;
std::string unk;
std::string newname; std::string newname;
recv_data >> guid; guid[6] = recv_data.ReadBit();
guid[3] = recv_data.ReadBit();
guid[0] = recv_data.ReadBit();
recv_data >> newname; recv_data >> newname;
guid[1] = recv_data.ReadBit();
guid[5] = recv_data.ReadBit();
guid[7] = recv_data.ReadBit();
guid[2] = recv_data.ReadBit();
guid[4] = recv_data.ReadBit();
recv_data.ReadByteSeq(guid[1]);
recv_data.ReadByteSeq(guid[6]);
recv_data.ReadByteSeq(guid[5]);
recv_data >> unk;
recv_data.ReadByteSeq(guid[2]);
recv_data.ReadByteSeq(guid[4]);
recv_data.ReadByteSeq(guid[3]);
recv_data.ReadByteSeq(guid[7]);
recv_data.ReadByteSeq(guid[0]);
// prevent character rename to invalid name // prevent character rename to invalid name
if (!normalizePlayerName(newname)) if (!normalizePlayerName(newname))
@ -1326,12 +1344,30 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPacket& recv_data)
{ {
ObjectGuid guid; ObjectGuid guid;
std::string newname; std::string newname;
std::string unk;
recv_data >> guid;
recv_data >> newname;
uint8 gender, skin, face, hairStyle, hairColor, facialHair; uint8 gender, skin, face, hairStyle, hairColor, facialHair;
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
recv_data >> hairStyle >> gender >> skin >> face >> hairColor >> facialHair;
guid[2] = recv_data.ReadBit();
guid[6] = recv_data.ReadBit();
guid[1] = recv_data.ReadBit();
guid[0] = recv_data.ReadBit();
guid[7] = recv_data.ReadBit();
guid[5] = recv_data.ReadBit();
recv_data >> newname;
guid[4] = recv_data.ReadBit();
guid[3] = recv_data.ReadBit();
recv_data.ReadByteSeq(guid[4]);
recv_data >> unk;
recv_data.ReadByteSeq(guid[0]);
recv_data.ReadByteSeq(guid[2]);
recv_data.ReadByteSeq(guid[6]);
recv_data.ReadByteSeq(guid[5]);
recv_data.ReadByteSeq(guid[3]);
recv_data.ReadByteSeq(guid[1]);
recv_data.ReadByteSeq(guid[7]);
QueryResult* result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", guid.GetCounter()); QueryResult* result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", guid.GetCounter());
if (!result) if (!result)
@ -1400,18 +1436,38 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPacket& recv_data)
sLog.outChar("Account: %d (IP: %s), Character %s customized to: %s", GetAccountId(), IP_str.c_str(), guid.GetString().c_str(), newname.c_str()); sLog.outChar("Account: %d (IP: %s), Character %s customized to: %s", GetAccountId(), IP_str.c_str(), guid.GetString().c_str(), newname.c_str());
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1 + 8 + (newname.size() + 1) + 6); WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1 + 8 + (newname.size() + 1) + 6);
data << uint8(RESPONSE_SUCCESS); data.WriteBit(guid[0]);
data << ObjectGuid(guid); data.WriteBit(guid[7]);
data << newname; data.WriteBit(guid[3]);
data << uint8(gender); data.WriteBit(guid[2]);
data << uint8(skin); data.WriteBit(guid[6]);
data << uint8(face); data.WriteBit(guid[5]);
data << uint8(hairStyle); data.WriteBit(guid[1]);
data << uint8(hairColor); data.WriteBit(guid[4]);
data << uint8(facialHair);
SendPacket(&data);
sWorld.InvalidatePlayerDataToAllClient(guid); data.WriteByteSeq(guid[1]);
data << uint8(RESPONSE_SUCCESS);
data << uint8(facialHair);
data << uint8(skin);
data << uint8(gender);
data << uint8(hairStyle);
data << uint8(face);
data << uint8(hairColor);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[5]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[4]);
data << newname;
if (!RESPONSE_SUCCESS)
data << newname;
SendPacket(&data);
} }
void WorldSession::HandleEquipmentSetSaveOpcode(WorldPacket& recv_data) void WorldSession::HandleEquipmentSetSaveOpcode(WorldPacket& recv_data)

View file

@ -430,23 +430,23 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket& recv_data)
{ {
ObjectGuid guid; ObjectGuid guid;
guid[7] = recv_data.ReadBit();
guid[6] = recv_data.ReadBit();
guid[5] = recv_data.ReadBit();
guid[4] = recv_data.ReadBit(); guid[4] = recv_data.ReadBit();
guid[3] = recv_data.ReadBit(); guid[3] = recv_data.ReadBit();
guid[2] = recv_data.ReadBit(); guid[2] = recv_data.ReadBit();
guid[0] = recv_data.ReadBit();
guid[5] = recv_data.ReadBit();
guid[7] = recv_data.ReadBit();
guid[6] = recv_data.ReadBit();
guid[1] = recv_data.ReadBit(); guid[1] = recv_data.ReadBit();
guid[0] = recv_data.ReadBit();
recv_data.ReadByteSeq(guid[1]);
recv_data.ReadByteSeq(guid[2]);
recv_data.ReadByteSeq(guid[3]);
recv_data.ReadByteSeq(guid[0]); recv_data.ReadByteSeq(guid[0]);
recv_data.ReadByteSeq(guid[7]); recv_data.ReadByteSeq(guid[7]);
recv_data.ReadByteSeq(guid[3]);
recv_data.ReadByteSeq(guid[5]); recv_data.ReadByteSeq(guid[5]);
recv_data.ReadByteSeq(guid[1]);
recv_data.ReadByteSeq(guid[4]); recv_data.ReadByteSeq(guid[4]);
recv_data.ReadByteSeq(guid[6]); recv_data.ReadByteSeq(guid[6]);
recv_data.ReadByteSeq(guid[2]);
_player->SetSelectionGuid(guid); _player->SetSelectionGuid(guid);
@ -1763,23 +1763,23 @@ void WorldSession::HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket)
{ {
ObjectGuid guid; ObjectGuid guid;
guid[4] = recvPacket.ReadBit();
guid[6] = recvPacket.ReadBit();
guid[3] = recvPacket.ReadBit(); guid[3] = recvPacket.ReadBit();
guid[0] = recvPacket.ReadBit();
guid[7] = recvPacket.ReadBit();
guid[5] = recvPacket.ReadBit(); guid[5] = recvPacket.ReadBit();
guid[6] = recvPacket.ReadBit();
guid[0] = recvPacket.ReadBit();
guid[1] = recvPacket.ReadBit(); guid[1] = recvPacket.ReadBit();
guid[2] = recvPacket.ReadBit(); guid[2] = recvPacket.ReadBit();
guid[7] = recvPacket.ReadBit();
guid[4] = recvPacket.ReadBit();
recvPacket.ReadByteSeq(guid[4]);
recvPacket.ReadByteSeq(guid[7]);
recvPacket.ReadByteSeq(guid[0]); recvPacket.ReadByteSeq(guid[0]);
recvPacket.ReadByteSeq(guid[6]); recvPacket.ReadByteSeq(guid[6]);
recvPacket.ReadByteSeq(guid[5]); recvPacket.ReadByteSeq(guid[5]);
recvPacket.ReadByteSeq(guid[7]);
recvPacket.ReadByteSeq(guid[2]); recvPacket.ReadByteSeq(guid[2]);
recvPacket.ReadByteSeq(guid[1]); recvPacket.ReadByteSeq(guid[1]);
recvPacket.ReadByteSeq(guid[3]); recvPacket.ReadByteSeq(guid[3]);
recvPacket.ReadByteSeq(guid[4]);
DEBUG_LOG("WORLD: Received CMSG_OBJECT_UPDATE_FAILED from %s (%u) guid: %s", GetPlayerName(), GetAccountId(), guid.GetString().c_str()); DEBUG_LOG("WORLD: Received CMSG_OBJECT_UPDATE_FAILED from %s (%u) guid: %s", GetPlayerName(), GetAccountId(), guid.GetString().c_str());