def onClientInit(self, eventObj, evtMgr): source = eventObj.source print "SPAWNNN: "+str(self.spawnRequest) if self.hasSpawnRequest(source): server = self.getSpawnRequest(source) if server=="irc.worldnet.net" and getComputername(source)=='oil-ocean': self.sendTo(source, ConnectEventAction(nickname="scrutator", server="irc.worldnet.net", port=6667)) else: self.sendTo(source, ConnectEventAction(nickname=getNickName(), server=server, port=6667)) agent = Agent() agent.name = source agent.server = server self.onRegisterAgent(agent) else: print "DIE !!!" self.sendTo(source, DieEvent())
def onLooseAgent(self,agentName): a = Agent() a.name = agentName self.resManager.onUnregisterAgent(a)