コード例 #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)
コード例 #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)
コード例 #3
0
 def _broadcast(self, filename, status):
     """Broadcasts the status of a file."""
     # HACK: inverted import flow
     from libraries.rggViews import allusers
     _broadcastStatus(allusers(), filename, status)
コード例 #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)
コード例 #5
0
def sendSay(user, message):
	respondSay(allusers(), user.username, message)
コード例 #6
0
def sendDice(user, message):
	respondDice(allusers(), user.username, message)
コード例 #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)