Zesstra | 83f011d | 2016-04-24 20:09:05 +0200 | [diff] [blame^] | 1 | #pragma strict_types, save_types, rtt_checks, pedantic |
| 2 | #pragma no_clone, no_shadow, no_inherit |
| 3 | |
| 4 | // inherit the basic inetd |
| 5 | inherit __DIR__"inetd_base.c"; |
| 6 | |
| 7 | #include <living/comm.h> |
| 8 | #include <driver_info.h> |
| 9 | |
| 10 | // and implement mud-individual stuff that should be implemented as needed. If |
| 11 | // the default is fine for your mud, keep it. |
| 12 | protected void set_user() |
| 13 | { |
| 14 | seteuid(getuid()); |
| 15 | } |
| 16 | |
| 17 | protected void save_me() |
| 18 | { |
| 19 | // save_object(__DIR__"ARCH/inetd"); |
| 20 | } |
| 21 | |
| 22 | protected int restore_me() |
| 23 | { |
| 24 | // return restore_object(__DIR__"ARCH/inetd"); |
| 25 | } |
| 26 | |
| 27 | protected void export_peer_list(mapping list) |
| 28 | { |
| 29 | } |
| 30 | |
| 31 | protected void debug_msg(string msg, int severity) |
| 32 | { |
| 33 | object z=find_player("zesstra"); |
| 34 | if (z) |
| 35 | z->ReceiveMsg(msg, MT_DEBUG, 0, "IM: ", this_object()); |
| 36 | } |
| 37 | |
| 38 | public void receive(string host, string msg, int hostport) |
| 39 | { |
| 40 | if (previous_object() == master()) |
| 41 | process_fragment(host, msg, hostport); |
| 42 | } |
| 43 | |
| 44 | protected void create() |
| 45 | { |
| 46 | configure_host((<host_s> name: "MG-Test-"+__HOST_NAME__, |
| 47 | ip: __HOST_IP_NUMBER__, |
| 48 | port: driver_info(DI_UDP_PORT), |
| 49 | mtu: 1024, |
| 50 | )); |
| 51 | ::create(); |
| 52 | } |
| 53 | |