MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | #include <interactive_info.h> |
| 3 | |
| 4 | mixed interactive_info(object ob, int what) |
| 5 | |
| 6 | DESCRIPTION |
| 7 | Returns some internal information about the interactive user <ob>. |
| 8 | The argument <what> determines which information is returned. |
| 9 | |
| 10 | It can be either a configuration option as given to |
| 11 | configure_interactive() or one of the following options: |
| 12 | |
| 13 | |
| 14 | |
| 15 | Connection Information: |
| 16 | |
| 17 | <what> == II_IP_NAME: |
| 18 | The hostname of <ob>. The hostname will asynchronously |
| 19 | looked up by the ERQ daemon and might therefore not be |
| 20 | available at the time of the first connection. |
| 21 | If no name is available the address will be returned. |
| 22 | |
| 23 | <what> == II_IP_NUMBER: |
| 24 | The IP address of <ob> given as a string. |
| 25 | |
| 26 | <what> == II_IP_PORT: |
| 27 | The client port number of <ob>. |
| 28 | |
| 29 | <what> == II_IP_ADDRESS: |
| 30 | The full socket address structure given as an array of bytes. |
| 31 | |
| 32 | For IPv4 (sockaddr_in): |
| 33 | array[0.. 1]: sin_family |
| 34 | array[2.. 3]: sin_port |
| 35 | array[4.. 7]: sin_addr |
| 36 | array[8..15]: undefined. |
| 37 | |
| 38 | For IPv6 (sockaddr_in6): |
| 39 | array[ 0.. 1]: sin6_family |
| 40 | array[ 2.. 3]: sin6_port |
| 41 | array[ 4.. 7]: sin6_flowinfo |
| 42 | array[ 8..23]: sin6_addr |
| 43 | array[24..27]: sin6_scope_id |
| 44 | |
| 45 | <what> == II_MUD_PORT: |
| 46 | The server port number that <ob> connected to. |
| 47 | |
| 48 | |
| 49 | |
| 50 | Telnet Related Information: |
| 51 | |
| 52 | <what> == II_MCCP_STATS: |
| 53 | Statistics about the current compression of <ob> given |
| 54 | as an array ({ uncompressed bytes, compressed bytes }). |
| 55 | |
| 56 | If the connection is not compressed, 0 is returned. |
| 57 | |
| 58 | Available only if the driver is compiled with MCCP enabled; |
| 59 | __MCCP__ is defined in that case. |
| 60 | |
| 61 | |
| 62 | |
| 63 | Input Handling: |
| 64 | |
| 65 | <what> == II_INPUT_PENDING: |
| 66 | If <ob> has an input_to() pending, the object that has called |
| 67 | the input_to() is returned, else 0. |
| 68 | |
| 69 | <what> == II_EDITING: |
| 70 | If <ob> is currently editing with ed() and ed() was called with |
| 71 | an exit function, then the object that has called ed() |
| 72 | will be returned, 0 otherwise. |
| 73 | |
| 74 | <what> == II_IDLE: |
| 75 | The number of seconds that the interactive object <ob> has been |
| 76 | idle. |
| 77 | |
| 78 | |
| 79 | |
| 80 | Output Handling: |
| 81 | |
| 82 | <what> == II_SNOOP_NEXT: |
| 83 | Returns the user who is currently snooping <ob>. |
| 84 | The calling object must be privileged by the master object |
| 85 | via valid_query_snoop(). |
| 86 | |
| 87 | <what> == II_SNOOP_PREV: |
| 88 | Returns the victim who is currently snooped by <ob>. |
| 89 | The calling object must be privileged by the master object |
| 90 | via valid_query_snoop(). |
| 91 | |
| 92 | <what> == II_SNOOP_ALL: |
| 93 | Returns all objects who are currently snooping <ob>. |
| 94 | Only one object can snoop <ob> directly, but that user might |
| 95 | be snooped, too, and so building a chain that is returned |
| 96 | as an array. |
| 97 | |
| 98 | The calling object must be privileged by the master object |
| 99 | via valid_query_snoop(). |
| 100 | |
| 101 | |
| 102 | HISTORY |
| 103 | Introduced in LDMud 3.5.0. |
| 104 | |
| 105 | SEE ALSO |
| 106 | configure_interactive(E), object_info(E), driver_info(E) |