mirror of
https://github.com/mangosfour/server.git
synced 2025-12-24 10:37:02 +00:00
[11317] More SQL requests to use prepared statements.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
889ce13264
commit
8fd323a09a
7 changed files with 63 additions and 26 deletions
|
|
@ -930,13 +930,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
|||
|
||||
// Update the last_ip in the database
|
||||
// No SQL injection, username escaped.
|
||||
LoginDatabase.escape_string (address);
|
||||
static SqlStatementID updAccount;
|
||||
|
||||
LoginDatabase.PExecute ("UPDATE account "
|
||||
"SET last_ip = '%s' "
|
||||
"WHERE username = '%s'",
|
||||
address.c_str (),
|
||||
safe_account.c_str ());
|
||||
SqlStatement stmt = LoginDatabase.CreateStatement(updAccount, "UPDATE account SET last_ip = ? WHERE username = ?");
|
||||
stmt.PExecute(address.c_str(), account.c_str());
|
||||
|
||||
// NOTE ATM the socket is single-threaded, have this in mind ...
|
||||
ACE_NEW_RETURN (m_Session, WorldSession (id, this, AccountTypes(security), expansion, mutetime, locale), -1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue