Changeset 78 for trunk/src/trinitycore/CliRunnable.cpp
- Timestamp:
- 11/19/08 13:32:10 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/trinitycore/CliRunnable.cpp
r44 r78 68 68 void CliSetLogLevel(char*,pPrintf); 69 69 void CliUpTime(char*,pPrintf); 70 void CliSet TBC(char*,pPrintf);70 void CliSetAddon(char*,pPrintf); 71 71 void CliWritePlayerDump(char*,pPrintf); 72 72 void CliLoadPlayerDump(char*,pPrintf); … … 92 92 {"setgm", & CliSetGM,"Edit user privileges"}, 93 93 {"setpass", & CliSetPassword,"Set password for account"}, 94 {"set bc", & CliSetTBC,"Set user expansionallowed"},94 {"setaddon", & CliSetAddon,"Set user expansion addon level allowed"}, 95 95 {"listgm", & CliListGM,"Display user privileges"}, 96 96 {"loadscripts", & CliLoadScripts,"Load script library"}, … … 473 473 ///- Display the list of account/characters online 474 474 zprintf("=====================================================================\r\n"); 475 zprintf("| Account | Character | IP | GM | TBC|\r\n");475 zprintf("| Account | Character | IP | GM | Exp |\r\n"); 476 476 zprintf("=====================================================================\r\n"); 477 477 … … 486 486 // No SQL injection. account is uint32. 487 487 // 0 1 2 3 488 QueryResult *resultLogin = loginDatabase.PQuery("SELECT username, last_ip, gmlevel, tbcFROM account WHERE id = '%u'",account);488 QueryResult *resultLogin = loginDatabase.PQuery("SELECT username, last_ip, gmlevel, expansion FROM account WHERE id = '%u'",account); 489 489 490 490 if(resultLogin) … … 1038 1038 1039 1039 /// Set/Unset the TBC flag for an account 1040 void CliSet TBC(char *command,pPrintf zprintf)1040 void CliSetAddon(char *command,pPrintf zprintf) 1041 1041 { 1042 1042 ///- Get the command line arguments 1043 1043 char *szAcc = strtok(command," "); 1044 char *sz TBC= strtok(NULL," ");1045 1046 if(!szAcc||!sz TBC)1047 { 1048 zprintf("Syntax is: setbc $account $number (0 - normal, 1 - tbc )>\r\n");1049 return; 1050 } 1051 1052 int lev=atoi(sz TBC); //get int anyway (0 if error)1053 1054 if( (lev > 1)|| (lev < 0))1055 { 1056 zprintf("Syntax is: setbc $account $number (0 - normal, 1 - tbc )>\r\n");1044 char *szExp = strtok(NULL," "); 1045 1046 if(!szAcc||!szExp) 1047 { 1048 zprintf("Syntax is: setbc $account $number (0 - normal, 1 - tbc, 2 - wotlk)>\r\n"); 1049 return; 1050 } 1051 1052 int lev=atoi(szExp); //get int anyway (0 if error) 1053 1054 if(lev < 0) 1055 { 1056 zprintf("Syntax is: setbc $account $number (0 - normal, 1 - tbc, 2 - wotlk)>\r\n"); 1057 1057 return; 1058 1058 } … … 1075 1075 { 1076 1076 // No SQL injection (account name is escaped) 1077 loginDatabase.PExecute("UPDATE account SET tbc= '%d' WHERE username = '%s'",lev,safe_account_name.c_str());1077 loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE username = '%s'",lev,safe_account_name.c_str()); 1078 1078 zprintf("We set %s to expansion allowed %d\r\n",safe_account_name.c_str(),lev); 1079 1079