import argparse import asyncio import textwrap def main(args: argparse.Namespace) -> int: from sampy.network.protocol import Protocol from sampy.server import InteractiveServer server = InteractiveServer(Protocol) server.start() asyncio.get_event_loop().run_forever() return 0 if __name__ == "__main__": class Formatter( argparse.ArgumentDefaultsHelpFormatter, argparse.RawTextHelpFormatter ): pass parser = argparse.ArgumentParser( prog="sampy", description="A SAMP server made in python", epilog=textwrap.dedent( """ SAMP (or SA-MP) is a free multiplayer mod for the PC port of GTA: San Andreas. GTA: San Andreas was developed by Rockstar North and released in 2005. SA-MP is an unofficial multiplayer mod made by the `SA-MP.com` team released @[sa-mp.com](https://www.sa-mp.com/) """ ), formatter_class=Formatter, ) parser.add_argument("--host", type=str, default="0.0.0.0", help="Server host ip") parser.add_argument("-p", "--port", type=int, default=7777, help="Server port") parser.add_argument( "-v", "--version", type=str, default="latest", help="Game version", choices=["latest"], ) args = parser.parse_args() raise SystemExit(main(args))