If you are hoping to create a competitive match environment, see the end of this description, as Steamworks P2P is not entirely reliable if your goal is AAA.
Suggested: Rely on this build for usage of Steam Inventory and Steamworks P2P Lobby API.
-------------------------------
Note: This build does not have any examples of Steam's Marketplace API, item consumption, combination crafting like TF2, or trading.
Though, I might implement something later on, as I've found in-game links to work well with Marketplace Item purchasing; Once you have a working item store setup for your game, you can construct a method of equipping the items for your players.
The current code has a place for reactions to inventory items OnClick();
You can find it in the inventory item prefab within the inventory displayer.
Note: Item Ownership IDs are unique, like a fingerprint for every item even though multiple instances of them all have the same name, like Hat 1. You should assume you have to reference something other than the Ownership ID for coded interaction, like, I click to equip Hat 1, it doesn't matter that I have multiple Hat 1s, my player is just wearing Hat 1 now, you could network message this to the Mirror host so the other players can see I'm wearing Hat 1. Obviously this is a problem with hackers, which you would have to not be using Steam Lobby's limited API to protect such a thing. So, lobbies work great with things like apparel, but maybe avoid one-time-use items...
Meaning, its up to you to decide what happens when a player owns an item and wants to interact with it.
With that being said:
Example item purchase method:
https://store.steampowered.com/buyitem/{appid}/{itemdefid}/{quantity}
You can find this here at the bottom of the page.
-------------------------------
Created under MIT License.
- Limit game session lengths to clear players out after time is up.
- Choose to filter quick play by newest or oldest, or not at all.
- Feel safer with a previous-lobby-leaver that keeps duplicates from happening.
Does not include:
An example for exchanging/combining items (like keys and crates for random loot, etc.)
Exchange and Consume Steamworks API are included, though. So you may attempt this yourself.
Readme.txt provided
-------------------------------
Why Steamworks P2P is NOT ideal for Competitive Matchmaking Games
1. Hackers can start multiple Steam lobbies with ideal matchmaking variables at an infinite rate, essentially breaking your matchmaking system
2. Developers have no control of bans without every lobby-creating hacker being inside of a Server hosted and maintained by YOU
3. Guests do not have the ability to check if a Host is VAC banned
Suggested for inventory builders: Rely on this build as an example usage of inventory and Steamworks API. Then, create your Competitive Matchmaking Game using a Server to oversee everything.
Why P2P is still GOOD? It's FREE.
P2P is a great idea for games like story adventure or RPG where two or more friends can easily find their host's lobby name in a list. Also, Steam invites work!
Then why Quickplay?
Games with public lobby integration could allow players to quickly find a game, at the obvious chance of a spam-hosted lobby being the result and thus the image of your game should be barely affected as your game is NOT meant to rely on YOUR hosting for all of its interactions. In such a case, you should rely on Private Singleplayer and Invite Only Multiplayer alongside Quickplay to provide your game at its best.
If you limit your game to Quickplay only without a Server to control things, you're not guaranteed to have leading results. If a Competitive Matchmaking Game is your goal, look into Dedicated Server Hosting.