tkMOO-light

Experimental @who Widget

The @who widget is designed to receive XMCP/1.1 messages from a MOO server comprising a list of lines, with each line of data holding the name, idle time and location name for each connected user. The data is sorted so that people with lower idle times appear higher up in the display and the idle time is also used to provide a colour. The darker the person's name is, the less time they have been idle.

The same approach has been used when ordering room names (in the bigger image). A room's 'idle' time is calculated as the least idle time for all people in that room. Screen clutter is reduced by not printing the room name along side every name, but only the first name mentioned in each room.

The MOO provides data using the following small script, and isn't required to do any costly sorting or formatting of the data. The client takes the data and performs all the necessary formatting and colour assignment.

    @program me:xmcp_who this none this
    driver = #<objectid of XMCP/1.1 driver>;
    kv = {};
    lines = {};
    for p in (connected_players())
      idle = idle_seconds(p);
      name = p.name;
      location = valid(p.location) ? p.location.name | "*NOWHERE*";
      line = tostr("idle: ", idle, " name: \"", name, "\" location: \"", 
                   location, "\"");
      lines = {@lines, line};
    endfor
    driver:client_notify(player, "xmcp-who", kv, lines);
    .

    @program me:@xwho none none none
    this:xmcp_who();
    .

Two views of the same data are available with information grouped by User (the small image) and by Location (the bigger image). These two snapshots were taken with slightly different data.