public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSize)
 {
     InteropHelp.TestIfAvailableGameServer();
     IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSize);
     bool result;
     using (InteropHelp.UTF8StringHandle uTF8StringHandle = new InteropHelp.UTF8StringHandle(pchPropertyName))
     {
         bool flag = NativeMethods.ISteamGameServerInventory_GetItemDefinitionProperty(iDefinition, uTF8StringHandle, intPtr, ref punValueBufferSize);
         pchValueBuffer = ((!flag) ? null : InteropHelp.PtrToStringUTF8(intPtr));
         Marshal.FreeHGlobal(intPtr);
         result = flag;
     }
     return result;
 }
		/// <summary>
		/// <para> Playtime credit must be consumed and turned into item drops by your game. Only item</para>
		/// <para> definitions which are marked as "playtime item generators" can be spawned. The call</para>
		/// <para> will return an empty result set if there is not enough playtime credit for a drop.</para>
		/// <para> Your game should call TriggerItemDrop at an appropriate time for the user to receive</para>
		/// <para> new items, such as between rounds or while the player is dead. Note that players who</para>
		/// <para> hack their clients could modify the value of "dropListDefinition", so do not use it</para>
		/// <para> to directly control rarity. It is primarily useful during testing and development,</para>
		/// <para> where you may wish to perform experiments with different types of drops.</para>
		/// </summary>
		public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_TriggerItemDrop(out pResultHandle, dropListDefinition);
		}
		/// <summary>
		/// <para> ExchangeItems() is an atomic combination of GenerateItems and DestroyItems. It can be</para>
		/// <para> used to implement crafting recipes or transmutations, or items which unpack themselves</para>
		/// <para> into other items. Like GenerateItems, this is a flexible and dangerous API which is</para>
		/// <para> meant for rapid prototyping. You can configure restrictions on ExchangeItems via the</para>
		/// <para> Steamworks website, such as limiting it to a whitelist of input/output combinations</para>
		/// <para> corresponding to recipes.</para>
		/// <para> (Note: although GenerateItems may be hard or impossible to use securely in your game,</para>
		/// <para> ExchangeItems is perfectly reasonable to use once the whitelists are set accordingly.)</para>
		/// </summary>
		public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_ExchangeItems(out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength);
		}
		public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_AddPromoItems(out pResultHandle, pArrayItemDefs, unArrayLength);
		}
		/// <summary>
		/// <para> AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of</para>
		/// <para> scanning for all eligible promotional items, the check is restricted to a single item</para>
		/// <para> definition or set of item definitions. This can be useful if your game has custom UI for</para>
		/// <para> showing a specific promo item to the user.</para>
		/// </summary>
		public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_AddPromoItem(out pResultHandle, itemDef);
		}
Пример #6
0
		public static extern bool ISteamGameServerInventory_GetItemDefinitionProperty(SteamItemDef_t iDefinition, InteropHelp.UTF8StringHandle pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSize);
Пример #7
0
		public static extern bool ISteamGameServerInventory_TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition);
Пример #8
0
 public T GetDefinition <T>(SteamItemDef_t steamDefinition) where T : InventoryItemDefinition
 {
     return(Settings.GetDefinition <T>(steamDefinition));
 }
		/// <summary>
		/// <para> After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this</para>
		/// <para> function to pull out the list of item definition ids that the user can be</para>
		/// <para> manually granted via the AddPromoItems() call.</para>
		/// </summary>
		public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_GetEligiblePromoItemDefinitionIDs(steamID, pItemDefIDs, ref punItemDefIDsArraySize);
		}
Пример #10
0
		/// <summary>
		/// <para> INVENTORY ASYNC MODIFICATION</para>
		/// <para> GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t</para>
		/// <para> notification with a matching nCallbackContext parameter. This API is insecure, and could</para>
		/// <para> be abused by hacked clients. This call is normally disabled unless you explicitly enable</para>
		/// <para> "Development mode" on the Inventory Service section of the Steamworks website.</para>
		/// <para> You should not enable this mode for a shipping game!</para>
		/// <para> Note that Steam accounts that belong to the publisher group for your game are granted</para>
		/// <para> an exception - as a developer, you may use this to generate and test items in your game.</para>
		/// <para> If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should</para>
		/// <para> describe the quantity of each item to generate.</para>
		/// </summary>
		public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) {
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamInventory_GenerateItems(out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength);
		}
Пример #11
0
 // Token: 0x060017F2 RID: 6130 RVA: 0x00088857 File Offset: 0x00086C57
 public void readFromStream(NetworkStream networkStream)
 {
     this.steamItemDef = (SteamItemDef_t)networkStream.readInt32();
 }
Пример #12
0
 // Token: 0x060017EF RID: 6127 RVA: 0x00088837 File Offset: 0x00086C37
 public SteamworksEconomyItemDefinition(SteamItemDef_t newSteamItemDef)
 {
     this.steamItemDef = newSteamItemDef;
 }
Пример #13
0
 public InventoryItemDefinition GetDefinition(SteamItemDef_t steamDefinition)
 {
     return(Settings.GetDefinition(steamDefinition));
 }
		/// <summary>
		/// <para> GetItemDefinitionIDs returns the set of all defined item definition IDs (which are</para>
		/// <para> defined via Steamworks configuration, and not necessarily contiguous integers).</para>
		/// <para> If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will</para>
		/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
		/// <para> return false if and only if there is not enough space in the output array.</para>
		/// </summary>
		public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_GetItemDefinitionIDs(pItemDefIDs, out punItemDefIDsArraySize);
		}
Пример #15
0
		public static extern bool ISteamGameServerInventory_AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef);
		/// <summary>
		/// <para> GetItemDefinitionProperty returns a string property from a given item definition.</para>
		/// <para> Note that some properties (for example, "name") may be localized and will depend</para>
		/// <para> on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage).</para>
		/// <para> Property names are always composed of ASCII letters, numbers, and/or underscores.</para>
		/// <para> Pass a NULL pointer for pchPropertyName to get a comma - separated list of available</para>
		/// <para> property names.</para>
		/// </summary>
		public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSize) {
			InteropHelp.TestIfAvailableGameServer();
			IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSize);
			using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
				bool ret = NativeMethods.ISteamGameServerInventory_GetItemDefinitionProperty(iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSize);
				pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null;
				Marshal.FreeHGlobal(pchValueBuffer2);
				return ret;
			}
		}
Пример #17
0
 /// <summary>
 /// Constructs a new recipe based on a taget item to create and a collection of items to be consumed.
 /// </summary>
 /// <param name="toGenerate"></param>
 /// <param name="toBeConsumed"></param>
 public ItemExchangeRecipe(SteamItemDef_t toGenerate, IEnumerable <ExchangeItemCount> toBeConsumed)
 {
     ItemToGenerate = toGenerate;
     ItemsToConsume = new List <ExchangeItemCount>(toBeConsumed);
 }