Exemplo n.º 1
0
				line = line[1:]
				line = line.split('=')
				line = map(bstrip, line)
				if len(line) == 2:
					credvars[line[0]] = line[1]
			elif line[0] == '#':
				pass
			else:
				for varname in credvars.keys():
					line = line.replace('$' + varname, credvars[varname])
				line = line.split("\t\t")
				if len(line) > 2:
					if line[2][-1:] == "\n":
						line[2] = line[2][:-1]
					line = map(bstrip, line)
					self.credentials[line[0]] = [line[1], line[2]]
		f.close()
			
	def on_local_connect_post(self, eventname, cn, serverip, serverport):
		if serverip in self.credentials.keys():
			if self.credentials[serverip][1] == "setmaster":
				setmaster(self.credentials[serverip][0])
			elif self.credentials[serverip][1] == "#login":
				say("#login " + self.credentials[serverip][0])
	
am = autologin_manager("~/.sauerbraten/credentials.conf")

registerClientEventHandler("local_connect_post", am.on_local_connect_post)

print "\tAuto login plugin now active!"
Exemplo n.º 2
0
			if cn == self.watchcn:
				for phrase in sorryphrases:
					phrase = phrase.lower()
					message = message.lower()
					if message.find(phrase) >= 0:
						if event == "chat":
							autosay("No problem " + clientname(self.watchcn) + ". Thanks for apologizing.")
						elif event == "teamchat":
							autosayteam("No problem " + clientname(self.watchcn) + ". Thanks for apologizing.")
						aRM.timeout(cn)
						break

def teamkill_callback(event, killercn, killedcn):
	if cn() == killercn:
		killed = clientname(killedcn)
		autosay("Sorry " + killed + "!")
	elif cn() == killedcn:
		aRM.register(killercn)

def on_intermission(args):
	autosay("Good Game.")

registerClientEventHandler("teamkill", teamkill_callback)

registerClientEventHandler("chat", aRM.on_message)
registerClientEventHandler("teamchat", aRM.on_message)

registerClientEventHandler("Intermission", on_intermission)

print "\tAuto messages plugin now active!"
Exemplo n.º 3
0
                line = line.split("=")
                line = map(bstrip, line)
                if len(line) == 2:
                    credvars[line[0]] = line[1]
            elif line[0] == "#":
                pass
            else:
                for varname in credvars.keys():
                    line = line.replace("$" + varname, credvars[varname])
                line = line.split("\t\t")
                if len(line) > 2:
                    if line[2][-1:] == "\n":
                        line[2] = line[2][:-1]
                    line = map(bstrip, line)
                    self.credentials[line[0]] = [line[1], line[2]]
        f.close()

    def on_local_connect_post(self, eventname, cn, serverip, serverport):
        if serverip in self.credentials.keys():
            if self.credentials[serverip][1] == "setmaster":
                setmaster(self.credentials[serverip][0])
            elif self.credentials[serverip][1] == "#login":
                say("#login " + self.credentials[serverip][0])


am = autologin_manager("~/.sauerbraten/credentials.conf")

registerClientEventHandler("local_connect_post", am.on_local_connect_post)

print "\tAuto login plugin now active!"
Exemplo n.º 4
0
                            autosay("No problem " + clientname(self.watchcn) +
                                    ". Thanks for apologizing.")
                        elif event == "teamchat":
                            autosayteam("No problem " +
                                        clientname(self.watchcn) +
                                        ". Thanks for apologizing.")
                        aRM.timeout(cn)
                        break


def teamkill_callback(event, killercn, killedcn):
    if cn() == killercn:
        killed = clientname(killedcn)
        autosay("Sorry " + killed + "!")
    elif cn() == killedcn:
        aRM.register(killercn)


def on_intermission(args):
    autosay("Good Game.")


registerClientEventHandler("teamkill", teamkill_callback)

registerClientEventHandler("chat", aRM.on_message)
registerClientEventHandler("teamchat", aRM.on_message)

registerClientEventHandler("Intermission", on_intermission)

print "\tAuto messages plugin now active!"