Skip to content

seetherdragon/GodotSteamClientToCPlusPlusServerNetworking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GodotSteamClientToCPlusPlusServer

Example of how to get a GodotSteam client to send/receive packets with a server running C++ (using the C++ Steam SDK)
Uses Steam's NetworkingSockets and Steam's Peer-to-peer connections over the Steam Data Relay network.
I think this is the most ideal case of how Steam wants us to do server/client communication in the future, as using IP addresses in Steam's new networking API is a mess.

FOR THE CLIENT:
-Get the pre-compiled GodotSteam editor (https://github.com/CoaguCo-Industries/GodotSteam/releases/tag/v4.4)
-Get the GodotSteam example project (https://github.com/CoaguCo-Industries/GodotSteam-Example-Project/tree/godot4)
-Open the precompiled Godotsteam editor and open the example project
-Create an empty node in the main scene of the GodotSteam example project
-Put the GDSteamClient.gd from this repository inside the GodotSteam example project and attach it (the GDscript) to the empty node you just created so that the GDscript will run when you start the example project. (It will only output to the console with print() )

FOR THE SERVER:

  1. Do everything in the "Getting Started" section of the following webpage-> (https://partner.steamgames.com/doc/sdk/api) to get the Steam SDK going.
  2. Get the main.cpp from this repository and put it into a new C++ project along with your Steam header files folder and your Steam SDK library file that you got from the above step.
  3. Figure out how to compile the main.cpp with the Steam library file and header files you downloaded in step 1 on whatever platform you're using. (I used CodeBlocks in Linux, as it was straightforward, and I want to use a Linux C++ Server)
    (For CodeBlocks, go to Project->Properties->Project Settings[tab]->Project's build options[button]->Linker settings[tab]->Add[button] and find your library from the Steamworks sdk (either .lib, .dylib, or .so depending on your OS. I used Debian Linux, so I linked to my libsteam_api.so file)

-Build/compile the server project, start Steam on the server computer, run the server app you just made.
-Start Steam on the client computer, run the GodotSteam example project that has the Node with GDSteamClient.gd attached.
-Watch the consoles for both apps as they talk to each other!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published