diff options
author | Nefertumm <nefertumtg@gmail.com> | 2017-08-20 01:00:00 -0300 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-08-20 06:00:00 +0200 |
commit | fd684a858c877fca1f248a1affab8a9c014254c9 (patch) | |
tree | 91e60c9f2e38d5edefebb1d481580751bee1a724 /src/scripts/Commands/cs_misc.cpp | |
parent | 0dd68dfbee97eb7ed2c9bd4109ba3f2aed697860 (diff) |
Implement ip2nation and ip2nationCountries (#518)
* Implement ip2nation and ip2nationCountries
* fix account.sql
* Tabs
* Codestyle
* More codestyle
* Maybe not. Fk travis.
* Missing field on LOGIN_SEL_ACCOUNT_INFO_BY_NAME
* Update WorldSocket.cpp
Diffstat (limited to 'src/scripts/Commands/cs_misc.cpp')
-rw-r--r-- | src/scripts/Commands/cs_misc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/scripts/Commands/cs_misc.cpp b/src/scripts/Commands/cs_misc.cpp index 3ad187cac5..1af226c38e 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -1887,7 +1887,19 @@ public: #if TRINITY_ENDIAN == BIGENDIAN EndianConvertReverse(ip); #endif + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP2NATION_COUNTRY); + stmt->setUInt32(0, ip); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); + + if (result2) + { + Field* fields2 = result2->Fetch(); + lastIp.append(" ("); + lastIp.append(fields2[0].GetString()); + lastIp.append(")"); + } } else { |