The PlayerController is another link between the socket and the
actual Player objects.
Methods
|
|
|
|
getControlledObject
|
getControlledObject ( self )
Returns the controlled interactive.
returns:
(mudlib.living.Interactive) |
|
getIPAddress
|
getIPAddress ( self )
Returns the ip address of the user.
Each user connects from somewhere else on the network (or Internet)
and this returns the IP address which they connected from as a
string.
returns:
(string) |
|
getIdleTime
|
getIdleTime ( self )
Returns the idle time of the user.
The idle time is measured as the amount of time since the user
last typed something.
returns:
(int) the number of seconds since the user last typed something |
|
getUserProperty
|
getUserProperty (
self,
name,
default=None,
)
Retrieves a property on the User object
The User instance stores information about the user's socket
connection and connection state. This allows you to retrieve
that information.
arguments:
-
name
- (string) the name of the property you want to retrieve
-
default=None
- (object) the default if that property is not there
|
|
logout
|
logout ( self )
Called when the user types quit--this calls the logout
method of the User object. |
|
noteDisconnect
|
noteDisconnect ( self )
|
|
noteError
|
noteError ( self, errorMessage )
Notifies the player they just bumped into a bug.
When something kicks up an exception, it notifies the player
so that they know something bad just happened.
arguments:
-
errorMessage
- (string) the error--we ignore this in
PlayerController
|
|
rawwrite
|
rawwrite ( self, message )
Writes a message raw--no formatting done to the user.
arguments:
-
message
- (string) the message to write directly to the user
|
|
replaceController
|
replaceController ( self, newController )
Switches this controller out for a new one.
Sometimes, like in the case of when a Player becomes a Coder,
we want to switch the controller that user has. This is
the method for such an action.
arguments:
-
newController
- (controller)
|
|
setUser
|
setUser ( self, connectedUser )
Sets the connected user for this controller.
arguments:
-
connectedUser
- (User)
|
|
write
|
write ( self, message )
Takes in a string and a series of arguments and parses the string
and sends it on its way to _connectedUser.write to write to the
socket. arguments:
-
message
- (string) the message to format and write to the
user socket
|