Steam

GD-Sync includes built-in Steam integration. If the GodotSteam plugin is installed, GD-Sync will automatically detect it and enable additional features.

When using Steam integration, ensure that GodotSteam is properly initialized before using any GD-Sync features that depend on it.

Joining Friends

Steam friends can seamlessly join each other when one of them is in a GD-Sync lobby. If a player is inside a lobby, it will be automatically detected by Steam. Their friends can then right-click the player’s name in Steam and select Join.

When the join button in Steam is pressed, GD-Sync emits the signal GDSync.steam_join_request(lobby_name : String, has_password : bool). You can use this signal to either join the lobby immediately if it has no password, or display a screen where the user can enter the password before joining.

func _ready() -> void:
	GDSync.steam_join_request.connect(steam_join_request)

#Player pressed join to play with a friend inside Steam
func steam_join_request(lobby_name : String, has_password : bool) -> void:
	if !has_password:
		#Directly join the lobby
		#GDSync.join_lobby(lobby_name)
	else:
		#A password has to be entered first
  

Account Linking

GD-Sync accounts can be linked to Steam accounts. When linked, players can log into their GD-Sync account using their active Steam session, skipping the need to manually enter an email and password.

To link a Steam account, first log into the desired GD-Sync account. Once logged in, call GDSync.steam_link_account(). This returns a response code from ENUMS.LINK_STEAM_ACCOUNT_RESPONSE_CODE.

After linking, you can log in using GDSync.steam_login(valid_time : float). This works the same way as the normal login function, returning a response code from ENUMS.STEAM_LOGIN_RESPONSE_CODE.

To unlink a Steam account from a GD-Sync account, use GDSync.steam_unlink_account(). This returns a response code from ENUMS.UNLINK_STEAM_ACCOUNT_RESPONSE_CODE.