Exemple #1
0
    public override void OnStartServer()
    {
        base.OnStartServer();

        if (debug)
        {
            Debug.Log("Store Manager: Loading information for store number: " + storeNumber);
        }
        StoreInventory storeInventory = SojournDBM.odbm.GetStoreInventory(storeNumber);

        if (storeInventory == null)
        {
            throw new System.Exception("There is no database entry for a store with this number: " + storeNumber);
        }

        /* Keep an original version of the store inventory */
        originalStoreInventory.Apply(storeInventory);
        /* This is the inventory that we will actually use */
        currentStoreInventory.Apply(new StoreInventory(originalStoreInventory));

        /* Reset the store reset timer */
        storeResetTimer = STORE_RESET_TIME;

        PopulateShopSlots();
    }