diff --git a/library.py b/library.py index 38daec0..a7c682c 100644 --- a/library.py +++ b/library.py @@ -30,6 +30,7 @@ class Library: def serve_forever(self): try: + print(f"Starting server at {self.__host}:{self.__port}") with self.__socket as s: s.bind((self.__host, self.__port)) s.listen(1) diff --git a/main.py b/main.py new file mode 100644 index 0000000..24ae844 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +import argparse + +def server(host: str='', port: int=7788): + from library import Library + lib = Library(host, port) + lib.serve_forever() + +def client(playername: str, host: str='localhost', port: int=7788): + pass + +def main(): + pass + +if __name__ == "__main__": + main() diff --git a/ui.py b/ui.py new file mode 100644 index 0000000..2db18cc --- /dev/null +++ b/ui.py @@ -0,0 +1,10 @@ + +from client import Player + +class UI: + + __player: Player + + def __init__(self, playername: str, host: str='localhost', port: int=7788): + self.__player = Player(playername) + self.__player.join_game()