Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # HG changeset patch
- # User kerhong
- # Date 1307742969 -10800
- # Node ID 3ae289f110b6d08cb865c48bce9367d5d4dc3eca
- # Parent 79def85433cc32b145f0bcfff8cc97ffae2ec247
- Add database field for operating system storage
- diff -r 79def85433cc -r 3ae289f110b6 sql/updates/operatingSystem.sql
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/sql/updates/operatingSystem.sql Sat Jun 11 00:56:09 2011 +0300
- @@ -0,0 +1,1 @@
- +ALTER TABLE `account` ADD COLUMN `operatingSystem` VARCHAR(5) NULL DEFAULT NULL COMMENT 'Possible values: [Win] [OSX]' AFTER `recruiter`
- \ No newline at end of file
- diff -r 79def85433cc -r 3ae289f110b6 src/server/authserver/Server/AuthSocket.cpp
- --- a/src/server/authserver/Server/AuthSocket.cpp Fri Jun 10 12:16:40 2011 +0200
- +++ b/src/server/authserver/Server/AuthSocket.cpp Sat Jun 11 00:56:09 2011 +0300
- @@ -329,6 +329,11 @@
- sLog->outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size);
- sLog->outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
- + if (ch->os[3]) operatingSystem.push_back(ch->os[3]);
- + if (ch->os[2]) operatingSystem.push_back(ch->os[2]);
- + if (ch->os[1]) operatingSystem.push_back(ch->os[1]);
- + if (ch->os[0]) operatingSystem.push_back(ch->os[0]);
- +
- // BigEndian code, nop in little endian case
- // size already converted
- #if TRINITY_ENDIAN == TRINITY_BIGENDIAN
- @@ -605,7 +610,8 @@
- stmt->setString(0, K_hex);
- stmt->setString(1, socket().get_remote_address().c_str());
- stmt->setUInt32(2, GetLocaleByName(_localizationName));
- - stmt->setString(3, _login);
- + stmt->setString(3, operatingSystem.c_str());
- + stmt->setString(4, _login);
- LoginDatabase.Execute(stmt);
- OPENSSL_free((void*)K_hex);
- diff -r 79def85433cc -r 3ae289f110b6 src/server/authserver/Server/AuthSocket.h
- --- a/src/server/authserver/Server/AuthSocket.h Fri Jun 10 12:16:40 2011 +0200
- +++ b/src/server/authserver/Server/AuthSocket.h Sat Jun 11 00:56:09 2011 +0300
- @@ -86,6 +86,7 @@
- // Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
- // between enUS and enGB, which is important for the patch system
- std::string _localizationName;
- + std::string operatingSystem;
- uint16 _build;
- uint8 _expversion;
- AccountTypes _accountSecurityLevel;
- diff -r 79def85433cc -r 3ae289f110b6 src/server/shared/Database/Implementation/LoginDatabase.h
- --- a/src/server/shared/Database/Implementation/LoginDatabase.h Fri Jun 10 12:16:40 2011 +0200
- +++ b/src/server/shared/Database/Implementation/LoginDatabase.h Sat Jun 11 00:56:09 2011 +0300
- @@ -77,7 +77,7 @@
- {LOGIN_SET_ACCAUTOBANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC},
- {LOGIN_GET_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},
- {LOGIN_SET_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC},
- - {LOGIN_SET_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0 WHERE username = ?", CONNECTION_ASYNC},
- + {LOGIN_SET_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, operatingSystem = ?, failed_logins = 0 WHERE username = ?", CONNECTION_ASYNC},
- {LOGIN_GET_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},
- {LOGIN_SET_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC},
- {LOGIN_GET_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement