#include "teller.h"#include <moving.h>#include <attributes.h>#include <terminal.h>#include <wizlevels.h>
gehe zum Quellcode dieser Datei
Funktionen | |
| static | cmd_clear () |
| static | cmd_pop () |
| static | cmd_top () |
| static | cmd_swap () |
| static | cmd_dup () |
| static | cmd_here () |
| static | cmd_stack () |
| static | cmd_inv () |
| static | cmd_rekinv () |
| static | do_rinv (env, depth) |
| static | cmd_me () |
| static | cmd_scan () |
| static | WizLevel (obj) |
| static | IpName (obj) |
| IdleTime (obj) | |
| static | scan_obj (player, obj) |
| static | mk_waitfor (waitfor) |
| static | mk_autoload (autoload) |
| static | print_memory_line (key, data, flag) |
| static | cmd_memory () |
| static | cmd_array () |
| static | cmd_split () |
| static | cmd_player () |
| static | cmd_object () |
| static | cmd_living () |
| static | cmd_say () |
| static | cmd_names () |
| static | cmd_secureinv () |
| static | cmd_logaccess () |
| static | cmd_destruct_bang () |
| static | cmd_destruct () |
| static | cmd_remove () |
| static | cmd_update () |
| static | cmd_update_bang () |
| static | cmd_roomupdate () |
| static | cmd_roomupdate_bang () |
| static | cmd_extroomupdate () |
| static | cmd_extroomupdate_bang () |
| static | collect (data) |
| static | do_roomupdate (destflag, noitems) |
| static | cmd_clone () |
| static | cmd_move () |
| static | cmd_cleanof_bang () |
| static | cmd_cleanof () |
| static | do_cleanof (strong) |
| static | cmd_snoopers () |
| static | cmd_ping () |
| static | ping (argv) |
| static | do_calloutinfo (call) |
| static | cmd_callouts_bang () |
| static | do_calloutinfo2 (call, str) |
| static | cmd_callouts () |
| static | cmd_heartbeats () |
| static | cmd_wer () |
| static | cmd_debuginfo () |
| static | cmd_pretty () |
| static | cmd_doprofile () |
| static | cmd_evaluate () |
| static | write_memory (nam, str, flag, file) |
| static | cmd_dump () |
| static | restore_line (line) |
| static | cmd_restore () |
| static | cmd_if () |
Variablen | |
| inherit | T_BASE |
| static object * | collect_items |
| static cmd_array | ( | ) | [static] |
| static cmd_callouts | ( | ) | [static] |
Definiert in Zeile 834 der Datei t_cmds.c.
00835 { 00836 mixed *calls; 00837 object obj; 00838 string str; 00839 int i,j; 00840 00841 if( !stringp(top()) ) 00842 return error( "TOS ist kein String" ); 00843 str = pop(); 00844 calls = call_out_info(); 00845 if( !pointerp(calls) || !sizeof(calls) ) 00846 { 00847 memo( "Keine Callouts vorhanden" ); 00848 return TRUE; 00849 } 00850 map( calls, #'do_calloutinfo2, str ); 00851 return TRUE; 00852 }
| static cmd_callouts_bang | ( | ) | [static] |
Definiert in Zeile 797 der Datei t_cmds.c.
00798 { 00799 mixed *calls; 00800 object obj; 00801 string name; 00802 int i,j; 00803 00804 calls = call_out_info(); 00805 if( !pointerp(calls) || !sizeof(calls) ) 00806 { 00807 memo( "Keine Callouts vorhanden" ); 00808 return TRUE; 00809 } 00810 map( calls, #'do_calloutinfo ); 00811 return TRUE; 00812 }
| static cmd_cleanof | ( | ) | [static] |
Definiert in Zeile 712 der Datei t_cmds.c.
00713 { 00714 return do_cleanof( FALSE ); 00715 }
| static cmd_cleanof_bang | ( | ) | [static] |
Definiert in Zeile 707 der Datei t_cmds.c.
00708 { 00709 return do_cleanof( TRUE ); 00710 }
| static cmd_clear | ( | ) | [static] |
| static cmd_clone | ( | ) | [static] |
Definiert in Zeile 682 der Datei t_cmds.c.
00683 { 00684 if( !stringp(top()) ) 00685 return error( "clone: TOS ist kein String" ); 00686 if( file_size(top()+".c")<=0 ) 00687 return error( "clone: Kein solches File" ); 00688 push(clone_object(pop())); 00689 //do_move( top(), environment(PL) ); 00690 //top()->move(PL,M_GET|M_SILENT); 00691 return TRUE; 00692 }
| static cmd_debuginfo | ( | ) | [static] |
Definiert in Zeile 899 der Datei t_cmds.c.
00900 { 00901 if( !becomes_obj() ) 00902 return error( "dinfo: TOS ist kein Objekt" ); 00903 debug_info( 0, pop() ); 00904 return TRUE; 00905 }
| static cmd_destruct | ( | ) | [static] |
| static cmd_destruct_bang | ( | ) | [static] |
| static cmd_doprofile | ( | ) | [static] |
Definiert in Zeile 917 der Datei t_cmds.c.
00918 { 00919 do_profile=!do_profile; 00920 if( do_profile ) 00921 memo( "Profile wird geladen" ); 00922 else 00923 memo( "Profile wird nicht geladen" ); 00924 return TRUE; 00925 }
| static cmd_dump | ( | ) | [static] |
Definiert in Zeile 941 der Datei t_cmds.c.
00942 { 00943 string file; 00944 00945 if( !sizeof(stack) || !stringp(top()) ) 00946 file = "/players/"+getuid(PL)+"/.memory.o"; 00947 else 00948 file = pop(); 00949 rm( file ); 00950 write_file( file, "# Dump des Tellerstapels vom " + dtime(time()) + "\n" ); 00951 write_file( file, "# Owner = "+capitalize(getuid(PL))+"\n" ); 00952 walk_mapping( memory, #'write_memory, file ); 00953 return TRUE; 00954 }
| static cmd_dup | ( | ) | [static] |
| static cmd_evaluate | ( | ) | [static] |
| static cmd_extroomupdate | ( | ) | [static] |
Definiert in Zeile 601 der Datei t_cmds.c.
00602 { 00603 return do_roomupdate( FALSE, TRUE ); 00604 }
| static cmd_extroomupdate_bang | ( | ) | [static] |
Definiert in Zeile 606 der Datei t_cmds.c.
00607 { 00608 return do_roomupdate( TRUE, TRUE ); 00609 }
| static cmd_heartbeats | ( | ) | [static] |
Definiert in Zeile 854 der Datei t_cmds.c.
00855 { 00856 mixed *beats; 00857 int i; 00858 object env; 00859 00860 beats = heart_beat_info(); 00861 if( !pointerp(beats) || !sizeof(beats) ) 00862 { 00863 memo( "Keine Heartbeats vorhanden" ); 00864 return TRUE; 00865 } 00866 for( i=0; i<sizeof(beats); i++ ) 00867 { 00868 env = environment(beats[i]); 00869 env = env ? object_name(env) : "-- nirgends --"; 00870 printf( "%-35s %-35s\n", object_name(beats[i]), env ); 00871 } 00872 return TRUE; 00873 }
| static cmd_here | ( | ) | [static] |
| static cmd_if | ( | ) | [static] |
| static cmd_inv | ( | ) | [static] |
Definiert in Zeile 75 der Datei t_cmds.c.
Benutzt becomes_obj(), dump_obj(), error(), i, ob(), top() und TRUE.
00076 { 00077 int i; 00078 object ob; 00079 00080 if( !becomes_obj() ) 00081 return error( "inv: TOS ist kein Objekt" ); 00082 write( "Inventar von " ); 00083 dump_obj( top(), 13 ); 00084 for( i=0, ob=first_inventory(top()); ob; ob=next_inventory(ob), i++ ) 00085 { 00086 printf( "%2d. ", i ); 00087 dump_obj( ob, 4 ); 00088 } 00089 return TRUE; 00090 }

| static cmd_living | ( | ) | [static] |
| static cmd_logaccess | ( | ) | [static] |
Definiert in Zeile 525 der Datei t_cmds.c.
00526 { 00527 dologaccess = !dologaccess; 00528 if( dologaccess ) 00529 memo( "Zugriffe werden gemeldet" ); 00530 else 00531 memo( "Zugriffe werden nicht gemeldet" ); 00532 return TRUE; 00533 }
| static cmd_me | ( | ) | [static] |
| static cmd_memory | ( | ) | [static] |
| static cmd_move | ( | ) | [static] |
Definiert in Zeile 694 der Datei t_cmds.c.
00695 { 00696 object ob; 00697 00698 if( !becomes_obj() ) 00699 return error( "move: Ziel ist kein Objekt" ); 00700 ob = pop(); 00701 if( !becomes_obj() ) 00702 return error( "move: Kein solcher Gegenstand" ); 00703 do_move( pop(), ob ); 00704 return TRUE; 00705 }
| static cmd_names | ( | ) | [static] |
| static cmd_object | ( | ) | [static] |
Definiert in Zeile 460 der Datei t_cmds.c.
00461 { 00462 object ob; 00463 string err,fnam; 00464 00465 if( !stringp(top()) ) 00466 return error( "object: TOS ist kein String" ); 00467 ob = find_object(top()); 00468 if( !ob ) 00469 { 00470 if( !(fnam=this_player()->find_file(top(),".c")) ) 00471 return error( "object: Kein Objekt namens \""+top()+"\" gefunden" ); 00472 if( err=(catch(call_other(fnam,"?"))) ) 00473 return error( "object: Fehler beim Laden: "+err[1..<3] ); 00474 ob = find_object(fnam); 00475 } 00476 pop(); 00477 push(ob); 00478 return TRUE; 00479 }
| static cmd_ping | ( | ) | [static] |
| static cmd_player | ( | ) | [static] |
Definiert in Zeile 444 der Datei t_cmds.c.
00445 { 00446 object ob; 00447 string str; 00448 00449 str = top(); 00450 if( !stringp(str) ) 00451 return error( "player: TOS ist kein String" ); 00452 ob = becomes_pl(); 00453 if( !ob ) 00454 return error( "player: Keinen Spieler namens \""+str+"\" gefunden" ); 00455 //pop(); 00456 //push(ob); 00457 return TRUE; 00458 }
| static cmd_pop | ( | ) | [static] |
| static cmd_pretty | ( | ) | [static] |
| static cmd_rekinv | ( | ) | [static] |
Definiert in Zeile 92 der Datei t_cmds.c.
Benutzt becomes_obj(), do_rinv(), dump_obj(), error(), top() und TRUE.
00093 { 00094 if( !becomes_obj() ) 00095 return error( "rekinv: TOS ist kein Objekt" ); 00096 write( "Inventar von " ); 00097 dump_obj( top(), 13 ); 00098 00099 do_rinv( top(), 2 ); 00100 return TRUE; 00101 }

| static cmd_remove | ( | ) | [static] |
| static cmd_restore | ( | ) | [static] |
Definiert in Zeile 964 der Datei t_cmds.c.
00965 { 00966 string str, *lines; 00967 00968 if( !sizeof(stack) || !stringp(top()) ) 00969 str = "/players/"+getuid(PL)+"/.memory.o"; 00970 else 00971 str = pop(); 00972 00973 if(file_size(str)<=0) 00974 return error( "restore: kann '"+str+"' nicht laden" ); 00975 lines = regexp( old_explode( read_file(str), "\n" ), "^[^#]" ); 00976 map( lines, #'restore_line ); 00977 return TRUE; 00978 }
| static cmd_roomupdate | ( | ) | [static] |
Definiert in Zeile 591 der Datei t_cmds.c.
00592 { 00593 return do_roomupdate( FALSE, FALSE ); 00594 }
| static cmd_roomupdate_bang | ( | ) | [static] |
Definiert in Zeile 596 der Datei t_cmds.c.
00597 { 00598 return do_roomupdate( TRUE, FALSE ); 00599 }
| static cmd_say | ( | ) | [static] |
| static cmd_scan | ( | ) | [static] |
Definiert in Zeile 123 der Datei t_cmds.c.
Benutzt becomes_pl(), destruct(), error(), P_NAME, pop(), scan_obj(), T_PLAYER, top() und TRUE.
00124 { 00125 object obj; 00126 00127 if( !becomes_pl() && ( !objectp(top()) || !living(top()) ) ) 00128 { 00129 if( stringp(top()) && file_size( "/save/"+top()[0..0]+"/"+top()+".o") > 0 ) 00130 { 00131 obj = clone_object( T_PLAYER ); 00132 obj->Load( top() ); 00133 obj->SetProp( P_NAME, capitalize( pop() ) ); 00134 scan_obj( TRUE, obj ); 00135 destruct( obj ); 00136 return TRUE; 00137 } 00138 return error( "scan: TOS ist kein Lebewesen" ); 00139 } 00140 00141 scan_obj( query_once_interactive( top() ), pop() ); 00142 return TRUE; 00143 }

| static cmd_secureinv | ( | ) | [static] |
| static cmd_snoopers | ( | ) | [static] |
Definiert in Zeile 742 der Datei t_cmds.c.
00743 { 00744 string* u, snooper; 00745 int i, flag; 00746 00747 flag = 0; 00748 u = users(); 00749 for( i=0; i<sizeof(u); i++ ) 00750 { 00751 if( snooper = query_snoop(u[i]) ) 00752 { 00753 flag = 1; 00754 printf( "%s wird gesnooped von: %s.\n", 00755 capitalize(getuid(u[i])), capitalize(getuid(snooper)) ); 00756 } 00757 } 00758 if( !flag ) 00759 memo( "Momentan wird niemand gesnooped" ); 00760 return TRUE; 00761 }
| static cmd_split | ( | ) | [static] |
| static cmd_stack | ( | ) | [static] |
Definiert in Zeile 61 der Datei t_cmds.c.
Benutzt dump_obj(), i, memo(), stack und TRUE.
00062 { 00063 int i; 00064 if( !sizeof(stack) ) 00065 return memo( "Der Stack ist leer" ); 00066 00067 for( i=0; i<sizeof(stack); i++ ) 00068 { 00069 printf( "%2d: ", i ); 00070 dump_obj( stack[i], 4 ); 00071 } 00072 return TRUE; 00073 }

| static cmd_swap | ( | ) | [static] |
Definiert in Zeile 35 der Datei t_cmds.c.
Benutzt error(), stack und TRUE.
00036 { 00037 mixed tmp; 00038 00039 if( sizeof(stack)<2 ) 00040 return error( "swap: Keine 2 Elemente auf dem Stack" ); 00041 tmp = stack[0]; 00042 stack[0] = stack[1]; 00043 stack[1] = tmp; 00044 return TRUE; 00045 }

| static cmd_top | ( | ) | [static] |
Definiert in Zeile 26 der Datei t_cmds.c.
Benutzt dump_obj(), error(), stack, top() und TRUE.
00027 { 00028 if( !sizeof(stack) ) 00029 return error( "top: Der Stack ist leer" ); 00030 write( "TOS= " ); 00031 dump_obj( top(), 5 ); 00032 return TRUE; 00033 }

| static cmd_update | ( | ) | [static] |
Definiert in Zeile 568 der Datei t_cmds.c.
00569 { 00570 object blue; 00571 00572 if( !becomes_obj() ) 00573 return error( "update: TOS ist kein Objekt" ); 00574 blue = find_object(old_explode(object_name(top()),"#")[0]); 00575 blue->remove(); 00576 if( blue ) 00577 memo( "update: TOS lebt noch" ); 00578 else 00579 pop(); 00580 return TRUE; 00581 }
| static cmd_update_bang | ( | ) | [static] |
Definiert in Zeile 583 der Datei t_cmds.c.
00584 { 00585 if( !becomes_obj() ) 00586 return error( "update: TOS ist kein Objekt" ); 00587 destruct(find_object(old_explode(object_name(pop()),"#")[0])); 00588 return TRUE; 00589 }
| static cmd_wer | ( | ) | [static] |
Definiert in Zeile 875 der Datei t_cmds.c.
00876 { 00877 object* ppl; 00878 string* pl; 00879 int i; 00880 00881 ppl = sort_array( users(), lambda( ({ 'x, 'y }), 00882 ({ #'<, ({ #'query_ip_number, 'x }), ({ #'query_ip_number, 'y }) }) 00883 )); 00884 pl = ({}); 00885 for( i=0; i<sizeof(ppl); i++ ) 00886 { 00887 pl += ({ sprintf( "%'.'-14s %-15s %3d %s \n", 00888 capitalize(geteuid(ppl[i])), 00889 query_ip_number(ppl[i]), 00890 query_wiz_level(ppl[i])>0 ? query_wiz_level(ppl[i]) 00891 : ppl[i]->QueryProp(P_LEVEL), 00892 query_wiz_level(ppl[i])>0 ? "W" : "P" 00893 ) }); 00894 } 00895 write( implode(pl,"") ); 00896 return TRUE; 00897 }
| static collect | ( | data | ) | [static] |
Definiert in Zeile 613 der Datei t_cmds.c.
00613 { collect_items += ({ data[0] }); }
| static do_calloutinfo | ( | call | ) | [static] |
Definiert in Zeile 782 der Datei t_cmds.c.
00783 { 00784 int l,i; 00785 00786 if( pointerp(call) ) 00787 { 00788 printf( "%5d:%O->%O(", call[2], call[0], call[1]); 00789 if( (l=sizeof(call))>3 ) { 00790 for( ; l>=3 && !call[--l]; ) ; 00791 for( i=3; i<=l; i++ ) printf( "%O%s", call[i], (i==l)?"":"," ); 00792 } 00793 write(")\n"); 00794 } 00795 }
| static do_calloutinfo2 | ( | call | , | |
| str | ||||
| ) | [static] |
Definiert in Zeile 814 der Datei t_cmds.c.
00815 { 00816 string s; 00817 int i,l; 00818 00819 if( pointerp(call) ) 00820 { 00821 s = sprintf( "%5d:%O->%O(", call[2], call[0], call[1]); 00822 if( sizeof(explode(s,str)) > 1 ) 00823 { 00824 write( s ); 00825 if( (l=sizeof(call))>3 ) { 00826 for( ; l>=3 && !call[--l]; ) ; 00827 for( i=3; i<=l; i++ ) printf( "%O%s", call[i], (i==l)?"":"," ); 00828 } 00829 write(")\n"); 00830 } 00831 } 00832 }
| static do_cleanof | ( | strong | ) | [static] |
Definiert in Zeile 717 der Datei t_cmds.c.
00718 { 00719 object *inv; 00720 int i; 00721 string clean_id; 00722 00723 if( !stringp(top()) ) 00724 return error( "cleanof: TOS ist kein String" ); 00725 clean_id = pop(); 00726 if( !becomes_obj() ) 00727 { 00728 push( clean_id ); 00729 return error( "cleanof: Kein Objekt zum Leeren" ); 00730 } 00731 for( i=0, inv=all_inventory(pop()); i<sizeof(inv); i++ ) 00732 if( inv[i]->id(clean_id) ) 00733 { 00734 if( strong ) 00735 destruct( inv[i] ); 00736 else 00737 inv[i]->remove(); 00738 } 00739 return TRUE; 00740 }
| static do_rinv | ( | env | , | |
| depth | ||||
| ) | [static] |
Definiert in Zeile 103 der Datei t_cmds.c.
Benutzt dump_obj(), env(), i und ob().
Wird benutzt von cmd_rekinv().
00104 { 00105 int i; 00106 object ob; 00107 00108 for( i=0, ob=first_inventory(env); ob; ob=next_inventory(ob), i++ ) 00109 { 00110 printf( "%*d. ", depth, i ); 00111 dump_obj( ob, 2+depth ); 00112 do_rinv( ob, depth+2 ); 00113 } 00114 }


| static do_roomupdate | ( | destflag | , | |
| noitems | ||||
| ) | [static] |
Definiert in Zeile 615 der Datei t_cmds.c.
00616 { 00617 object tmproom,newroom; 00618 object *inv; 00619 string errmsg; 00620 string *file; 00621 object *items; 00622 int i; 00623 00624 if( !becomes_obj() ) 00625 return error( "roomupdate: TOS ist kein Objekt" ); 00626 file = old_explode( object_name( top() ), "#" ); 00627 if( sizeof(file) > 1 ) 00628 return error( "roomupdate: TOS ist keine Blueprint" ); 00629 if( file[0] == "/room/void" ) 00630 return error( "roomupdate: Die `void' darf nicht geupdatet werden" ); 00631 00632 // ----- Rettung 00633 tell_room( top(), 00634 "Der Raum verschwimmt vor Deinen Augen, um sich zu erneuern.\n" 00635 ); 00636 tmproom = clone_object( "/room/void" ); 00637 00638 if( noitems ) 00639 // Nur Spieler kommen raus. 00640 inv = filter( all_inventory(top()), #'query_once_interactive ); 00641 else 00642 { // Dinge, die P_ITEMS sind, bleiben da! 00643 collect_items = ({}); 00644 map( top()->QueryProp(P_ITEMS), #'collect ); 00645 inv = all_inventory(top()) - collect_items; 00646 } 00647 00648 for( i=sizeof(inv)-1; i>=0; i-- ) 00649 inv[i]->move( tmproom, M_NOCHECK | M_SILENT | M_NO_SHOW ); 00650 00651 // ----- Vernichtung 00652 if( destflag ) 00653 destruct( pop() ); 00654 else 00655 { 00656 top()->remove(); 00657 if( top() ) 00658 memo( "roomupdate : TOS ist nicht verschwunden." ); 00659 else 00660 pop(); 00661 } 00662 00663 // ----- Neuerschaffung 00664 errmsg = catch( call_other( file[0], "?" ) ); 00665 if( errmsg ) 00666 { 00667 tell_room( tmproom, "Der Raum verbleicht in ein Nichts.\n" ); 00668 push( file[0] ); 00669 return error( "updateroom: " + errmsg[1..<2] ); 00670 } 00671 00672 // ----- Restaurierung 00673 newroom = find_object( file[0] ); 00674 for( i=sizeof(inv)-1; i>=0; i-- ) 00675 if( objectp(inv[i]) ) // Objekte koennten sich beim ersten move zerstoeren. 00676 inv[i]->move( newroom, M_NOCHECK | M_SILENT | M_NO_SHOW ); 00677 tell_room( newroom, "Die Konturen werden wieder scharf.\n" ); 00678 destruct( tmproom ); 00679 return TRUE; 00680 }
| IdleTime | ( | obj | ) |
Definiert in Zeile 183 der Datei t_cmds.c.
Benutzt query_ip_number().
Wird benutzt von scan_obj().
00184 { 00185 if( obj->Notlogged() ) return "-nicht da-"; 00186 if( query_ip_number(obj) ) return ""+query_idle(obj); 00187 return "-netztot-"; 00188 }


| static IpName | ( | obj | ) | [static] |
Definiert in Zeile 153 der Datei t_cmds.c.
Benutzt dtime(), P_CALLED_FROM_IP, P_IP_NAME, query_ip_name(), query_ip_number() und RAW.
Wird benutzt von scan_obj().
00154 { 00155 string ip_name, ip_num, nm; 00156 00157 if( obj->Notlogged() ) 00158 { 00159 // Aus Umstellungsgruenden werden CALLED_FROM_IP und IP_NAME 00160 // abgefragt. IP_NAME ist neuer. 00161 00162 nm = lower_case(obj->playername()); 00163 ip_name = obj->QueryProp(P_CALLED_FROM_IP); 00164 if( !ip_name ) ip_name = obj->Query(P_IP_NAME); 00165 return ip_name + " (" 00166 + dtime(get_dir("/save/"+nm[0..0]+"/"+nm+".o",4)[0]) +")"; 00167 } 00168 else 00169 { 00170 nm = lower_case( obj->name(RAW) ); 00171 ip_name = query_ip_name( obj ); 00172 if( ip_name == "" || !ip_name ) 00173 { 00174 ip_name = obj->QueryProp(P_CALLED_FROM_IP); 00175 if( !ip_name ) ip_name = obj->Query(P_IP_NAME); 00176 return ip_name + " (" 00177 + dtime(get_dir("/save/"+nm[0..0]+"/"+nm+".o",4)[0]) +")"; 00178 } 00179 return ip_name + " [" + query_ip_number(obj) + "]"; 00180 } 00181 }


| static mk_autoload | ( | autoload | ) | [static] |
Definiert in Zeile 381 der Datei t_cmds.c.
Wird benutzt von scan_obj().
00382 { 00383 string str, *objlist; 00384 int i; 00385 00386 if( !mappingp(autoload) ) 00387 return; 00388 str = "Autoload...: "; 00389 objlist = m_indices(autoload); 00390 for( i=sizeof(objlist)-1; i>=0; i-- ) 00391 { 00392 str += "\"" + objlist[i] + "\"\n"; 00393 if( i>0 ) 00394 str += " "; 00395 } 00396 write( str ); 00397 }

| static mk_waitfor | ( | waitfor | ) | [static] |
Definiert in Zeile 367 der Datei t_cmds.c.
Benutzt i.
Wird benutzt von scan_obj().
00368 { 00369 string str; 00370 int i; 00371 00372 if( !pointerp(waitfor) || sizeof(waitfor)==0 ) 00373 return; 00374 str = "Waiting for: "; 00375 for( i=sizeof(waitfor)-1; i>0; i-- ) 00376 str += waitfor[i] + ", "; 00377 str += waitfor[0]; 00378 write( str+"\n" ); 00379 }

| static ping | ( | argv | ) | [static] |
| static print_memory_line | ( | key | , | |
| data | , | |||
| flag | ||||
| ) | [static] |
| static restore_line | ( | line | ) | [static] |
| static scan_obj | ( | player | , | |
| obj | ||||
| ) | [static] |
Definiert in Zeile 190 der Datei t_cmds.c.
Benutzt ARCH_LVL, armour, break_string(), extract(), FEMALE, gender, GOD_LVL, hands, i, IdleTime(), IpName(), level, list, LORD_LVL, MALE, mk_autoload(), mk_waitfor(), name, old_explode(), P_AC, P_AGE, P_ALCOHOL, P_ALIGN, P_ARMOURS, P_ATTRIBUTES, P_AUTOLOAD, P_BODY, P_BRIEF, P_DRINK, P_FOOD, P_FROG, P_GENDER, P_GHOST, P_HANDS, P_HP, P_KILLS, P_LEVEL, P_MAILADDR, P_MARRIED, P_MAX_ALCOHOL, P_MAX_DRINK, P_MAX_FOOD, P_MAX_HP, P_MAX_SP, P_QP, P_RACE, P_SECOND, P_SP, P_TESTPLAYER, P_TITLE, P_WAITFOR, P_WANTS_TO_LEARN, P_WC, P_WEAPON, P_WIMPY, P_XP, player, query_snoop(), QueryProp(), quests, RAW, room, SEER_LVL, stats, time2string(), TRUE, weapon, WER, WIZARD_LVL und WizLevel().
Wird benutzt von cmd_scan().
00191 { 00192 string title, level, gender, room, testpl, 00193 weapon, armour, quest, stat_str, *arr; 00194 int i,ac; 00195 object weaponobj, *list, *gegner; 00196 mixed *hands, *quests, *stats; 00197 00198 // 1.Zeile : Name Titel - Rasse - [ Wizlevel ] 00199 title = obj->QueryProp(P_TITLE); 00200 00201 if( !player ) 00202 level = "Monster" ; 00203 else if( WizLevel( obj ) < WIZARD_LVL ) 00204 { 00205 if( testpl=obj->QueryProp( P_TESTPLAYER ) ) 00206 { 00207 if( stringp(testpl) ) 00208 level = "("+testpl+")"; 00209 else 00210 level = "Testspieler"; 00211 } 00212 else if( WizLevel( obj ) >= SEER_LVL ) 00213 level = "Seher"; 00214 else 00215 level = "Spieler" ; 00216 } 00217 else if( WizLevel( obj ) >= GOD_LVL ) 00218 level = "MudGott" ; 00219 else if( WizLevel( obj ) >= ARCH_LVL ) 00220 level = "Erzmagier" ; 00221 else if( WizLevel( obj ) >= LORD_LVL ) 00222 level = "Regionsmagier" ; 00223 else 00224 level = "Magier" ; 00225 00226 if( !obj->short() ) 00227 level += ", unsichtbar" ; 00228 if( obj -> QueryProp( P_FROG ) ) 00229 level += ", Frosch" ; 00230 if( obj->QueryProp( P_GHOST ) ) 00231 level += ", tot"; 00232 if( obj->Notlogged() ) 00233 level += ", ausgeloggt"; 00234 if(obj->QueryProp(P_SECOND) ) 00235 level +=", Zweitie"; 00236 00237 if( environment(obj) ) 00238 room = object_name(environment( obj )); 00239 else 00240 room = "-nirgends-"; 00241 00242 printf( "%s %s %s[ %s ].\nBefindet sich in %s.\n", 00243 obj->name(RAW), title? title : "", 00244 stringp(obj->QueryProp(P_RACE)) ? "- "+obj->QueryProp(P_RACE)+" - " : "", 00245 level, room ) ; 00246 00247 // 1 abc Zeile : Host,Email,Snooper 00248 if( player ) 00249 { 00250 printf( "Host.......: %s\n", IpName(obj) ); 00251 printf( "E-Mail.....: %s.\n", obj->QueryProp(P_MAILADDR) ); 00252 if( !obj->Notlogged() && query_snoop(obj) ) 00253 printf( "Snooper....: %s.\n", capitalize(getuid(query_snoop(obj))) ); 00254 00255 printf( "Vorsicht...: %11d Kurzmodus.: %11s Magierblick....: %11s.\n", 00256 obj->QueryProp(P_WIMPY), obj->QueryProp(P_BRIEF) ? "-an-" : "-aus-", 00257 obj->QueryProp(P_WANTS_TO_LEARN) ? "-an-" : "-aus-" ); 00258 printf( "Idlezeit...: %11s Alter.....: %11s Verheiratet mit: %-11s.\n", 00259 IdleTime(obj), time2string("%5d:%02h:%02m",obj->QueryProp(P_AGE)*2), 00260 (stringp(obj->QueryProp(P_MARRIED)) ? obj->QueryProp(P_MARRIED) : "-" ) 00261 ); 00262 } 00263 00264 // 2.Zeile : HP, SP und XP 00265 printf( "Lebenspkt..: [%4d/%4d] Magiepkt..: [%4d/%4d].\n" + 00266 "Questpunkte: [%4d/%4d] Erfahrung.: %11d.\n", 00267 obj->QueryProp(P_HP), obj->QueryProp(P_MAX_HP), 00268 obj->QueryProp(P_SP), obj->QueryProp(P_MAX_SP), 00269 obj->QueryProp(P_QP), "/secure/questmaster"->QueryMaxQP(), 00270 obj->QueryProp(P_XP) ); 00271 00272 // 3.Zeile : FOOD, DRINK, ALCOHOL 00273 printf( "Nahrung....: [%4d/%4d] Fluessigk.: [%4d/%4d] " + 00274 "Alkohol........: [%4d/%4d].\n", 00275 obj->QueryProp(P_FOOD), obj->QueryProp(P_MAX_FOOD), 00276 obj->QueryProp(P_DRINK), obj->QueryProp(P_MAX_DRINK), 00277 obj->QueryProp(P_ALCOHOL), obj->QueryProp(P_MAX_ALCOHOL) ) ; 00278 00279 // 4.Zeile : Geschlecht, Alignment, Level 00280 switch( obj->QueryProp(P_GENDER) ) 00281 { 00282 case FEMALE : gender = "weiblich " ; break ; 00283 case MALE : gender = "maennlich " ; break ; 00284 default : gender = "neutrum " ; break ; 00285 } 00286 printf( 00287 "Geschlecht.: %s Charakter.: %11d (Magier)Stufe..: [%4s/%4d].\n", 00288 gender, obj->QueryProp(P_ALIGN), 00289 player ? WizLevel(obj)+"" : "-", obj->QueryProp(P_LEVEL) ); 00290 00291 // 5.Zeile : Geld, Gewicht, Playerkills 00292 printf( "Geld.......: %11d Traegt....: %11d Playerkills....: %11d.\n", 00293 obj->QueryMoney(), obj->query_weight_contents(), 00294 obj->QueryProp(P_KILLS) ); 00295 00296 // 6.Zeile : stati 00297 stats = obj->QueryProp(P_ATTRIBUTES) ; 00298 arr = m_indices( stats ); 00299 stat_str = "" ; 00300 for( i = 0; i < sizeof( arr ); i++ ) { 00301 stat_str += capitalize(arr[ i ]) + "[" + stats[arr[ i ]]; 00302 if( ac = obj->QueryAttributeOffset(arr[i]) ) { 00303 stat_str += "+" + ac; 00304 } 00305 stat_str += "], "; 00306 } 00307 00308 if( stat_str == "" ) 00309 stat_str = "Keine" ; 00310 else 00311 stat_str = extract( stat_str, 0, strlen( stat_str ) - 3 ) ; 00312 printf( "Attribute..: %s.\n", stat_str ) ; 00313 00314 // 7.Zeile : Waffe( Dateiname )[ AC ] 00315 // 8.Zeile : Ruestung(en)[ WC ] 00316 weaponobj=obj->QueryProp(P_WEAPON); 00317 if( weaponobj ) 00318 weapon = weaponobj->name(RAW) + " (" + 00319 object_name( weaponobj ) + ") [" + 00320 weaponobj->QueryProp(P_WC) + "]" ; 00321 else 00322 { 00323 hands = obj->QueryProp(P_HANDS); 00324 weapon = sprintf( "kaempft%s [%d]", hands[0], hands[1] ); 00325 } 00326 ac = 0; 00327 list = obj->QueryProp(P_ARMOURS); 00328 armour = ""; 00329 for( i = 0; i < sizeof( list ); i++ ) 00330 { 00331 armour += ( list[i]->name(RAW) + "[" + 00332 list[i]->QueryProp(P_AC) + "]" + ", ") ; 00333 ac += list[i]->QueryProp(P_AC); 00334 } 00335 00336 if( armour == "" ) 00337 armour = "Keine " ; 00338 00339 arr = old_explode( break_string( armour[0..<3]+sprintf(" =>[%d]", 00340 ac+obj->QueryProp(P_BODY) ), 65 ), "\n" ) ; 00341 armour = arr[ 0 ] ; 00342 for( i = 1; i < sizeof( arr ); i++ ) 00343 armour += "\n " + arr[ i ] ; 00344 printf( "Waffe......: %s.\nRuestung...: %s.\n", weapon, armour ) ; 00345 00346 gegner = obj->QueryEnemies(); 00347 if( pointerp(gegner) ) 00348 { 00349 gegner = gegner[0]; 00350 for( i=0; i<sizeof(gegner); i++ ) 00351 { 00352 if( i==0 ) printf( "Gegner.....: "); else printf( " " ); 00353 if( !objectp(gegner[i]) ) 00354 printf( "<%O>\n", gegner[i] ); 00355 else 00356 printf( "%s (%s)\n", gegner[i]->name(WER,0), object_name(gegner[i]) ); 00357 } 00358 } 00359 00360 mk_waitfor( obj->QueryProp(P_WAITFOR) ); 00361 00362 mk_autoload( obj->QueryProp(P_AUTOLOAD) ); 00363 00364 return TRUE; 00365 }


| static WizLevel | ( | obj | ) | [static] |
Definiert in Zeile 145 der Datei t_cmds.c.
Benutzt query_wiz_level().
Wird benutzt von scan_obj().
00146 { 00147 if( obj->Notlogged() ) 00148 return query_wiz_level( lower_case(obj->playername()) ); 00149 else 00150 return query_wiz_level( obj ); 00151 }


| static write_memory | ( | nam | , | |
| str | , | |||
| flag | , | |||
| file | ||||
| ) | [static] |
object* collect_items [static] |
1.6.3