Exemple #1
0
def serverKick(server, username):
	"""Occurs when a client is kicked.

	username -- a username for the client

	"""
	user = removeuser(username)
	respondError(allusers(),
		fake.translate('remote', '{username} was kicked by the host.'),
			username=user.username)
	respondUserRemove(allusers(), username)
Exemple #2
0
def serverDisconnect(server, username, errorMessage):
	"""Occurs when a client disconnects without being kicked.

	username -- a username for the client
	errorMessage -- a human-readable error message for why the connection failed

	"""
	user = removeuser(username)
	respondError(allusers(),
		fake.translate('remote', '{username} has left the game. {error}'),
			username=user.username, error=errorMessage)
	respondUserRemove(allusers(), username)
 def _broadcast(self, filename, status):
     """Broadcasts the status of a file."""
     # HACK: inverted import flow
     from libraries.rggViews import allusers
     _broadcastStatus(allusers(), filename, status)
Exemple #4
0
def sendICSay(user, message, chname, portrait):
	crm.listen(portrait, RESOURCE_IMAGE, crm, doNothing)
	if len(portrait) > 1:
		srm.processFile(user, makePortableFilename(path.join(PORTRAIT_DIR, portrait)))
	respondICSay(allusers(), chname, message, portrait)
Exemple #5
0
def sendSay(user, message):
	respondSay(allusers(), user.username, message)
Exemple #6
0
def sendDice(user, message):
	respondDice(allusers(), user.username, message)
Exemple #7
0
def sendICEmote(user, message, chname, portrait):
	if len(portrait) > 1:
		srm.processFile(user, makePortableFilename(path.join(PORTRAIT_DIR, portrait)))
	respondICEmote(allusers(), chname, message, portrait)