mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Auth: Reverted part of fb43a92cc2 - session key is still needed after logging in to be able to switch realms
This commit is contained in:
@@ -26,7 +26,7 @@ CREATE TABLE `account` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
|
||||
`username` varchar(32) NOT NULL DEFAULT '',
|
||||
`sha_pass_hash` varchar(40) NOT NULL DEFAULT '',
|
||||
`sessionkey` varchar(80) NOT NULL DEFAULT '' COMMENT 'Temporary storage of session key used to pass data from authserver to worldserver',
|
||||
`sessionkey` varchar(80) NOT NULL DEFAULT '',
|
||||
`v` varchar(64) NOT NULL DEFAULT '',
|
||||
`s` varchar(64) NOT NULL DEFAULT '',
|
||||
`email` varchar(254) NOT NULL DEFAULT '',
|
||||
|
||||
1
sql/updates/auth/2013_02_08_00_auth_account.sql
Normal file
1
sql/updates/auth/2013_02_08_00_auth_account.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `account` CHANGE `sessionkey` `sessionkey` varchar(80) NOT NULL DEFAULT '' AFTER `sha_pass_hash`;
|
||||
@@ -207,7 +207,7 @@ AuthSocket::AuthSocket(RealmSocket& socket) : pPatch(NULL), socket_(socket)
|
||||
// Close patch file descriptor before leaving
|
||||
AuthSocket::~AuthSocket(void) {}
|
||||
|
||||
// Accept the connection and set the s random value for SRP6
|
||||
// Accept the connection
|
||||
void AuthSocket::OnAccept(void)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort());
|
||||
|
||||
@@ -933,12 +933,6 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
// NOTE ATM the socket is single-threaded, have this in mind ...
|
||||
ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1);
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_CLEAR_SESSIONKEY);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
m_Crypt.Init(&k);
|
||||
|
||||
m_Session->LoadGlobalAccountData();
|
||||
|
||||
@@ -35,7 +35,6 @@ void LoginDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(LOGIN_UPD_CLEAR_SESSIONKEY, "UPDATE account SET sessionkey = '' WHERE id = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -53,7 +53,6 @@ enum LoginDatabaseStatements
|
||||
LOGIN_INS_ACCOUNT_AUTO_BANNED,
|
||||
LOGIN_DEL_ACCOUNT_BANNED,
|
||||
LOGIN_SEL_SESSIONKEY,
|
||||
LOGIN_UPD_CLEAR_SESSIONKEY,
|
||||
LOGIN_UPD_VS,
|
||||
LOGIN_UPD_LOGONPROOF,
|
||||
LOGIN_SEL_LOGONCHALLENGE,
|
||||
|
||||
Reference in New Issue
Block a user