#include <config.h>#include <udp.h>
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 |
| string adjust | ( | string | str, | |
| int | wid | |||
| ) |
| 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 }

| int last |
Definiert in Zeile 10 der Datei who.c.
Wird benutzt von _do_unwear(), _do_wear(), AddExp(), create(), dump_group(), expire(), finger_single(), reset(), SetTradingData() und StdSkill_Nightvision().
1.6.3