void psCommandManager::BuildXML(int securityLevel, csString &dest, bool subscribe)
{
    CommandGroup* grp = commandGroups.Get(securityLevel, NULL);
    if(!grp)
        return;

    dest.AppendFmt("<subscribe value='%s' />", subscribe ? "true":"false");

    for(size_t z = 0; z < grp->commands.GetSize(); z++)
    {
        csString cmd(grp->commands[z].GetData());
        if(cmd.GetAt(0) == '/')   // Make a list of the commands, but leave out the specials
            dest.AppendFmt("<command name='%s' />", cmd.GetData());
    }
}
Esempio n. 2
0
void psServerStatusRunEvent::ReportClient(Client * curr, ClientStatusLogger & clientLogger, csString & reportString)
{
    if (curr->IsSuperClient() || !curr->GetActor()) 
        return;

    const psCharacter *chr = curr->GetCharacterData();
    // log this client's info with the clientLogger
    clientLogger.LogClientInfo(curr);

    psGuildInfo *guild = curr->GetActor()->GetGuild();
    csString guildTitle;
    csString guildName;
    if (guild && guild->id && !guild->IsSecret())
    {
        psGuildLevel *level = curr->GetActor()->GetGuildLevel();
        if (level)
        {
            guildTitle = EscpXML(level->title);
        }
        guildName = EscpXML(guild->name);
    }
    
    reportString.AppendFmt("<player name=\"%s\" characterID=\"%u\" guild=\"%s\" title=\"%s\" security=\"%d\" kills=\"%u\" deaths=\"%u\" suicides=\"%u\" pos_x=\"%.2f\" pos_y=\"%.2f\" pos_z=\"%.2f\" sector=\"%s\" />\n",
                           EscpXML(curr->GetName()).GetData(), chr->GetPID().Unbox(), guildName.GetDataSafe(), guildTitle.GetDataSafe(), curr->GetSecurityLevel(), chr->GetKills(), chr->GetDeaths(), chr->GetSuicides(), chr->location.loc.x, chr->location.loc.y, chr->location.loc.z, EscpXML(chr->location.loc_sector->name).GetData());
}