diff options
author | maximius <none@none> | 2009-09-27 21:23:06 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-27 21:23:06 -0700 |
commit | 77e5c0362e574d878fcc7f6eafd51df8d197e561 (patch) | |
tree | 349eecf4bfc1b579788b3fa2fc25078326f8bb82 /src/game/Level0.cpp | |
parent | 7d60e2fb184e7e62d62ce6592112af9f340d3a5a (diff) |
*Add ".account addon" command, now players can change their account's expansion.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level0.cpp')
-rw-r--r-- | src/game/Level0.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp index 1efd3f2ce7a..95e35475cc1 100644 --- a/src/game/Level0.cpp +++ b/src/game/Level0.cpp @@ -234,6 +234,25 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args) return true; } +bool ChatHandler::HandleAccountAddonCommand(const char* args) +{ + if(!*args) + return false; + + char *szExp = strtok((char*)args," "); + + uint32 account_id = m_session->GetAccountId(); + + int lev=atoi(szExp); //get int anyway (0 if error) + if(lev < 0) + return false; + + // No SQL injection + loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",lev,account_id); + PSendSysMessage(LANG_ACCOUNT_ADDON,lev); + return true; +} + bool ChatHandler::HandleAccountLockCommand(const char* args) { if (!*args) |