[10019] Update realmd opcode list.

Thanks to Phazerz for helping with research.
This commit is contained in:
XTZGZoReX 2010-07-13 19:55:21 +02:00
parent 603d576d60
commit eadeda8f5d
4 changed files with 47 additions and 31 deletions

View file

@ -25,17 +25,33 @@
enum eAuthCmd enum eAuthCmd
{ {
AUTH_LOGON_CHALLENGE = 0x00, CMD_AUTH_LOGON_CHALLENGE = 0x00,
AUTH_LOGON_PROOF = 0x01, CMD_AUTH_LOGON_PROOF = 0x01,
AUTH_RECONNECT_CHALLENGE = 0x02, CMD_AUTH_RECONNECT_CHALLENGE = 0x02,
AUTH_RECONNECT_PROOF = 0x03, CMD_AUTH_RECONNECT_PROOF = 0x03,
//update srv =4 CMD_REALM_LIST = 0x10,
REALM_LIST = 0x10, CMD_XFER_INITIATE = 0x30,
XFER_INITIATE = 0x30, CMD_XFER_DATA = 0x31,
XFER_DATA = 0x31, // these opcodes no longer exist in currently supported client
XFER_ACCEPT = 0x32, CMD_XFER_ACCEPT = 0x32,
XFER_RESUME = 0x33, CMD_XFER_RESUME = 0x33,
XFER_CANCEL = 0x34 CMD_XFER_CANCEL = 0x34
};
// not used by us currently
enum eAuthSrvCmd
{
CMD_GRUNT_AUTH_CHALLENGE = 0x0,
CMD_GRUNT_AUTH_VERIFY = 0x2,
CMD_GRUNT_CONN_PING = 0x10,
CMD_GRUNT_CONN_PONG = 0x11,
CMD_GRUNT_HELLO = 0x20,
CMD_GRUNT_PROVESESSION = 0x21,
CMD_GRUNT_KICK = 0x24,
CMD_GRUNT_PCWARNING = 0x29,
CMD_GRUNT_STRINGS = 0x41,
CMD_GRUNT_SUNKENUPDATE = 0x44,
CMD_GRUNT_SUNKEN_ONLINE = 0x46
}; };
enum AuthResult enum AuthResult

View file

@ -159,14 +159,14 @@ typedef struct AuthHandler
const AuthHandler table[] = const AuthHandler table[] =
{ {
{ AUTH_LOGON_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleLogonChallenge }, { CMD_AUTH_LOGON_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleLogonChallenge },
{ AUTH_LOGON_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleLogonProof }, { CMD_AUTH_LOGON_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleLogonProof },
{ AUTH_RECONNECT_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleReconnectChallenge}, { CMD_AUTH_RECONNECT_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleReconnectChallenge},
{ AUTH_RECONNECT_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleReconnectProof }, { CMD_AUTH_RECONNECT_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleReconnectProof },
{ REALM_LIST, STATUS_AUTHED, &AuthSocket::_HandleRealmList }, { CMD_REALM_LIST, STATUS_AUTHED, &AuthSocket::_HandleRealmList },
{ XFER_ACCEPT, STATUS_CONNECTED, &AuthSocket::_HandleXferAccept }, { CMD_XFER_ACCEPT, STATUS_CONNECTED, &AuthSocket::_HandleXferAccept },
{ XFER_RESUME, STATUS_CONNECTED, &AuthSocket::_HandleXferResume }, { CMD_XFER_RESUME, STATUS_CONNECTED, &AuthSocket::_HandleXferResume },
{ XFER_CANCEL, STATUS_CONNECTED, &AuthSocket::_HandleXferCancel } { CMD_XFER_CANCEL, STATUS_CONNECTED, &AuthSocket::_HandleXferCancel }
}; };
#define AUTH_TOTAL_COMMANDS sizeof(table)/sizeof(AuthHandler) #define AUTH_TOTAL_COMMANDS sizeof(table)/sizeof(AuthHandler)
@ -279,7 +279,7 @@ void AuthSocket::SendProof(Sha1Hash sha)
{ {
sAuthLogonProof_S_BUILD_6005 proof; sAuthLogonProof_S_BUILD_6005 proof;
memcpy(proof.M2, sha.GetDigest(), 20); memcpy(proof.M2, sha.GetDigest(), 20);
proof.cmd = AUTH_LOGON_PROOF; proof.cmd = CMD_AUTH_LOGON_PROOF;
proof.error = 0; proof.error = 0;
proof.unk2 = 0x00; proof.unk2 = 0x00;
@ -296,7 +296,7 @@ void AuthSocket::SendProof(Sha1Hash sha)
{ {
sAuthLogonProof_S proof; sAuthLogonProof_S proof;
memcpy(proof.M2, sha.GetDigest(), 20); memcpy(proof.M2, sha.GetDigest(), 20);
proof.cmd = AUTH_LOGON_PROOF; proof.cmd = CMD_AUTH_LOGON_PROOF;
proof.error = 0; proof.error = 0;
proof.unk1 = 0x00800000; proof.unk1 = 0x00800000;
proof.unk2 = 0x00; proof.unk2 = 0x00;
@ -361,7 +361,7 @@ bool AuthSocket::_HandleLogonChallenge()
_safelogin = _login; _safelogin = _login;
LoginDatabase.escape_string(_safelogin); LoginDatabase.escape_string(_safelogin);
pkt << (uint8) AUTH_LOGON_CHALLENGE; pkt << (uint8) CMD_AUTH_LOGON_CHALLENGE;
pkt << (uint8) 0x00; pkt << (uint8) 0x00;
///- Verify that this IP is not in the ip_banned table ///- Verify that this IP is not in the ip_banned table
@ -545,7 +545,7 @@ bool AuthSocket::_HandleLogonProof()
{ {
// no patch found // no patch found
ByteBuffer pkt; ByteBuffer pkt;
pkt << (uint8) AUTH_LOGON_CHALLENGE; pkt << (uint8) CMD_AUTH_LOGON_CHALLENGE;
pkt << (uint8) 0x00; pkt << (uint8) 0x00;
pkt << (uint8) WOW_FAIL_VERSION_INVALID; pkt << (uint8) WOW_FAIL_VERSION_INVALID;
DEBUG_LOG("[AuthChallenge] %u is not a valid client version!", _build); DEBUG_LOG("[AuthChallenge] %u is not a valid client version!", _build);
@ -571,11 +571,11 @@ bool AuthSocket::_HandleLogonProof()
PatchCache::instance()->GetHash(tmp, (uint8*)&xferh.md5); PatchCache::instance()->GetHash(tmp, (uint8*)&xferh.md5);
} }
uint8 data[2] = { AUTH_LOGON_PROOF, WOW_FAIL_VERSION_UPDATE}; uint8 data[2] = { CMD_AUTH_LOGON_PROOF, WOW_FAIL_VERSION_UPDATE};
send((const char*)data, sizeof(data)); send((const char*)data, sizeof(data));
memcpy(&xferh, "0\x05Patch", 7); memcpy(&xferh, "0\x05Patch", 7);
xferh.cmd = XFER_INITIATE; xferh.cmd = CMD_XFER_INITIATE;
xferh.file_size = file_size; xferh.file_size = file_size;
send((const char*)&xferh, sizeof(xferh)); send((const char*)&xferh, sizeof(xferh));
@ -680,7 +680,7 @@ bool AuthSocket::_HandleLogonProof()
} }
else else
{ {
char data[4]= { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0}; char data[4]= { CMD_AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0};
send(data, sizeof(data)); send(data, sizeof(data));
BASIC_LOG("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ()); BASIC_LOG("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ());
@ -779,7 +779,7 @@ bool AuthSocket::_HandleReconnectChallenge()
///- Sending response ///- Sending response
ByteBuffer pkt; ByteBuffer pkt;
pkt << (uint8) AUTH_RECONNECT_CHALLENGE; pkt << (uint8) CMD_AUTH_RECONNECT_CHALLENGE;
pkt << (uint8) 0x00; pkt << (uint8) 0x00;
_reconnectProof.SetRand(16 * 8); _reconnectProof.SetRand(16 * 8);
pkt.append(_reconnectProof.AsByteArray(16),16); // 16 bytes random pkt.append(_reconnectProof.AsByteArray(16),16); // 16 bytes random
@ -813,7 +813,7 @@ bool AuthSocket::_HandleReconnectProof()
{ {
///- Sending response ///- Sending response
ByteBuffer pkt; ByteBuffer pkt;
pkt << (uint8) AUTH_RECONNECT_PROOF; pkt << (uint8) CMD_AUTH_RECONNECT_PROOF;
pkt << (uint8) 0x00; pkt << (uint8) 0x00;
pkt << (uint16) 0x00; // 2 bytes zeros pkt << (uint16) 0x00; // 2 bytes zeros
send((char const*)pkt.contents(), pkt.size()); send((char const*)pkt.contents(), pkt.size());
@ -863,7 +863,7 @@ bool AuthSocket::_HandleRealmList()
LoadRealmlist(pkt, id); LoadRealmlist(pkt, id);
ByteBuffer hdr; ByteBuffer hdr;
hdr << (uint8) REALM_LIST; hdr << (uint8) CMD_REALM_LIST;
hdr << (uint16)pkt.size(); hdr << (uint16)pkt.size();
hdr.append(pkt); hdr.append(pkt);

View file

@ -107,7 +107,7 @@ int PatchHandler::svc(void)
int flags = MSG_NOSIGNAL; int flags = MSG_NOSIGNAL;
Chunk data; Chunk data;
data.cmd = XFER_DATA; data.cmd = CMD_XFER_DATA;
ssize_t r; ssize_t r;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10188" #define REVISION_NR "10019"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__