Exemplo n.º 1
0
def compilemotd():
	conf = ConfigParser()
	if not conf.read('Motd/plugin.conf'):
		print 'Could not read MOTD config.'
	if not conf.has_option('MOTD', 'template'):
		motdstring = 'Welcome to a XSBS server.'
	else:
		options = conf.options('MOTD')
		formatdict = {}
		for option in options:
			if option != 'template':
				formatdict[option] = conf.get('MOTD', option)
		motdstring = string.Template(sbtools.orange(conf.get('MOTD', 'template')))
		motdstring = motdstring.substitute(formatdict)
		return motdstring
Exemplo n.º 2
0
def announce(cn):
	sbserver.message(sbtools.orange(sbserver.playerName(cn) + " is connected from " + str(getCountry(sbserver.playerIpLong(cn)))))