private void UpdateSteamInventory(BaseEntity.RPCMessage msg) { MemoryStream memoryStream = msg.read.MemoryStreamWithSize(); if (memoryStream == null) { Debug.LogWarning((object)"UpdateSteamInventory: Data is null"); } else { Inventory.Result result = ((BaseSteamworks)Global.get_SteamServer()).get_Inventory().Deserialize(memoryStream.GetBuffer(), (int)memoryStream.Length); if (result == null) { Debug.LogWarning((object)"UpdateSteamInventory: result is null"); } else { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(this.ProcessInventoryResult(result)); } } }
private IEnumerator ProcessInventoryResult(Inventory.Result result) { SteamInventory steamInventory = this; float count = 0.0f; while (result.get_IsPending()) { ++count; yield return((object)CoroutineEx.waitForSeconds(1f)); if ((double)count > 30.0) { Debug.LogFormat("Steam Inventory result timed out for {0}", new object[1] { (object)steamInventory.baseEntity.displayName }); } } if (result.get_Items() != null) { steamInventory.Items = result.get_Items(); } result.Dispose(); }