Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Login with 3.2.2.10257 should work now.
  • Loading branch information
tomrus88 committed Aug 15, 2009
1 parent 742fb59 commit c3055c3
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 21 deletions.
7 changes: 1 addition & 6 deletions src/game/CharacterHandler.cpp
Expand Up @@ -589,12 +589,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
data << pCurrChar->GetOrientation();
SendPacket(&data);

data.Initialize( SMSG_ACCOUNT_DATA_TIMES, 4+1+8*4 ); // changed in WotLK
data << uint32(time(NULL)); // unix time of something
data << uint8(1);
for(int i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
data << uint32(GetAccountData(i)->Time); // also unix time
SendPacket(&data);
SendAccountDataTimes(PER_CHARACTER_CACHE_MASK);

data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
data << uint8(2); // unknown value
Expand Down
17 changes: 9 additions & 8 deletions src/game/DBCStructure.h
Expand Up @@ -645,14 +645,15 @@ struct ChrRacesEntry
uint32 TeamID; // 7 (7-Alliance 1-Horde)
// 8-11 unused
uint32 CinematicSequence; // 12 id from CinematicSequences.dbc
char* name[16]; // 13-28 used for DBC language detection/selection
// 29 string flags, unused
//char* nameFemale[16]; // 30-45, if different from base (male) case
// 46 string flags, unused
//char* nameNeutralGender[16]; // 47-62, if different from base (male) case
// 63 string flags, unused
// 64-66 unused
uint32 expansion; // 67 (0 - original race, 1 - tbc addon, ...)
//uint32 unk_322; // 13
char* name[16]; // 14-29 used for DBC language detection/selection
// 30 string flags, unused
//char* nameFemale[16]; // 31-46, if different from base (male) case
// 47 string flags, unused
//char* nameNeutralGender[16]; // 48-63, if different from base (male) case
// 64 string flags, unused
// 65-67 unused
uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...)
};

/* not used
Expand Down
2 changes: 1 addition & 1 deletion src/game/DBCfmt.h
Expand Up @@ -33,7 +33,7 @@ const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
// ChatChannelsEntryfmt, index not used (more compact store)
const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
const char ChrRacesEntryfmt[]="nxixiixixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char ChrRacesEntryfmt[]="nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx";
const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx";
Expand Down
2 changes: 1 addition & 1 deletion src/game/Opcodes.cpp
Expand Up @@ -548,7 +548,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketUpdateTextOpcode },
/*0x208*/ { "SMSG_GMTICKET_UPDATETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x209*/ { "SMSG_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_LOGGEDIN, &WorldSession::HandleRequestAccountData },
/*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_AUTHED, &WorldSession::HandleRequestAccountData },
/*0x20B*/ { "CMSG_UPDATE_ACCOUNT_DATA", STATUS_AUTHED, &WorldSession::HandleUpdateAccountData },
/*0x20C*/ { "SMSG_UPDATE_ACCOUNT_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x20D*/ { "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
Expand Down
4 changes: 3 additions & 1 deletion src/game/World.cpp
Expand Up @@ -242,14 +242,16 @@ World::AddSession_ (WorldSession* s)
pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION));
s->SendPacket(&pkt);

s->SendAccountDataTimes(GLOBAL_CACHE_MASK);

s->SendTutorialsData();

UpdateMaxSessionCounters ();

// Updates the population
if (pLimit > 0)
{
float popu = GetActiveSessionCount (); //updated number of users on the server
float popu = GetActiveSessionCount (); // updated number of users on the server
popu /= pLimit;
popu *= 2;
loginDatabase.PExecute ("UPDATE realmlist SET population = '%f' WHERE id = '%d'", popu, realmID);
Expand Down
12 changes: 12 additions & 0 deletions src/game/WorldSession.cpp
Expand Up @@ -568,6 +568,18 @@ void WorldSession::SetAccountData(uint32 type, time_t time_, std::string data)
CharacterDatabase.CommitTransaction ();
}

void WorldSession::SendAccountDataTimes(uint32 mask)
{
WorldPacket data( SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4 ); // changed in WotLK
data << uint32(time(NULL)); // unix time of something
data << uint8(1);
data << uint32(mask);
for(int i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if(mask & (1 << i))
data << uint32(GetAccountData(i)->Time); // also unix time
SendPacket(&data);
}

void WorldSession::LoadTutorialsData()
{
for ( int aX = 0 ; aX < 8 ; ++aX )
Expand Down
17 changes: 16 additions & 1 deletion src/game/WorldSession.h
Expand Up @@ -46,7 +46,21 @@ class CharacterHandler;

#define CHECK_PACKET_SIZE(P,S) if((P).size() < (S)) return SizeError((P),(S));

#define NUM_ACCOUNT_DATA_TYPES 8
enum AccountDataTypes
{
GLOBAL_CONFIG_CACHE = 0, // 0x01 g
PER_CHARACTER_CONFIG_CACHE = 1, // 0x02 p
GLOBAL_BINDINGS_CACHE = 2, // 0x04 g
PER_CHARACTER_BINDINGS_CACHE = 3, // 0x08 p
GLOBAL_MACROS_CACHE = 4, // 0x10 g
PER_CHARACTER_MACROS_CACHE = 5, // 0x20 p
PER_CHARACTER_LAYOUT_CACHE = 6, // 0x40 p
PER_CHARACTER_CHAT_CACHE = 7, // 0x80 p
NUM_ACCOUNT_DATA_TYPES = 8
};

#define GLOBAL_CACHE_MASK 0x15
#define PER_CHARACTER_CACHE_MASK 0xEA

struct AccountData
{
Expand Down Expand Up @@ -189,6 +203,7 @@ class MANGOS_DLL_SPEC WorldSession
// Account Data
AccountData *GetAccountData(uint32 type) { return &m_accountData[type]; }
void SetAccountData(uint32 type, time_t time_, std::string data);
void SendAccountDataTimes(uint32 mask);
void LoadAccountData();
void LoadTutorialsData();
void SendTutorialsData();
Expand Down
13 changes: 10 additions & 3 deletions src/game/WorldSocket.cpp
Expand Up @@ -262,8 +262,13 @@ int WorldSocket::open (void *a)
m_Address = remote_addr.get_host_addr ();

// Send startup packet.
WorldPacket packet (SMSG_AUTH_CHALLENGE, 4);
WorldPacket packet (SMSG_AUTH_CHALLENGE, 24);
packet << uint32(1);
packet << m_Seed;
packet << uint32(0xF3539DA3);
packet << uint32(0x6E8547B9);
packet << uint32(0x9A6AA2F8);
packet << uint32(0xA4F170F4);

if (SendPacket (packet) == -1)
return -1;
Expand Down Expand Up @@ -744,6 +749,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
uint8 digest[20];
uint32 clientSeed;
uint32 unk2, unk3;
uint64 unk4;
uint32 BuiltNumberClient;
uint32 id, security;
uint8 expansion = 0;
Expand All @@ -755,7 +761,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)

BigNumber K;

if (recvPacket.size () < (4 + 4 + 1 + 4 + 4 + 20))
if (recvPacket.size () < (4 + 4 + 1 + 4 + 4 + 8 + 20))
{
sLog.outError ("WorldSocket::HandleAuthSession: wrong packet size");
return -1;
Expand All @@ -767,13 +773,14 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
recvPacket >> account;
recvPacket >> unk3;

if (recvPacket.size () < (4 + 4 + (account.size () + 1) + 4 + 4 + 20))
if (recvPacket.size () < (4 + 4 + (account.size () + 1) + 4 + 4 + 8 + 20))
{
sLog.outError ("WorldSocket::HandleAuthSession: wrong packet size second check");
return -1;
}

recvPacket >> clientSeed;
recvPacket >> unk4;
recvPacket.read (digest, 20);

DEBUG_LOG ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
Expand Down

0 comments on commit c3055c3

Please sign in to comment.