def createPlayer(): for i in range(playerNum): aplayer = people.creatPlayer(i) sockets.append(aplayer.sock) players.append(aplayer) print('-------------------create player %d succeed-------------------' % i) print('-------------------------create %d player in players[]-------------------------' % len(players))
def createPlayer(group): for i in range(aGroup): try: aplayer = people.creatPlayer(i + (group - 1) * aGroup) sockets[i + (group - 1) * aGroup] = aplayer.sock players[i + (group - 1) * aGroup] = aplayer print('··················create player %d succeed··················' % (i + (group - 1) * aGroup)) except Exception as e: print('#####################################################################################', e)