Esempio n. 1
0
/// Display info on users currently in the realm
bool ChatHandler::HandleAccountOnlineListCommand(const char* args)
{
    char* limit_str = *args ? strtok((char*)args, " ") : NULL;
    uint32 limit = limit_str ? atoi (limit_str) : 100;

    ///- Get the list of accounts ID logged to the realm
    //                                                 0   1         2        3        4
    QueryResult *result = LoginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE active_realm_id = %u", realmID);

    return ShowAccountListHelper(result,&limit);
}
Esempio n. 2
0
/// Display info on users currently in the realm
bool ChatHandler::HandleAccountOnlineListCommand(char* args)
{
    uint32 limit;
    if (!ExtractOptUInt32(&args, limit, 100))
        return false;

    ///- Get the list of accounts ID logged to the realm
    //                                                 0   1         2        3        4
    QueryResult *result = LoginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE current_realm = %u", realmID);

    return ShowAccountListHelper(result,&limit);
}
/// Display info on users currently in the realm
bool ChatHandler::HandleAccountOnlineListCommand(char* args)
{
    uint32 limit;
    if (!ExtractOptUInt32(&args, limit, 100))
        return false;

    ///- Get the list of accounts ID logged to the realm
    //                                                 0   1         2        3        4
    QueryResult* result = LoginDatabase.PQuery("SELECT a.id, a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE active_realm_id = %u", realmID);

    return ShowAccountListHelper(result, &limit);
}