Module bzServer :: Class bzServer
[frames] | no frames]

Class bzServer

source code


A Bzoo server.

Instance Methods
bzServer
__init__(self, hostname='127.0.0.1', port=50000, nb_max_client=5)
Returns: N/A
source code
 
__repr__(self) source code
 
__rebuildVisibleClients__(self) source code
 
CloseConnection(self)
Close connection with all client.
source code
 
SaveUser(self, client_id)
Saves user information into server memory for retrieval at next connection.
source code
String.
registerPseudo(self, pseudo)
Create an entry into server's tables for a new user.
source code
 
removeClient(self, idClient)
Remove a player from server's tables.
source code
 
fct(self, idClient, part) source code
 
handleConnection(self)
Check for login and new connection.
source code
 
PositionReportEvent(self, values)
Handles reception of a Position Report Message
source code
 
SayMessageEvent(self, values)
Handles reception of a Say Message
source code
 
PrivateSayMessageEvent(self, values)
Handles reception of a Private Say Message
source code
 
GrabObjectEvent(self, values)
Handles reception of a Grab Object Message
source code
 
DeclareVarEvent(self, values)
Handles reception of a Declare Var Message
source code
 
ActivateObjectEvent(self, values)
Handles reception of an Activate Object Message
source code
 
ReleaseObjectEvent(self, values)
Handles reception of a Realease Object Message
source code
 
StoreAvatarEvent(self, values)
Handles reception of a Store Avatar Message
source code
 
Pulse(self)
Performs an exchange with each client.
source code

Inherited from bzProtocol.bzProtocol: addHandler, getNextDataMessage, processDataMessage

Inherited from bzPicture.bzPicture: getNbPlayers, getPlayerAction, getPlayerId, getPlayerOrientation, getPlayerPosition, getPlayerPseudo, getPlayerScene, getPlayersActions, getPlayersOrientations, getPlayersPositions, getPlayersPseudo, getPlayersScenes, popTextMessage, updateFromMessageList

Instance Variables
list of integer. actions
.
list of integer. avatars
.
list of bzServerConnection. connections
.
list of 3*3 matrix. headings
.
list of bzInventory.bzInventory. inventories
.
list of boolean. logged
.
socket. message_queue
.
integer. nb_client
The current number of connected client.
integer. nb_max_client
The maximum number of accepted client.
list of 3*3 matrix. orientations
.
list of 1*3 vector. positions
.
list of string. pseudos
.
list of integer. states
.
socket. visible_client
.

Inherited from bzProtocol.bzProtocol: HandlerTable, MessageTable

Inherited from bzServerSocket: hostname, port, sa, socket

Method Details

__init__(self, hostname='127.0.0.1', port=50000, nb_max_client=5)
(Constructor)

source code 
Parameters:
  • hostname (Character string.) - The server hostname or IP adress ("" for internet hosting, "127.0.0.1" for local hosting)
  • port (Integer) - The port the server will listen and accept connection on.
  • nb_max_client (Integer.) - The max number of player.
Returns: bzServer
N/A
Overrides: bzProtocol.bzProtocol.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: bzProtocol.bzProtocol.__repr__

SaveUser(self, client_id)

source code 
Saves user information into server memory for retrieval at next connection.
Parameters:
  • client_id (Character string.) - the current user id

registerPseudo(self, pseudo)

source code 
Create an entry into server's tables for a new user. If the given pseudo is already in use on current Server, a new one is computed. The given pseudo is used as a radical to which is added an index .Ex:
   Nick will become Nick.001 is Nick is already used.
Parameters:
  • pseudo (String.) - The asked pseudo of the new user.
Returns: String.
The effective pseudo of the player.

removeClient(self, idClient)

source code 
Remove a player from server's tables.
Parameters:
  • idClient (Integer.) - The id in Server tables of the player to remove.

PositionReportEvent(self, values)

source code 
Handles reception of a Position Report Message
Parameters:
  • values ([3*1 vector, 3*3 matrix, 3*3matrix, integer, integer, integer].) - [position, orientation, heading, state, action, scene]

SayMessageEvent(self, values)

source code 
Handles reception of a Say Message
Parameters:
  • values ([string].) - [message]

PrivateSayMessageEvent(self, values)

source code 
Handles reception of a Private Say Message
Parameters:
  • values ([string, string].) - [topseudo, message]

GrabObjectEvent(self, values)

source code 
Handles reception of a Grab Object Message
Parameters:
  • values ([integer, string].) - [quantity, objname]

DeclareVarEvent(self, values)

source code 
Handles reception of a Declare Var Message
Parameters:
  • values ([integer, string].) - [quantity, varname]

ActivateObjectEvent(self, values)

source code 
Handles reception of an Activate Object Message
Parameters:
  • values ([string, integer].) - [objname, activation type]

ReleaseObjectEvent(self, values)

source code 
Handles reception of a Realease Object Message
Parameters:
  • values ([string, 3*1 vector].) - [objname, position]

StoreAvatarEvent(self, values)

source code 
Handles reception of a Store Avatar Message
Parameters:
  • values ([integer].) - [id_avatar]