who.c-Dateireferenz

#include <config.h>
#include <udp.h>
Include-Abhängigkeitsdiagramm für who.c:

gehe zum Quellcode dieser Datei

Funktionen

void create ()
string adjust (string str, int wid)
void udp_who (mapping data)

Variablen

int last
int maxtoday
int maxever

Dokumentation der Funktionen

string adjust ( string  str,
int  wid 
)

Definiert in Zeile 25 der Datei who.c.

Benutzt extract().

00026 {
00027   int w2;
00028 
00029   w2=wid/2;
00030   wid=wid-w2;
00031   return extract("                                                          ",0,wid-1)+str+
00032     extract("                                                         ",0,w2-1);
00033 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

void create (  ) 

Definiert in Zeile 13 der Datei who.c.

Benutzt last, maxever und maxtoday.

00014 {
00015   string tmp1, tmp2, dummy;
00016 
00017   if (time()-last<1800) return;
00018   last=time();
00019   tmp1=read_file("/etc/maxusers.ever",0,1);
00020   tmp2=read_file("/etc/maxusers",0,1);
00021   if (stringp(tmp1)&&strlen(tmp1)) sscanf(tmp1,"%d %s",maxever,dummy);
00022   if (stringp(tmp2)&&strlen(tmp2)) sscanf(tmp2,"%d %s",maxtoday,dummy);
00023 }

void udp_who ( mapping  data  ) 

Definiert in Zeile 35 der Datei who.c.

Benutzt _MUDLIB_NAME_, _MUDLIB_VERSION_, adjust(), create(), DATA, i, ID, INETD, lines, maxever, maxtoday, MUDNAME, NAME, RECIPIENT, REPLY, REQUEST, SENDER und uptime().

00036 {
00037   int i;
00038   string *lines;
00039   string wholiste,header;
00040 
00041   create();
00042   lines="/obj/werliste"->QueryWhoListe(0, 1);
00043   wholiste=implode(lines,"\n");
00044   lines=({
00045     "*------------------------------------------------------------------------*",
00046     "","","","",
00047     "*------------------------------------------------------------------------*"});
00048   header=MUDNAME", LDMud "+__VERSION__;
00049   lines[1]="|"+adjust(header,strlen(lines[0])-strlen(header)-2)+"|";
00050   header="Adresse: MG.Mud.DE (87.79.24.60) 23 (alternativ 4711)";
00051   lines[2]="|"+adjust(header,strlen(lines[0])-strlen(header)-2)+"|";
00052   header="Uptime: "+uptime();
00053   lines[3]="|"+adjust(header,strlen(lines[0])-strlen(header)-2)+"|";
00054   header=_MUDLIB_NAME_"-Mudlib "_MUDLIB_VERSION_;
00055   lines[4]="|"+adjust(header,strlen(lines[0])-strlen(header)-2)+"|";
00056   header=implode(lines,"\n");
00057   wholiste=header+"\n"+wholiste+sprintf("\n*** Anwesende im "MUDNAME": Max. heute %d, Rekord %d\n",maxtoday,maxever);
00058   INETD->_send_udp(data[NAME], ([
00059                                                                 REQUEST: REPLY,
00060                                                                 RECIPIENT: data[SENDER],
00061                                                                 ID: data[ID],
00062                                                                 DATA: wholiste
00063                                                                 ]) );
00064 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:


Variablen-Dokumentation

int last
int maxever

Definiert in Zeile 11 der Datei who.c.

Wird benutzt von create() und udp_who().

int maxtoday

Definiert in Zeile 11 der Datei who.c.

Wird benutzt von create() und udp_who().

Erzeugt am Thu Jun 3 14:42:00 2010 für MorgenGrauen Mudlib von  doxygen 1.6.3