MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // htmlwho.c |
| 4 | // |
| 5 | // $Id: htmlwho.c 8755 2014-04-26 13:13:40Z Zesstra $ |
| 6 | |
| 7 | #pragma weak_types |
| 8 | |
| 9 | #include <udp.h> |
| 10 | |
| 11 | #define TJ(x) if (find_player("jof")) tell_object(find_player("jof"),x) |
| 12 | |
| 13 | string adjust(string str,int wid) |
| 14 | { |
| 15 | int w2; |
| 16 | |
| 17 | w2=wid/2; |
| 18 | wid=wid-w2; |
| 19 | return extract(" ",0,wid-1)+str+ |
| 20 | extract(" ",0,w2-1); |
| 21 | } |
| 22 | |
| 23 | udp_htmlwho(data) |
| 24 | { |
| 25 | int i,num; |
| 26 | string *mdata; |
| 27 | string wholiste,tmp,tmp2; |
| 28 | |
| 29 | mdata="/obj/werliste"->QueryWhoListe(0,0,1); |
| 30 | num=sizeof(mdata); |
| 31 | for (i=num-1;i>=0;i--) |
| 32 | { |
| 33 | tmp=mdata[i][0]->name(); |
| 34 | if (tmp&&sizeof(tmp)) |
| 35 | { |
| 36 | tmp2=explode(mdata[i][1],tmp); |
| 37 | if (sizeof(tmp2)>1) |
| 38 | { |
| 39 | tmp2[0]="<A HREF=\"/htbin/mudwww?finger?"+getuid(mdata[i][0])+"\"><b>"; |
| 40 | tmp2[1]="</b></A>"+tmp2[1]; |
| 41 | mdata[i][1]=implode(tmp2,tmp); |
| 42 | } |
| 43 | mdata[i]=" <LI> "+mdata[i][1]; |
| 44 | } |
| 45 | } |
| 46 | wholiste=implode(mdata,"\n"); |
| 47 | INETD->_send_udp(data[NAME], ([ |
| 48 | REQUEST: REPLY, |
| 49 | RECIPIENT: data[SENDER], |
| 50 | ID: data[ID], |
| 51 | DATA: wholiste |
| 52 | ]) ); |
| 53 | } |