Пример #1
0
        serializeObject(GM, "Game.pickle")
        print("Created and Serialized Game Manager")
    else:
        print("Loaded Pickled Game File")
        pickledFile = open(pickledGame, "rb")
        GM = pickle.load(pickledFile)
        GM.purgePlayers()
        GM.clearSessions()

    pickledAccounts = Path(os.getcwd() + "/Accounts.pickle")
    Accounts = None
    if (pickledAccounts.exists() != True):
        Accounts = AccountManager()

        Accounts.registerAccount("wesley", "play", IsAdmin=True)

        serializeObject(Accounts, "Accounts.pickle")
        print("Created and Serialized Account Manager")
    else:
        print("Loaded Pickled Accounts File")
        pickledFile = open(pickledAccounts, "rb")
        Accounts = pickle.load(pickledFile)

    GM.AccountManager = Accounts

    pickleThread = threading.Thread(target=save, args=[GM, Accounts])
    pickleThread.start()

    CDClientDB: GameDB = GameDB(
        sqlite3.connect("resources/cdclient.sqlite", check_same_thread=False))