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)
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)
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)
def sendSay(user, message): respondSay(allusers(), user.username, message)
def sendDice(user, message): respondDice(allusers(), user.username, message)
def sendICEmote(user, message, chname, portrait): if len(portrait) > 1: srm.processFile(user, makePortableFilename(path.join(PORTRAIT_DIR, portrait))) respondICEmote(allusers(), chname, message, portrait)