public IEconomyRequestHandle exchangeItems(IEconomyItemInstance[] inputItemInstanceIDs, uint[] inputItemQuantities, IEconomyItemDefinition[] outputItemDefinitionIDs, uint[] outputItemQuantities, EconomyRequestReadyCallback inventoryRequestReadyCallback)
        {
            if (inputItemInstanceIDs.Length != inputItemQuantities.Length)
            {
                throw new ArgumentException("Input item arrays need to be the same length.", "inputItemQuantities");
            }
            if (outputItemDefinitionIDs.Length != outputItemQuantities.Length)
            {
                throw new ArgumentException("Output item arrays need to be the same length.", "outputItemQuantities");
            }
            SteamItemInstanceID_t[] array = new SteamItemInstanceID_t[inputItemInstanceIDs.Length];
            for (int i = 0; i < inputItemInstanceIDs.Length; i++)
            {
                SteamworksEconomyItemInstance steamworksEconomyItemInstance = (SteamworksEconomyItemInstance)inputItemInstanceIDs[i];
                array[i] = steamworksEconomyItemInstance.steamItemInstanceID;
            }
            SteamItemDef_t[] array2 = new SteamItemDef_t[outputItemDefinitionIDs.Length];
            for (int j = 0; j < outputItemDefinitionIDs.Length; j++)
            {
                SteamworksEconomyItemDefinition steamworksEconomyItemDefinition = (SteamworksEconomyItemDefinition)outputItemDefinitionIDs[j];
                array2[j] = steamworksEconomyItemDefinition.steamItemDef;
            }
            SteamInventoryResult_t steamInventoryResult;

            SteamInventory.ExchangeItems(ref steamInventoryResult, array2, outputItemQuantities, (uint)array2.Length, array, inputItemQuantities, (uint)array.Length);
            return(this.addInventoryRequestHandle(steamInventoryResult, inventoryRequestReadyCallback));
        }
Beispiel #2
0
 // Token: 0x06001746 RID: 5958 RVA: 0x000860C0 File Offset: 0x000844C0
 public void exchangeInventory(int generate, params ulong[] destroy)
 {
     Debug.Log("Exchange these item instances for " + generate);
     foreach (ulong num in destroy)
     {
         int inventoryItem = this.getInventoryItem(num);
         Debug.Log(string.Concat(new object[]
         {
             inventoryItem,
             " [",
             num,
             "]"
         }));
     }
     SteamItemDef_t[] array  = new SteamItemDef_t[1];
     uint[]           array2 = new uint[1];
     array[0]  = (SteamItemDef_t)generate;
     array2[0] = 1u;
     SteamItemInstanceID_t[] array3 = new SteamItemInstanceID_t[destroy.Length];
     uint[] array4 = new uint[destroy.Length];
     for (int j = 0; j < destroy.Length; j++)
     {
         array3[j] = (SteamItemInstanceID_t)destroy[j];
         array4[j] = 1u;
     }
     SteamInventory.ExchangeItems(out this.exchangeResult, array, array2, (uint)array.Length, array3, array4, (uint)array3.Length);
 }
 public void exchangeInventory(int generate, params ulong[] destroy)
 {
     Terminal.print(string.Concat(new object[]
     {
         "Exchange ",
         destroy.Length,
         " items for ",
         generate
     }), null, Provider.STEAM_IC, Provider.STEAM_DC, true);
     SteamItemDef_t[] array  = new SteamItemDef_t[1];
     uint[]           array2 = new uint[1];
     array[0]  = (SteamItemDef_t)generate;
     array2[0] = 1u;
     SteamItemInstanceID_t[] array3 = new SteamItemInstanceID_t[destroy.Length];
     uint[] array4 = new uint[destroy.Length];
     for (int i = 0; i < destroy.Length; i++)
     {
         array3[i] = (SteamItemInstanceID_t)destroy[i];
         array4[i] = 1u;
     }
     SteamInventory.ExchangeItems(ref this.exchangeResult, array, array2, (uint)array.Length, array3, array4, (uint)array3.Length);
 }
Beispiel #4
0
    private bool EquipOrOpenItem(int a_index)
    {
        bool result = false;

        if (this.m_itemDetails != null && a_index > -1 && a_index < this.m_itemDetails.Count)
        {
            int   steamItemDef        = this.m_itemDetails[a_index].m_iDefinition.m_SteamItemDef;
            ulong steamItemInstanceID = this.m_itemDetails[a_index].m_itemId.m_SteamItemInstanceID;
            if (10000 > steamItemDef)
            {
                if (Global.isSteamActive)
                {
                    SteamItemDetails_t steamItemDetails_t = (steamItemDef != 3000) ? this.GetRandomItemFromInventory(3000, 3000) : this.GetRandomItemFromInventory(2000, 2999);
                    ulong steamItemInstanceID2            = steamItemDetails_t.m_itemId.m_SteamItemInstanceID;
                    if (steamItemInstanceID2 != 0UL)
                    {
                        this.m_generatorDefId = ((steamItemDef != 3000) ? steamItemDef : steamItemDetails_t.m_iDefinition.m_SteamItemDef) - 1000;
                        SteamItemInstanceID_t[] array = new SteamItemInstanceID_t[2];
                        uint[] array2 = new uint[2];
                        array[0].m_SteamItemInstanceID = steamItemInstanceID;
                        array[1].m_SteamItemInstanceID = steamItemInstanceID2;
                        array2[0] = 1U;
                        array2[1] = 1U;
                        SteamItemDef_t[] array3 = new SteamItemDef_t[1];
                        uint[]           array4 = new uint[1];
                        array3[0].m_SteamItemDef = this.m_generatorDefId;
                        array4[0]              = 1U;
                        this.m_waitForResult   = SteamInventory.ExchangeItems(out this.m_resultHandle, array3, array4, 1U, array, array2, 2U);
                        this.m_completeRefresh = false;
                        this.m_caseOpenFlag    = this.m_waitForResult;
                    }
                    else if (steamItemDef == 3000)
                    {
                        this.OpenCommunityMarket();
                    }
                    else
                    {
                        this.BuyKey(1);
                    }
                }
                else
                {
                    this.m_caseOpenGui.Showtime(steamItemDef, ((steamItemDef != 3000) ? steamItemDef : 2000) - 1000);
                }
            }
            else if (null != this.m_client)
            {
                int num  = this.m_steamInventoryHandler.GetLookItemDef();
                int num2 = this.m_steamInventoryHandler.GetSkinItemDef();
                if (20000 > steamItemDef)
                {
                    if (num == steamItemDef)
                    {
                        num = 0;
                    }
                    else
                    {
                        num = steamItemDef;
                    }
                }
                else if (num2 == steamItemDef)
                {
                    num2 = 0;
                }
                else
                {
                    num2 = steamItemDef;
                }
                this.m_steamInventoryHandler.SetLook(num, num2);
            }
            result = true;
        }
        return(result);
    }
Beispiel #5
0
    public void RenderOnGUI()
    {
        GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height));
        GUILayout.Label("Variables:");
        GUILayout.Label("m_SteamInventoryResult: " + m_SteamInventoryResult);
        GUILayout.Label("m_SteamItemDetails: " + m_SteamItemDetails);
        GUILayout.Label("m_SteamItemDef: " + m_SteamItemDef);
        GUILayout.Label("m_SerializedBuffer: " + m_SerializedBuffer);
        GUILayout.EndArea();

        GUILayout.BeginVertical("box");
        m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33));

        // INVENTORY ASYNC RESULT MANAGEMENT

        GUILayout.Label("GetResultStatus(m_SteamInventoryResult) : " + SteamInventory.GetResultStatus(m_SteamInventoryResult));

        if (GUILayout.Button("GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize)"))
        {
            uint OutItemsArraySize = 0;
            bool ret = SteamInventory.GetResultItems(m_SteamInventoryResult, null, ref OutItemsArraySize);
            if (ret && OutItemsArraySize > 0)
            {
                m_SteamItemDetails = new SteamItemDetails_t[OutItemsArraySize];
                ret = SteamInventory.GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize);
                print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", m_SteamItemDetails, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize);

                System.Text.StringBuilder test = new System.Text.StringBuilder();
                for (int i = 0; i < OutItemsArraySize; ++i)
                {
                    test.AppendFormat("{0} - {1} - {2} - {3} - {4}\n", i, m_SteamItemDetails[i].m_itemId, m_SteamItemDetails[i].m_iDefinition, m_SteamItemDetails[i].m_unQuantity, m_SteamItemDetails[i].m_unFlags);
                }
                print(test);
            }
            else
            {
                print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", null, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize);
            }
        }

        if (GUILayout.Button("GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize)"))
        {
            string ValueBuffer;
            uint   ValueBufferSize = 0;
            bool   ret             = SteamInventory.GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize);
            if (ret)
            {
                ret = SteamInventory.GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize);
            }
            print("SteamInventory.GetResultItemProperty(" + m_SteamInventoryResult + ", " + 0 + ", " + null + ", " + "out ValueBuffer" + ", " + "ref ValueBufferSize" + ") : " + ret + " -- " + ValueBuffer + " -- " + ValueBufferSize);
        }

        if (GUILayout.Button("GetResultTimestamp(m_SteamInventoryResult)"))
        {
            uint ret = SteamInventory.GetResultTimestamp(m_SteamInventoryResult);
            print("SteamInventory.GetResultTimestamp(" + m_SteamInventoryResult + ") : " + ret);
        }

        if (GUILayout.Button("CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID())"))
        {
            bool ret = SteamInventory.CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID());
            print("SteamInventory.CheckResultSteamID(" + m_SteamInventoryResult + ", " + SteamUser.GetSteamID() + ") : " + ret);
        }

        if (GUILayout.Button("DestroyResult(m_SteamInventoryResult)"))
        {
            DestroyResult();
        }

        // INVENTORY ASYNC QUERY

        if (GUILayout.Button("GetAllItems(out m_SteamInventoryResult)"))
        {
            bool ret = SteamInventory.GetAllItems(out m_SteamInventoryResult);
            print("SteamInventory.GetAllItems(" + "out m_SteamInventoryResult" + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("GetItemsByID(out m_SteamInventoryResult, InstanceIDs, (uint)InstanceIDs.Length)"))
        {
            SteamItemInstanceID_t[] InstanceIDs = { (SteamItemInstanceID_t)0, (SteamItemInstanceID_t)1, };
            bool ret = SteamInventory.GetItemsByID(out m_SteamInventoryResult, InstanceIDs, (uint)InstanceIDs.Length);
            print("SteamInventory.GetItemsByID(" + "out m_SteamInventoryResult" + ", " + InstanceIDs + ", " + (uint)InstanceIDs.Length + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        // RESULT SERIALIZATION AND AUTHENTICATION

        if (GUILayout.Button("SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize)"))
        {
            uint OutBufferSize;
            bool ret = SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize);
            if (ret)
            {
                m_SerializedBuffer = new byte[OutBufferSize];
                ret = SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize);
                print("SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize) - " + ret + " -- " + OutBufferSize + " -- " + System.Text.Encoding.UTF8.GetString(m_SerializedBuffer, 0, m_SerializedBuffer.Length));
            }
            else
            {
                print("SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize) - " + ret + " -- " + OutBufferSize);
            }
        }

        if (GUILayout.Button("DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length)"))
        {
            bool ret = SteamInventory.DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length);
            print("SteamInventory.DeserializeResult(" + "out m_SteamInventoryResult" + ", " + m_SerializedBuffer + ", " + (uint)m_SerializedBuffer.Length + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        // INVENTORY ASYNC MODIFICATION

        if (GUILayout.Button("GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length)"))
        {
            SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration2 };
            bool             ret           = SteamInventory.GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length);
            print("SteamInventory.GenerateItems(" + "out m_SteamInventoryResult" + ", " + ArrayItemDefs + ", " + null + ", " + (uint)ArrayItemDefs.Length + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("GrantPromoItems(out m_SteamInventoryResult)"))
        {
            bool ret = SteamInventory.GrantPromoItems(out m_SteamInventoryResult);
            print("SteamInventory.GrantPromoItems(" + "out m_SteamInventoryResult" + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1)"))
        {
            bool ret = SteamInventory.AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1);
            print("SteamInventory.AddPromoItem(" + "out m_SteamInventoryResult" + ", " + ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1 + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length)"))
        {
            SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon2 };
            bool             ret           = SteamInventory.AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length);
            print("SteamInventory.AddPromoItems(" + "out m_SteamInventoryResult" + ", " + ArrayItemDefs + ", " + (uint)ArrayItemDefs.Length + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1);
                print("SteamInventory.ConsumeItem(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        if (GUILayout.Button("ExchangeItems(TODO)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.ExchangeItems(out m_SteamInventoryResult, null, null, 0, null, null, 0);                 // TODO
                print("SteamInventory.ExchangeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        if (GUILayout.Button("TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid);
                print("SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1, SteamItemInstanceID_t.Invalid) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        // TIMED DROPS AND PLAYTIME CREDIT

        if (GUILayout.Button("SendItemDropHeartbeat()"))
        {
            SteamInventory.SendItemDropHeartbeat();
            print("SteamInventory.SendItemDropHeartbeat()");
        }

        if (GUILayout.Button("TriggerItemDrop(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList)"))
        {
            bool ret = SteamInventory.TriggerItemDrop(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList);
            print("SteamInventory.TriggerItemDrop(" + "out m_SteamInventoryResult" + ", " + ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList + ") : " + ret + " -- " + m_SteamInventoryResult);
        }

        // IN-GAME TRADING

        if (GUILayout.Button("TradeItems(TODO)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.TradeItems(out m_SteamInventoryResult, SteamUser.GetSteamID(), null, null, 0, null, null, 0);                 // TODO... Difficult
                print("SteamInventory.TradeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        // ITEM DEFINITIONS

        if (GUILayout.Button("LoadItemDefinitions()"))
        {
            bool ret = SteamInventory.LoadItemDefinitions();
            print("SteamInventory.LoadItemDefinitions() : " + ret);
        }

        if (GUILayout.Button("GetItemDefinitionIDs(ItemDefIDs, ref length)"))
        {
            uint length = 0;
            bool ret    = SteamInventory.GetItemDefinitionIDs(null, ref length);
            if (ret)
            {
                m_SteamItemDef = new SteamItemDef_t[length];
                ret            = SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, ref length);
                print("SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, ref length) - " + ret + " -- " + length);
            }
            else
            {
                print("SteamInventory.GetItemDefinitionIDs(null, ref length) - " + ret + " -- " + length);
            }
        }

        if (GUILayout.Button("GetItemDefinitionProperty(ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, null, out ValueBuffer, ref length)"))
        {
            uint   length = 2048;
            string ValueBuffer;
            bool   ret = SteamInventory.GetItemDefinitionProperty(ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, null, out ValueBuffer, ref length);
            print("SteamInventory.GetItemDefinitionProperty(" + ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1 + ", " + null + ", " + "out ValueBuffer" + ", " + "ref length" + ") : " + ret + " -- " + ValueBuffer + " -- " + length);
        }

        if (GUILayout.Button("RequestEligiblePromoItemDefinitionsIDs(SteamUser.GetSteamID())"))
        {
            SteamAPICall_t handle = SteamInventory.RequestEligiblePromoItemDefinitionsIDs(SteamUser.GetSteamID());
            OnSteamInventoryEligiblePromoItemDefIDsCallResult.Set(handle);
            print("SteamInventory.RequestEligiblePromoItemDefinitionsIDs(" + SteamUser.GetSteamID() + ") : " + handle);
        }

        //SteamInventory.GetEligiblePromoItemDefinitionIDs() // Should be handled within the SteamInventoryEligiblePromoItemDefIDs_t CallResult!

        //SteamInventory.StartPurchase() // TODO

        //SteamInventory.RequestPrices() // TODO

        //SteamInventory.GetNumItemsWithPrices() // TODO

        //SteamInventory.GetItemsWithPrices() // TODO

        //SteamInventory.GetItemPrice() // TODO

        //SteamInventory.StartUpdateProperties() // TODO

        //SteamInventory.RemoveProperty() // TODO

        //SteamInventory.SetProperty() // TODO

        //SteamInventory.SetProperty() // TODO

        //SteamInventory.SetProperty() // TODO

        //SteamInventory.SetProperty() // TODO

        //SteamInventory.SubmitUpdateProperties() // TODO

        GUILayout.EndScrollView();
        GUILayout.EndVertical();
    }
    public void RenderOnGUI()
    {
        GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height));
        GUILayout.Label("Variables:");
        GUILayout.Label("m_SteamInventoryResult: " + m_SteamInventoryResult);
        GUILayout.EndArea();

        // INVENTORY ASYNC RESULT MANAGEMENT

        GUILayout.Label("SteamInventory.GetResultStatus(" + m_SteamInventoryResult + ") - " + SteamInventory.GetResultStatus(m_SteamInventoryResult));

        if (GUILayout.Button("GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize)"))
        {
            uint OutItemsArraySize = 0;
            bool ret = SteamInventory.GetResultItems(m_SteamInventoryResult, null, ref OutItemsArraySize);
            if (ret && OutItemsArraySize > 0)
            {
                m_SteamItemDetails = new SteamItemDetails_t[OutItemsArraySize];
                ret = SteamInventory.GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize);
                print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", m_SteamItemDetails, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize);

                System.Text.StringBuilder test = new System.Text.StringBuilder();
                for (int i = 0; i < OutItemsArraySize; ++i)
                {
                    test.AppendFormat("{0} - {1} - {2} - {3} - {4}\n", i, m_SteamItemDetails[i].m_itemId, m_SteamItemDetails[i].m_iDefinition, m_SteamItemDetails[i].m_unQuantity, m_SteamItemDetails[i].m_unFlags);
                }
                print(test);
            }
            else
            {
                print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", null, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize);
            }
        }

        if (GUILayout.Button("GetResultTimestamp(m_SteamInventoryResult)"))
        {
            print("SteamInventory.GetResultTimestamp(" + m_SteamInventoryResult + ") - " + SteamInventory.GetResultTimestamp(m_SteamInventoryResult));
        }

        if (GUILayout.Button("CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID())"))
        {
            print("SteamInventory.CheckResultSteamID(" + m_SteamInventoryResult + ", " + SteamUser.GetSteamID() + ") - " + SteamInventory.CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID()));
        }

        if (GUILayout.Button("DestroyResult(m_SteamInventoryResult)"))
        {
            DestroyResult();
        }

        // INVENTORY ASYNC QUERY

        if (GUILayout.Button("GetAllItems(out m_SteamInventoryResult)"))
        {
            bool ret = SteamInventory.GetAllItems(out m_SteamInventoryResult);
            print("SteamInventory.GetAllItems(out m_SteamInventoryResult) - " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("GetItemsByID(out m_SteamInventoryResult, InstanceIDs, InstanceIDs.Length)"))
        {
            SteamItemInstanceID_t[] InstanceIDs = { (SteamItemInstanceID_t)0, (SteamItemInstanceID_t)1, };
            bool ret = SteamInventory.GetItemsByID(out m_SteamInventoryResult, InstanceIDs, (uint)InstanceIDs.Length);
            print("SteamInventory.GetItemsByID(out m_SteamInventoryResult, InstanceIDs, " + InstanceIDs.Length + ") - " + ret + " -- " + m_SteamInventoryResult);
        }

        // RESULT SERIALIZATION AND AUTHENTICATION
        if (GUILayout.Button("SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize)"))
        {
            uint OutBufferSize;
            bool ret = SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize);
            if (ret)
            {
                m_SerializedBuffer = new byte[OutBufferSize];
                ret = SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize);
                print("SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize) - " + ret + " -- " + OutBufferSize + " -- " + System.Text.Encoding.UTF8.GetString(m_SerializedBuffer, 0, m_SerializedBuffer.Length));
            }
            else
            {
                print("SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize) - " + ret + " -- " + OutBufferSize);
            }
        }

        if (GUILayout.Button("DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length)"))
        {
            bool ret = SteamInventory.DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length);
            print("SteamInventory.DeserializeResult(out m_SteamInventoryResult, " + m_SerializedBuffer + ", " + (uint)m_SerializedBuffer.Length + ") - " + ret + " -- " + m_SteamInventoryResult);
        }

        // INVENTORY ASYNC MODIFICATION

        if (GUILayout.Button("GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length)"))
        {
            SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration2 };

            bool ret = SteamInventory.GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length);
            print("SteamInventory.GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, " + (uint)ArrayItemDefs.Length + ") - " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("GrantPromoItems(out m_SteamInventoryResult)"))
        {
            bool ret = SteamInventory.GrantPromoItems(out m_SteamInventoryResult);
            print("SteamInventory.GrantPromoItems(out m_SteamInventoryResult) - " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1)"))
        {
            bool ret = SteamInventory.AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1);
            print("SteamInventory.AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1) - " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length)"))
        {
            SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon2 };
            bool             ret           = SteamInventory.AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length);
            print("SteamInventory.AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, " + (uint)ArrayItemDefs.Length + ") - " + ret + " -- " + m_SteamInventoryResult);
        }

        if (GUILayout.Button("ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1);
                print("SteamInventory.ConsumeItem(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        if (GUILayout.Button("ExchangeItems(TODO)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.ExchangeItems(out m_SteamInventoryResult, null, null, 0, null, null, 0);                 // TODO
                print("SteamInventory.ExchangeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        if (GUILayout.Button("TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid);
                print("SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1, SteamItemInstanceID_t.Invalid) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        // TIMED DROPS AND PLAYTIME CREDIT

        if (GUILayout.Button("SendItemDropHeartbeat()"))
        {
            SteamInventory.SendItemDropHeartbeat();
            print("SteamInventory.SendItemDropHeartbeat()");
        }

        if (GUILayout.Button("TriggerItemDrop(out m_SteamInventoryResult, k_SpaceWarItem_TimedDropList)"))
        {
            SteamInventory.TriggerItemDrop(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList);
            print("SteamInventory.TriggerItemDrop(out m_SteamInventoryResult, k_SpaceWarItem_TimedDropList)");
        }

        // IN-GAME TRADING
        if (GUILayout.Button("TradeItems(TODO)"))
        {
            if (m_SteamItemDetails != null)
            {
                bool ret = SteamInventory.TradeItems(out m_SteamInventoryResult, SteamUser.GetSteamID(), null, null, 0, null, null, 0);                 // TODO... Difficult
                print("SteamInventory.TradeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult);
            }
        }

        // ITEM DEFINITIONS
        if (GUILayout.Button("LoadItemDefinitions()"))
        {
            print("SteamInventory.LoadItemDefinitions() - " + SteamInventory.LoadItemDefinitions());
        }

        if (GUILayout.Button("GetItemDefinitionIDs(ItemDefIDs, ref length)"))
        {
            uint length;
            bool ret = SteamInventory.GetItemDefinitionIDs(null, out length);
            if (ret)
            {
                m_SteamItemDef = new SteamItemDef_t[length];
                ret            = SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, out length);
                print("SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, out length) - " + ret + " -- " + length);
            }
            else
            {
                print("SteamInventory.GetItemDefinitionIDs(null, out length) - " + ret + " -- " + length);
            }
        }

        if (GUILayout.Button("GetItemDefinitionProperty()"))
        {
            string ValueBuffer;
            uint   length = 2048;
            bool   ret    = SteamInventory.GetItemDefinitionProperty(ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, null, out ValueBuffer, ref length);
            print("SteamInventory.GetItemDefinitionProperty() - " + ret + " -- " + ValueBuffer + " -- " + length);
        }
    }