def net_newplayer(pl): """Create a new player from info over the net""" print "creating network player" if riskengine.players.has_key(pl): return p = riskengine.makeplayer(pl) makeplayercolors(p) plist.append(p)
def newplayer(): """Create a new player""" if riskengine.phase != "Pregame": return if len(riskengine.players) > 7: set_status("You can have at most 7 players.") pdialog = PlayerDialog(root, "Choose the player's name") if hasattr(pdialog,"PlayerName"): p = riskengine.makeplayer(pdialog.PlayerName, pdialog.ai_filename) makeplayercolors(p) plist.append(p) gameMenu.entryconfigure(3, state=Tkinter.DISABLED) gameMenu.entryconfigure(4, state=Tkinter.DISABLED)