Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(38)  |  Call(38)  |  Derive(0)  |  Import(0)

src/x/s/xsbs-HEAD/src/pyscripts/ServerCtlCommands/ctl.py   xsbs(Download)
		raise UsageError()
		return
	sbserver.playerMessage(cn, info('You have given master to %s') % sbserver.playerName(tcn))
	sbserver.setMaster(tcn)
 
		raise UsageError()
	else:
		msg = servermsg_template.substitute(colordict, sender=sbserver.playerName(cn), message=args)
		sbserver.message(msg)
 
		try:
			if isUser(player(tcn).user.id):
				sbserver.playerMessage(cn, error('%s already has user permissions.' % sbserver.playerName(tcn)))
				return
		except (ValueError, AttributeError):
				user = loggedInAs(tcn)
			except AttributeError:
				sbserver.playerMessage(cn, error('%s is not logged in.' % sbserver.playerName(tcn)))
			else:
				dbmanager.query(UserPrivilege).filter(UserPrivilege.user_id==user_id).update({ 'privilege': None })
				session.add(UserPrivilege(0, user.id))
				session.commit()
				sbserver.playerMessage(cn, info('User privilege has been given to %s (%s)' % (sbserver.playerName(tcn), user.email)))

src/x/s/xsbs-HEAD/src/pyscripts/xsbs/users/privilege.py   xsbs(Download)
def onAuthSuccess(cn, name):
	sbserver.message(info(authtemp.substitute(colordict, name=sbserver.playerName(cn), authname=name)))
 
def onSetMasterOff(cn):
	sbserver.resetPrivilege(cn)
 
def onGainMaster(cn):
	sbserver.message(info(gmtemp.substitute(colordict, name=sbserver.playerName(cn))))
def onGainAdmin(cn):
	sbserver.message(info(gatemp.substitute(colordict, name=sbserver.playerName(cn))))
 
def onRelMaster(cn):
	sbserver.message(info(rmtemp.substitute(colordict, name=sbserver.playerName(cn))))
 
def onRelAdmin(cn):
	sbserver.message(info(ratemp.substitute(colordict, name=sbserver.playerName(cn))))

src/x/s/xsbs-HEAD/src/pyscripts/xsbs/players/__init__.py   xsbs(Download)
	def name(self):
		'''Name of client'''
		return sbserver.playerName(self.cn)
	def ipLong(self):
		'''Ip of client as long'''

src/x/s/xsbs-HEAD/src/pyscripts/xsbs/users/__init__.py   xsbs(Download)
	player(cn).logged_in = True
	triggerServerEvent('player_logged_in', (cn,))
	sbserver.message(info(green(sbserver.playerName(cn)) + ' is verified'))
 
def userAuth(email, password):
	if not isLoggedIn(cn):
		raise StateError('You must be logged in to link a name to your account')
	if sbserver.playerName(cn) in blocked_names:
		raise StateError('You can not reserve this name')
	try:
		dbmanager.query(NickAccount).filter(NickAccount.nick==sbserver.playerName(cn)).one()
	except NoResultFound:
		user = loggedInAs(cn)
		nickacct = NickAccount(sbserver.playerName(cn), user.id)
	try:
		nickacct = p.warn_nickacct
		if nickacct.nick != sbserver.playerName(cn) or sessid != sbserver.playerSessionId(cn):
			p.warning_for_login = False
			return
def onPlayerActive(cn):
	nick = sbserver.playerName(cn)
	p = player(cn)
	try:
		nickacct = nickReserver(sbserver.playerName(cn))

src/x/s/xsbs-HEAD/src/pyscripts/IrcBot/ircbot.py   xsbs(Download)
 
event_abilities = {
	'player_active': ('player_connect', lambda x: factory.broadcast('%s (\x037 %i \x03) \x032Connected\x03' % (sbserver.playerName(x), x))),
	'player_disconnect': ('player_disconnect', lambda x: factory.broadcast('%s (\x037 %i \x03) \x032Disconnected\x03' % (sbserver.playerName(x), x))),
	'message': ('player_message', lambda x, y: factory.broadcast('%s (\x037 %i \x03): %s' % (sbserver.playerName(x), x, y))),
	'map_change': ('map_changed', lambda x, y: factory.broadcast('\x038Map changed to:\x03 %s (%s)' % (x, sbserver.modeName(y)))),
	'gain_admin': ('player_claimed_admin', lambda x: factory.broadcast('%s (\x037 %i \x03) \x036Has claimed admin\x03' % (sbserver.playerName(x), x))),
	'gain_master': ('player_claimed_master', lambda x: factory.broadcast('%s (\x037 %i \x03) \x036Has claimed master\x03' % (sbserver.playerName(x), x))),

src/x/s/xsbs-HEAD/src/pyscripts/xsbs/demo.py   xsbs(Download)
			act = 'disabled'
		sbserver.setRecordNextMatch(val)
		sbserver.message(notice(action_temp.substitute(colordict, action=act, user=sbserver.playerName(cn))))
	else:
		insufficientPermissions(cn)

src/x/s/xsbs-HEAD/src/pyscripts/MMControl/mmctl.py   xsbs(Download)
def setMM(cn, mm):
	sbserver.message((info(green('%s') + ' set master mode to ' + blue('%s')) % (sbserver.playerName(cn), MMNAMES[mm])))
	sbserver.setMasterMode(mm)
 
def onNoClients():

src/x/s/xsbs-HEAD/src/pyscripts/xsbs/ban.py   xsbs(Download)
def ban(cn, seconds, reason, banner_cn):
	ip = sbserver.playerIpLong(cn)
	expiration = time.time() + seconds
	nick = sbserver.playerName(cn)
	if banner_cn != -1:
		banner_ip = sbserver.playerIpLong(banner_cn)
		banner_nick = sbserver.playerName(banner_cn)

src/x/s/xsbs-HEAD/src/pyscripts/VoteKick/votekick.py   xsbs(Download)
			allow_vote = True
		if allow_vote:
			sbserver.message(info(vktemp.substitute(colordict, voter=sbserver.playerName(cn), victim=sbserver.playerName(tcn))))
			player(cn).votekick = int(args)
			checkVotes(int(args))

src/x/s/xsbs-HEAD/src/pyscripts/NamesDb/namesdb.py   xsbs(Download)
	except NoResultFound:
		pass
	ent = IpToNick(sbserver.playerIpLong(cn), sbserver.playerName(cn))
	session.add(ent)
	session.commit()