| @@ 38-53 (lines=16) @@ | ||
| 35 | obj.name = u'Rebels' |
|
| 36 | obj.login = '*' |
|
| 37 | ||
| 38 | def register(self, tran, obj, galaxyID): |
|
| 39 | log.debug("Reregistering player", obj.oid) |
|
| 40 | counter = 1 |
|
| 41 | while 1: |
|
| 42 | obj.name = u'Rebel faction %d' % counter |
|
| 43 | obj.login = '*AIP*rebels%d' % counter |
|
| 44 | if galaxyID in tran.gameMngr.accountGalaxies(obj.login): |
|
| 45 | counter += 1 |
|
| 46 | continue |
|
| 47 | tran.gameMngr.registerPlayer(obj.login, obj, obj.oid) |
|
| 48 | log.debug("Player registered") |
|
| 49 | tran.db[Const.OID_UNIVERSE].players.append(obj.oid) |
|
| 50 | tran.gameMngr.clientMngr.createAIAccount(obj.login, obj.name, 'ais_rebel') |
|
| 51 | break |
|
| 52 | # grant techs and so on |
|
| 53 | self.cmd(obj).update(tran, obj) |
|
| 54 | ||
| 55 | @public(Const.AL_ADMIN) |
|
| 56 | def processINITPhase(self, tran, obj, data): |
|
| @@ 54-68 (lines=15) @@ | ||
| 51 | if tech.level == 1 and (tech.isShipEquip or tech.isShipHull) and not tech.unpackStruct: |
|
| 52 | obj.techs[techID] = Rules.techMaxImprovement |
|
| 53 | ||
| 54 | def register(self, tran, obj, galaxyID): |
|
| 55 | log.debug("Registering player", obj.oid) |
|
| 56 | counter = 1 |
|
| 57 | while 1: |
|
| 58 | obj.name = u'Pirate faction %d' % counter |
|
| 59 | obj.login = '*AIP*pirate%d' % counter |
|
| 60 | if galaxyID in tran.gameMngr.accountGalaxies(obj.login): |
|
| 61 | counter += 1 |
|
| 62 | continue |
|
| 63 | tran.gameMngr.registerPlayer(obj.login, obj, obj.oid) |
|
| 64 | tran.db[Const.OID_UNIVERSE].players.append(obj.oid) |
|
| 65 | tran.gameMngr.clientMngr.createAIAccount(obj.login, obj.name, 'ais_pirate') |
|
| 66 | break |
|
| 67 | # grant techs and so on |
|
| 68 | self.cmd(obj).update(tran, obj) |
|
| 69 | ||
| 70 | @staticmethod |
|
| 71 | def setStartingPlanet(tran, planet): |
|
| @@ 44-58 (lines=15) @@ | ||
| 41 | obj.race = "m" |
|
| 42 | obj.login = '*' |
|
| 43 | ||
| 44 | def register(self, tran, obj, galaxyID): |
|
| 45 | log.debug("Registering player", obj.oid) |
|
| 46 | counter = 1 |
|
| 47 | while 1: |
|
| 48 | obj.name = u'Mutant faction %d' % counter |
|
| 49 | obj.login = '*AIP*mutant%d' % counter |
|
| 50 | if galaxyID in tran.gameMngr.accountGalaxies(obj.login): |
|
| 51 | counter += 1 |
|
| 52 | continue |
|
| 53 | tran.gameMngr.registerPlayer(obj.login, obj, obj.oid) |
|
| 54 | tran.db[Const.OID_UNIVERSE].players.append(obj.oid) |
|
| 55 | tran.gameMngr.clientMngr.createAIAccount(obj.login, obj.name, 'ais_mutant') |
|
| 56 | break |
|
| 57 | # grant techs and so on |
|
| 58 | self.cmd(obj).update(tran, obj) |
|
| 59 | ||
| 60 | @staticmethod |
|
| 61 | def setStartingPlanet(tran, planet): |
|
| @@ 44-58 (lines=15) @@ | ||
| 41 | obj.race = "r" |
|
| 42 | obj.login = '*' |
|
| 43 | ||
| 44 | def register(self, tran, obj, galaxyID): |
|
| 45 | log.debug("Registering player", obj.oid) |
|
| 46 | counter = 1 |
|
| 47 | while 1: |
|
| 48 | obj.name = u'Renegade faction %d' % counter |
|
| 49 | obj.login = '*AIP*renegade%d' % counter |
|
| 50 | if galaxyID in tran.gameMngr.accountGalaxies(obj.login): |
|
| 51 | counter += 1 |
|
| 52 | continue |
|
| 53 | tran.gameMngr.registerPlayer(obj.login, obj, obj.oid) |
|
| 54 | tran.db[Const.OID_UNIVERSE].players.append(obj.oid) |
|
| 55 | tran.gameMngr.clientMngr.createAIAccount(obj.login, obj.name, 'ais_renegade') |
|
| 56 | break |
|
| 57 | # grant techs and so on |
|
| 58 | self.cmd(obj).update(tran, obj) |
|
| 59 | ||
| 60 | @public(Const.AL_ADMIN) |
|
| 61 | def processINITPhase(self, tran, obj, data): |
|
| @@ 43-57 (lines=15) @@ | ||
| 40 | obj.race = "e" |
|
| 41 | obj.login = '*' |
|
| 42 | ||
| 43 | def register(self, tran, obj, galaxyID): |
|
| 44 | log.debug("Registering player", obj.oid) |
|
| 45 | counter = 1 |
|
| 46 | while 1: |
|
| 47 | obj.name = u'E.D.E.N. %d' % counter |
|
| 48 | obj.login = '*AIP*eden%d' % counter |
|
| 49 | if galaxyID in tran.gameMngr.accountGalaxies(obj.login): |
|
| 50 | counter += 1 |
|
| 51 | continue |
|
| 52 | tran.gameMngr.registerPlayer(obj.login, obj, obj.oid) |
|
| 53 | tran.db[Const.OID_UNIVERSE].players.append(obj.oid) |
|
| 54 | tran.gameMngr.clientMngr.createAIAccount(obj.login, obj.name, 'ais_eden') |
|
| 55 | break |
|
| 56 | # grant techs and so on |
|
| 57 | self.cmd(obj).update(tran, obj) |
|
| 58 | ||
| 59 | def update(self, tran, obj): |
|
| 60 | self.setStartingTechnologies(obj) |
|