mudlist.bak

tmi2_fluffos_v2/lib/cmds/std/mudlist.bak · 1.3 KB

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

#include <i3.h>
int cmd_mudlist(string args){
    string *mud, flags;
    mixed *vls;
    int i,j;
    mapping list, services;
 
     list = I3_DAEMON->query_mudlist();
    if(!sizeof(list)){ write("Error: No muds on I3 Network!\n"); return 1; }
    mud = keys(list);
    vls = values(list);
    write("There are currently "+sizeof(mud)+" muds on the I3 Network!\n");
    write(sprintf("%-15s %-17s %-5s %-15s %s\n", "Name", "IP", "Port", "MudLib", "T W F L C N M L"));
    write(sprintf("%-15s %-17s %-5s %-15s %s\n", "----", "--", "----", "------", "- - - - - - - -"));
    for(i=0;i<sizeof(mud);i++){
        flags = "";
        services = vls[i][10];
        if(services["tell"]) flags += "* ";
        else flags += "  ";
        if(services["who"]) flags += "* ";
        else flags += "  ";
        if(services["finger"]) flags += "* ";
        else flags += "  ";
        if(services["locate"]) flags += "* ";
        else flags += "  ";
        if(services["channel"]) flags += "* ";
        else flags += "  ";
        if(services["news"]) flags += "* ";
        else flags += "  ";
        if(services["mail"]) flags += "* ";
        else flags += "  ";
        write(sprintf("%-15s %-17s %-5d %-15s %s\n", mud[i], vls[i][1], vls[i][2], vls[i][5], flags));
    }
    return 1;
}
 

Site Stats

Snippets: 1791
Codebases: 571