Package HappyChat :: Module World :: Class _World
[show private | hide private]
[frames | no frames]

Class _World


World singleton, this tool know all avatars, all rooms and manage them
Method Summary
  __init__(self)
  __getitem__(self, room_id)
Get the room
  __setitem__(self, room_id, room)
  addPending(self, socket, addr)
Add a pending structure the this world the pending structure is the data of unborned avatar
  addRoom(self, room)
Add a room to the world
  born(self, avatar, room, connection)
Make born an avatar to this world
  delPending(self, socket)
  delRoom(self, room_id)
Delete room from this world by room identifier
  getAvatarByConnection(self, connection)
Get the avatar by the given connection
  getAvatarBySocket(self, socket)
list of Avatar getAvatars(self)
Return all avatars of this world
  getAvatarSockets(self)
Room getMainRoom(self)
Return the main room
  getPendingInfos(self, socket)
list of socket getPendingSockets(self)
Get the pending connection @return Sockets
  kill(self, socket)
Kill the avatar by its socket not in use since using twisted
  killByConnection(self, connection)
Kill an avatar by the connection instance
boolean nicknameExists(self, nickname)
return if nickname is in this world
  ping(self, socket)
Send a ping command the given socket

Class Variable Summary
NoneType instance = None                                                                  

Method Details

__getitem__(self, room_id)
(Indexing operator)

Get the room

addPending(self, socket, addr)

Add a pending structure the this world the pending structure is the data of unborned avatar

addRoom(self, room)

Add a room to the world
Parameters:
room - Room to add
           (type=Room)

born(self, avatar, room, connection)

Make born an avatar to this world
Parameters:
avatar - new Avatar
           (type=Avatar)
room - The default room of the avatar
           (type=Room)
connection - Connection that manage the avatar
           (type=HappyChatDefaultProtocol)

delRoom(self, room_id)

Delete room from this world by room identifier
Parameters:
room_id - Room identifier
           (type={string})

getAvatarByConnection(self, connection)

Get the avatar by the given connection
Parameters:
connection - Connection that manage the avatar
           (type=HappyChatDefaultProtocol)

getAvatars(self)

Return all avatars of this world
Returns:
Avatars
           (type=list of Avatar)

getMainRoom(self)

Returns:
The main room
           (type=Room)

getPendingSockets(self)

Get the pending connection @return Sockets
Returns:
list of socket

kill(self, socket)

Kill the avatar by its socket not in use since using twisted

killByConnection(self, connection)

Kill an avatar by the connection instance
Parameters:
connection - Connection that manage the avatar
           (type=HappyChatDefaultProtocol)

nicknameExists(self, nickname)

return if nickname is in this world
Parameters:
nickname - nickname to test
           (type=string)
Returns:
True is the nickname exists in the world
           (type=boolean)

ping(self, socket)

Send a ping command the given socket
Parameters:
socket - destination socket to write
           (type=socket)

Class Variable Details

instance

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Sun Sep 19 21:40:09 2004 http://epydoc.sf.net