Advertisement
Guest User

Untitled

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