def main(world_cls, referee_cls, gui_cls, gui_actor_cls, ai_actor_cls,<EOL>theater_cls=PygletTheater, default_host=DEFAULT_HOST,<EOL>default_port=DEFAULT_PORT, argv=None):
import sys, os, docopt, nonstdlib<EOL>exe_name = os.path.basename(sys.argv[<NUM_LIT:0>])<EOL>usage = main.__doc__.format(**locals()).strip()<EOL>args = docopt.docopt(usage, argv or sys.argv[<NUM_LIT:1>:])<EOL>num_guis = int(args['<STR_LIT>'] or <NUM_LIT:1>)<EOL>num_ais = int(args['<STR_LIT>'] or <NUM_LIT:0>)<EOL>host, port = args['<STR_LIT>'], int(args['<STR_LIT>'])<EOL>logging.basicConfig(<EOL>format='<STR_LIT>',<EOL>level=nonstdlib.verbosity(args['<STR_LIT>']),<EOL>)<EOL>if args['<STR_LIT>']:<EOL><INDENT>print("""<STR_LIT>""")<EOL>game = MultiplayerDebugger(<EOL>world_cls, referee_cls, gui_cls, gui_actor_cls, num_guis,<EOL>ai_actor_cls, num_ais, theater_cls, host, port)<EOL><DEDENT>else:<EOL><INDENT>game = theater_cls()<EOL>ai_actors = [ai_actor_cls() for i in range(num_ais)]<EOL>if args['<STR_LIT>']:<EOL><INDENT>game.gui = gui_cls()<EOL>game.initial_stage = UniplayerGameStage(<EOL>world_cls(), referee_cls(), gui_actor_cls(), ai_actors)<EOL>game.initial_stage.successor = PostgameSplashStage()<EOL><DEDENT>if args['<STR_LIT>']:<EOL><INDENT>game.gui = gui_cls()<EOL>game.initial_stage = ClientConnectionStage(<EOL>world_cls(), gui_actor_cls(), host, port)<EOL><DEDENT>if args['<STR_LIT>']:<EOL><INDENT>game.initial_stage = ServerConnectionStage(<EOL>world_cls(), referee_cls(), num_guis, ai_actors,<EOL>host, port)<EOL><DEDENT><DEDENT>game.play()<EOL>
Run a game being developed with the kxg game engine.

Usage:
    {exe_name} sandbox [<num_ais>] [-v...]
    {exe_name} client [--host HOST] [--port PORT] [-v...]
    {exe_name} server <num_guis> [<num_ais>] [--host HOST] [--port PORT] [-v...] 
    {exe_name} debug <num_guis> [<num_ais>] [--host HOST] [--port PORT] [-v...]
    {exe_name} --help

Commands:
    sandbox
        Play a single-player game with the specified number of AIs.  None of 
        the multiplayer machinery will be used.

    client
        Launch a client that will try to connect to a server on the given host 
        and port.  Once it connects and the game starts, the client will allow 
        you to play the game against any other connected clients.

    server
        Launch a server that will manage a game between the given number of 
        human and AI players.  The human players must connect using this 
        command's client mode.

    debug
        Debug a multiplayer game locally.  This command launches a server and 
        the given number of clients all in different processes, and configures 
        the logging system such that the output from each process can be easily 
        distinguished.

Arguments:
    <num_guis>
        The number of human players that will be playing the game.  Only needed 
        by commands that will launch some sort of multiplayer server.

    <num_ais>
        The number of AI players that will be playing the game.  Only needed by 
        commands that will launch single-player games or multiplayer servers.

Options:
    -x --host HOST          [default: {default_host}]
        The address of the machine running the server.  Must be accessible from 
        the machines running the clients.

    -p --port PORT          [default: {default_port}]
        The port that the server should listen on.  Don't specify a value less 
        than 1024 unless the server is running with root permissions.

    -v --verbose 
        Have the game engine log more information about what it's doing.  You 
        can specify this option several times to get more and more information.

This command is provided so that you can start writing your game with the least 
possible amount of boilerplate code.  However, the clients and servers provided 
by this command are not capable of running a production game.  Once you have 
written your game and want to give it a polished set of menus and options, 
you'll have to write new Stage subclasses encapsulating that logic and you'll 
have to call those stages yourself by interacting more directly with the 
Theater class.  The online documentation has more information on this process.