/// <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 PropertyName to get a comma - separated list of available</para> /// <para> property names.</para> /// </summary> public static bool GetItemDefinitionProperty(SteamItemDef iDefinition, string PropertyName, out string ValueBuffer, ref uint punValueBufferSize) { InteropHelp.TestIfAvailableGameServer(); var ValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSize); using (var PropertyName2 = new InteropHelp.UTF8StringHandle(PropertyName)) { var ret = NativeMethods.ISteamGameServerInventory_GetItemDefinitionProperty(iDefinition, PropertyName2, ValueBuffer2, ref punValueBufferSize); ValueBuffer = ret ? InteropHelp.PtrToStringUTF8(ValueBuffer2) : null; Marshal.FreeHGlobal(ValueBuffer2); return(ret); } }
/// <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 pResultHandle, SteamItemDef dropListDefinition) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamGameServerInventory_TriggerItemDrop(out pResultHandle, dropListDefinition)); }
/// <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 pResultHandle, SteamItemDef itemDef) { InteropHelp.TestIfAvailableGameServer(); return(NativeMethods.ISteamGameServerInventory_AddPromoItem(out pResultHandle, itemDef)); }