Show
Ignore:
Timestamp:
11/19/08 13:32:10 (17 years ago)
Author:
yumileroy
Message:

[svn] * fixed help for subcommands - source mangos
* Renamed accounts column tbc to expansion and it only took a little over 4 hours o.O

Original author: KingPin?
Date: 2008-10-20 12:23:56-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/trinitycore/CliRunnable.cpp

    r44 r78  
    6868void CliSetLogLevel(char*,pPrintf); 
    6969void CliUpTime(char*,pPrintf); 
    70 void CliSetTBC(char*,pPrintf); 
     70void CliSetAddon(char*,pPrintf); 
    7171void CliWritePlayerDump(char*,pPrintf); 
    7272void CliLoadPlayerDump(char*,pPrintf); 
     
    9292    {"setgm", & CliSetGM,"Edit user privileges"}, 
    9393    {"setpass", & CliSetPassword,"Set password for account"}, 
    94     {"setbc", & CliSetTBC,"Set user expansion allowed"}, 
     94    {"setaddon", & CliSetAddon,"Set user expansion addon level allowed"}, 
    9595    {"listgm", & CliListGM,"Display user privileges"}, 
    9696    {"loadscripts", & CliLoadScripts,"Load script library"}, 
     
    473473    ///- Display the list of account/characters online 
    474474    zprintf("=====================================================================\r\n"); 
    475     zprintf("|    Account    |       Character      |       IP        | GM | TBC |\r\n"); 
     475    zprintf("|    Account    |       Character      |       IP        | GM | Exp |\r\n"); 
    476476    zprintf("=====================================================================\r\n"); 
    477477 
     
    486486        // No SQL injection. account is uint32. 
    487487        //                                                      0         1        2        3 
    488         QueryResult *resultLogin = loginDatabase.PQuery("SELECT username, last_ip, gmlevel, tbc FROM account WHERE id = '%u'",account); 
     488        QueryResult *resultLogin = loginDatabase.PQuery("SELECT username, last_ip, gmlevel, expansion FROM account WHERE id = '%u'",account); 
    489489 
    490490        if(resultLogin) 
     
    10381038 
    10391039/// Set/Unset the TBC flag for an account 
    1040 void CliSetTBC(char *command,pPrintf zprintf) 
     1040void CliSetAddon(char *command,pPrintf zprintf) 
    10411041{ 
    10421042    ///- Get the command line arguments 
    10431043    char *szAcc = strtok(command," "); 
    1044     char *szTBC =  strtok(NULL," "); 
    1045  
    1046     if(!szAcc||!szTBC) 
    1047     { 
    1048         zprintf("Syntax is: setbc $account $number (0 - normal, 1 - tbc)>\r\n"); 
    1049         return; 
    1050     } 
    1051  
    1052     int lev=atoi(szTBC);                                    //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"); 
    10571057        return; 
    10581058    } 
     
    10751075    { 
    10761076        // 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()); 
    10781078        zprintf("We set %s to expansion allowed %d\r\n",safe_account_name.c_str(),lev); 
    10791079