

Your friend's client gets the packets along with a special notification of whether to accept the incoming packets or not.

You simply start sending packets to your friend like you're the best buddies in the world. Instead of the expected workflow where a connection must first be established and acknowledged before packets start flowing, Steam's approach is different. Remember how I said that the API itself is a bit weird? Well, this right here is what I meant. Likewise, there are no "connections" established with Steam's API. I use both terms in quotations because instead of addresses, Steam's packets are sent directly to players, and players are identified by their Steam ID. It keeps the Steam ID identifier since that's the "address" for each "connection". So what does the P2PConnection class do? Not much. Next, let's start by making a new controller / wrapper class.
#Steam connection error 2017 pro#
To explain just what I mean by that, let's look at the steps required with the latest version of TNet (from the Pro repository as of this writing).įirst, you will want to grab Steamworks.NET here: And last but not least, the API itself is a little. Is there a reason NOT to use it? Second, the packet size is limited to just over 1 MB - but quite frankly if your game is sending out packets greater than 1 MB in size, you're probably doing something wrong.

But hey, let's face it - Steam is the best platform out there for gamers. Of course there are limitations: first, both players must be using Steam. Better still, if NAT punchthrough fails, Steam allows using its servers as relays to still make it possible for two players to play together. It uses UDP to simulate TCP-like functionality, but since it's UDP, NAT punchthrough is easy to do. Fortunately, Steam has ways around it, and they've indeed taken care of all of this with their networking API. Let's face it, while us devs find it a trivial task to open up a port on the router, and TNet does indeed us UPnP to do this automatically, the players are less savvy and can sometimes be behind such firewalls that even UPnP can't breach. Back in Windward days, I would sometimes get comments from players saying they can't join their friends' games, no matter what they tried.
