All help topics · Link to this topic
Showing help on 'connection_name()'
Syntax: connection_name (OBJ <player>, [INT method]) => STRWhen provided just a player object this function only returns obj's hostname (e.g. 1-2-3-6.someplace.com). An optional argument allows you to specify 1 if you want a numeric IP address, or 2 if you want to return the legacy connection_name string.
Warning: If you are using a LambdaMOO core, this is a semi-breaking change. You'll want to update any code on your server that runs connection_name to pass in the argument for returning the legacy connection_name string if you want things to work exactly the same.
If the programmer is not a wizard and not player, then E_PERM is raised. If player is not currently connected, then E_INVARG is raised.
Legacy Connection String Information:
For the TCP/IP networking configurations, for in-bound connections, the string has the form:
"port lport from host, port port"
where lport is the decimal TCP listening port on which the connection arrived, host is either the name or decimal TCP address of the host from which the player is connected, and port is the decimal TCP port of the connection on that host.
For outbound TCP/IP connections, the string has the form
"port lport to host, port port"
where lport is the decimal local TCP port number from which the connection originated, host is either the name or decimal TCP address of the host to which the connection was opened, and port is the decimal TCP port of the connection on that host.
For the System V 'local' networking configuration, the string is the UNIX login name of the connecting user or, if no such name can be found, something of the form:
"User #number"
where number is a UNIX numeric user ID.
For the other networking configurations, the string is the same for all connections and, thus, useless.