Home | Trees | Index | Help |
---|
Package HappyChat :: Module HappyChatProtocol :: Class HappyChatDefaultProtocol |
|
BaseProtocol
--+ |Protocol
--+ | HappyChatDefaultProtocol
Default protocol for HappyChat Server. only 6 commands : pong : request a session on the server speak : say somethink is the curent room nickname : change nickname (not in use) roominfo : ask room information (list avatar) avatarinfo: ask information about an avatar (list properties) quit: disconnect the client properly Each command is binded to a method of this class prefixed by 'do_' par exemple : speak command is bind to do_speak method
Method Summary | |
---|---|
Call when a connection is close delete avatar and clean structures | |
Call when a new connection is made add a pending information to the world | |
Call on each query get the command to execute in the raw XML structure the executed action can me a method of this class or a function in a module in the actions package | |
handle a avatar information from avatar over TCP socket. | |
handle a nickname change ask by avatar over TCP socket | |
handle a pong request this is the first request ask by avatar client send a session_id. | |
handle a quit request, disconnect the avatar, close the socket and remove avatar from memory | |
handle a room information request from avatar over TCP socket | |
handle a speak request from avatar over TCP socket | |
Avatar
|
Get the default avatar by given socket |
tuple of (method ,
Element ).
|
Get the command of the raw XML structure |
socket
|
Return the socket of the curent connection |
Inherited from Protocol | |
(Deprecated) |
Class Variable Summary | |
---|---|
Inherited from Protocol | |
tuple |
__implements__ = (<class 'twisted.internet.interfaces.IP...
|
Method Details |
---|
connectionLost(self, reason)Call when a connection is close delete avatar and clean structures |
connectionMade(self)Call when a new connection is made add a pending information to the world |
dataReceived(self, data)Call on each query get the command to execute in the raw XML structure the executed action can me a method of this class or a function in a module in the actions package
|
do_avatarinfo(self, socket, element)handle a avatar information from avatar over TCP socket.
|
do_nickname(self, socket, element)handle a nickname change ask by avatar over TCP socket
|
do_pong(self, socket, element)handle a pong request this is the first request ask by avatar client send a session_id.
|
do_quit(self, socket, element)handle a quit request, disconnect the avatar, close the socket and remove avatar from memory
|
do_roominfo(self, socket, element)handle a room information request from avatar over TCP socket
|
do_speak(self, socket, element)handle a speak request from avatar over TCP socket
|
getAvatar(self, socket)Get the default avatar by given socket
|
getCommand(self, data)Get the command of the raw XML structure @return the command to do.
|
getSocket(self)Return the socket of the curent connection
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Sep 19 21:40:09 2004 | http://epydoc.sf.net |