示例#1
0
文件: ctl.py 项目: pguenth/xsbs
def unsetMaster(cn, args):
	'''@description Force release master from current master
	   @usage
	   @master'''
	if args != '':
		raise ExtraArgumentError()
	else:
		sbserver.setMaster(-1)
示例#2
0
文件: ctl.py 项目: GunioRobot/xsbs
def unsetMaster(cn, args):
	'''@description Force release master from current master
	   @usage
	   @master'''
	if args != '':
		raise ExtraArgumentError()
	else:
		sbserver.setMaster(-1)
示例#3
0
文件: ctl.py 项目: GunioRobot/xsbs
def masterCmd(cn, args):
	'''@description Claim master
	   @usage
	   @master'''
	if args != '':
		raise ExtraArgumentError()
	if currentAdmin() != None:
		raise StateError('Admin is present')
	if sbserver.playerPrivilege(cn) == 0:
		sbserver.setMaster(cn)
示例#4
0
文件: ctl.py 项目: pguenth/xsbs
def masterCmd(cn, args):
	'''@description Claim master
	   @usage
	   @master'''
	if args != '':
		raise ExtraArgumentError()
	if currentAdmin() != None:
		raise StateError('Admin is present')
	if sbserver.playerPrivilege(cn) == 0:
		sbserver.setMaster(cn)
示例#5
0
文件: ctl.py 项目: GunioRobot/xsbs
def onGiveMaster(cn, args):
	'''@description Give master to a client
	   @usage cn
	   @master'''
	if args == '':
		raise UsageError()
		return
	try:
		tcn = int(args)
	except TypeError:
		raise UsageError()
		return
	sbserver.playerMessage(cn, info('You have given master to %s') % sbserver.playerName(tcn))
	sbserver.setMaster(tcn)
示例#6
0
文件: ctl.py 项目: pguenth/xsbs
def onGiveMaster(cn, args):
	'''@description Give master to a client
	   @usage cn
	   @master'''
	if args == '':
		raise UsageError()
		return
	try:
		tcn = int(args)
	except TypeError:
		raise UsageError()
		return
	sbserver.playerMessage(cn, info('You have given master to %s') % sbserver.playerName(tcn))
	sbserver.setMaster(tcn)
示例#7
0
def setMaster(caller):
        """This command makes the caller the master of the server. This is denoted by the green color of the callers name. Also like with #admin it does not give the caller any powers beyond what the caller had before."""
	if(caller[0]=="ingame"):
		return sbserver.setMaster(caller[1])
	raise ServerError("You are not ingame.")
	return
示例#8
0
def onAuthSuccess(cn, name):
	if currentAdmin() != None:
		sbserver.playerMessage(cn, error('Admin is present'))
		return
	sbserver.setMaster(cn)
示例#9
0
def setMaster(caller):
	"""Makes the caller the master of the server."""
	if(caller[0]=="ingame"):
		return sbserver.setMaster(caller[1])
	raise ServerError("You are not ingame.")
	return
示例#10
0
文件: __init__.py 项目: pguenth/xsbs
def onAuthSuccess(cn, name):
    if currentAdmin() != None:
        sbserver.playerMessage(cn, error('Admin is present'))
        return
    sbserver.setMaster(cn)