mudsock
index
(built-in)

Contains the Python wrapper for sockets, and utilities for listing
currently connected sockets.

 
Classes
       
__builtin__.object
Mudsock

 
class Mudsock(__builtin__.object)
    Python Socket object
 
  Methods defined here:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
aux(...)
Alias for mudsock.Mudsock.getAuxiliary
bell = __bell(s)
Set a flashing marker in the title to let someone know the MUD wants their attention.
bust_prompt(...)
bust_prompt()
 
Busts the socket's prompt so it will be displayed next pulse.
close(...)
close()
 
Closes the socket's connection.
edit_text(...)
edit_text(dflt_value, on_complete, mode='text')
 
Enter the text editor, and set its default value. When the text editor
is edited, call on_complete. This function should take two arguments:
the socket doing the editing, and the output of the editor. Mode can
be 'text' or 'script'.
getAuxiliary(...)
getAuxiliary(name)
 
Returns socket's auxiliary data of the specified name.
pop_ih(...)
pop_ih()
 
Pops the socket's current input handler from its input handler stack.
push_ih(...)
push_ih(handler_func, prompt_func, state=None)
 
Pushes a new input handler and prompt pair onto the socket's input
handler stack. Optionally, a (String) state value can be supplied.
Input handlers take two arguments: the socket and a string command.
Prompts take one argument: the socket. They should send the relevant
text for the prompt to the socket.
replace_ih(...)
repalce_ih(handler_func, prompt_func, state=None)
 
Calls pop_ih, followed by push_ih.
send(...)
send(mssg, dict = None, newline = True)
 
Sends message to the socket. Messages can have scripts embedded in
them, using [ and ]. If so, a variable dictionary must be provided. By
default, 'me' references the socket being sent the message.
sendMSDP = __sendMSDP(s, key, val=None)
Send a new MSDP variable to the client if MSDP is enabled. Store the
variable to be sure not to send repeated information.
send_raw(...)
send_raw(mssg)
 
Sends text to the socket. No appended newline.
trans_raw(...)
trans_raw(mssg)
 
Sends text to the socket. No appended newline, and no checking for the prompt.

Properties defined here:
MSDP
True if MSDP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MSDP. Delete this to resume automatic detection of MSDP support.
get = __getmsdp(s)
set = __setmsdp(s, v)
delete = __delmsdp(s)
MSP
True if MSP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MSP. Delete this to resume automatic detection of MSP support.
get = __getmsp(s)
set = __setmsp(s, v)
delete = __delmsp(s)
MXP
True if MXP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MXP. Delete this to resume automatic detection of MXP support.
get = __getmxp(s)
set = __setmxp(s, v)
delete = __delmxp(s)
c256
Gets or sets the state of 256-colors mode on the socket. Set to True to enable, False to disable, or delete to use the automatically detect state based on client identification.
get = __getc256(s)
set = __setc256(s, v)
delete = __delc256(s)
client
The client software, as given by TELOPT_TTYPE.
get = __getclient(s)
endofrecord
True if the client has requested END-OF-RECORD codes, else False. See RFC 885 for more on END-OF-RECORD.
get = __geteor(s)
n256
The automatically detected state of 256-colors mode, based on client identification.
get = __getn256(s)
nMSDP
True if the client has requested MSDP, else False.
get = __getnmsp(s)
nMSP
True if the client has requested MSP, else False.
get = __getnmsp(s)
nMXP
True if the client has requested MXP, else False.
get = __getnmxp(s)
# Read Only Properties / Methods
nTitle
The automatically detected state of window title support, based on client identification.
get = __getntitle(s)
telopt
The auxiliary data of the advanced_telopt module.
get = __gettelopt(s)
set = __settelopt(s, data)
title
True if title string output to the client is enabled, else false. Setting a string to this property will change the window title message. Setting a boolean to this property will forcibly enable or disable title output. Delete this to determine title support based on the report client.
get = __gettitle(s)
set = __settitle(s, v)
delete = __deltitle(s)

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
account = <attribute 'account' of 'mudsock.Mudsock' objects>
The account currently attached to the socket, or None. Immutable.
see mudsys.attach_account_socket for connecting sockets and accounts.
can_use = <attribute 'can_use' of 'mudsock.Mudsock' objects>
True or False if the socket is ready for use. Socket becomes available
after its dns addresss resolves. Immutable.
ch = <attribute 'ch' of 'mudsock.Mudsock' objects>
Alias for mudsock.Mudsock.character.
char = <attribute 'char' of 'mudsock.Mudsock' objects>
Alias for mudsock.Mudsock.character
character = <attribute 'character' of 'mudsock.Mudsock' objects>
The character currently attached to the socket, on None. Immutable.
see mudsys.attach_char_socket for connecting characters to account.
cols = <attribute 'cols' of 'mudsock.Mudsock' objects>
The width of the client's output in columns.
has_input = <attribute 'has_input' of 'mudsock.Mudsock' objects>
True or False if the socket has any input pending. Immutable.
hostname = <attribute 'hostname' of 'mudsock.Mudsock' objects>
The dns address that the socket is connected from. Immutable.
idle_time = <attribute 'idle_time' of 'mudsock.Mudsock' objects>
How long (in seconds) the socket's input handler has been idle for. Immutable.
outbound_text = <attribute 'outbound_text' of 'mudsock.Mudsock' objects>
The socket's outbound text.
rows = <attribute 'rows' of 'mudsock.Mudsock' objects>
The height of the client's output in rows.
state = <attribute 'state' of 'mudsock.Mudsock' objects>
The state that the socket is in. Immutable. For more on states see
mudsock.Mudsock.push_ih
uid = <attribute 'uid' of 'mudsock.Mudsock' objects>
The socket's uid. Immutable.

 
Functions
       
socket_list(...)
socket_list()
 
Returns a list of all sockets currently connected.