Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamMultiplayerPeer: lobby_created signal isn't firinig #1

Open
Fifut opened this issue Sep 15, 2024 · 6 comments
Open

SteamMultiplayerPeer: lobby_created signal isn't firinig #1

Fifut opened this issue Sep 15, 2024 · 6 comments
Assignees

Comments

@Fifut
Copy link

Fifut commented Sep 15, 2024

Describe the bug
lobby_created signal isn't firing after calling (SteamMultiplayerPeer) create_lobby(SteamMultiplayerPeer.LOBBY_TYPE_PUBLIC)
Only lobby_joined signal is firing
But work with Steam.createLobby(Steam.LOBBY_TYPE_PUBLIC, 8)

To Reproduce
Init steam
Connect lobby_created signal
Create a new SteamMultiplayerPeer
call create_lobby(SteamMultiplayerPeer.LOBBY_TYPE_PUBLIC) on this peer

Desktop (please complete the following information):

  • OS: Windows 11 Professionnel
  • Version 23H2

Version of GodotSteam:
Godot 4.3 - Steamworks 1.60 - GodotSteam MultiplayerPeer 4.10

Additional context
I didn't forget Steam.run_callbacks() in _process()

@Gramps Gramps self-assigned this Sep 18, 2024
@Gramps
Copy link
Member

Gramps commented Sep 18, 2024

Sorry for the late reply, I don't typically handle the MultiplayerPeer stuff. I would have to test this to see what is happening so I will have to get back to you in a bit.

@Fifut
Copy link
Author

Fifut commented Sep 20, 2024

Here the minimal code to reproduce the bug:

extends Node

var _peer: SteamMultiplayerPeer = SteamMultiplayerPeer.new()

func _ready():
	
	# This signal will be triggered
	Steam.lobby_joined.connect(
	func(lobby_id, permissions, locked, response):
		print("Steam lobby joined")
	)
	
	# This signal won't be triggered
	Steam.lobby_created.connect(
		func(connect, lobby_id):
			print("Steam lobby created")
	)
	
	_init_steam()
	_create_lobby()

func _process(delta):
	Steam.run_callbacks()

func _init_steam():
	var init = Steam.steamInit(true, 480, false)
	if init.status != 1:
		print("Steam initialization failed " + str(init.verbal) )
	else:
		print("Steam initialization ok")
	
func _create_lobby():
	var err = _peer.create_lobby(SteamMultiplayerPeer.LOBBY_TYPE_PUBLIC)
	if err != OK:
		print("Failed to start steam server")

@Gramps
Copy link
Member

Gramps commented Sep 20, 2024

I am actually reviewing a patch for all this code so this is perfect timing! Thank you.

@swAAn01
Copy link

swAAn01 commented Sep 21, 2024

@Fifut is this in an autoload script? Have you tried making _peer an onready var ?

@Fifut
Copy link
Author

Fifut commented Sep 21, 2024

@swAAn01 It's not an autoload and I get the same result with an onready.

It's just this signal that doesn't work, the others work perfectly.
If something goes wrong with peer, Steam.run_callbacks() or onready var, the other signals won't work either I think.

@NiclasEriksen
Copy link

I'm having the same issue, lobby_match_list isn't being fired either so I don't know a way of seeing if the lobby was created in the first place.

steamInit() returns { "status": 1, "verbal": "Steamworks active." }, getSteamId and getPersonaName both return expected values.

This is with the AssetLib version 4.11 on Godot 4.3.stable, running on Linux. Tried connecting signals and setting up Steam in both an autoload script and as an instanced node in a scene, same result.

var lobby_id: int = 0

func _ready() -> void:
	Steam.lobby_created.connect(_on_lobby_created)
	Steam.lobby_joined.connect(_on_lobby_joined)
	Steam.p2p_session_request.connect(_on_p2p_session_request)


func create_lobby():
	if lobby_id == 0:
		print("Create lobby")
		Steam.createLobby(Steam.LOBBY_TYPE_PUBLIC, lobby_members_max)


func _on_lobby_created(connect: int, this_lobby_id: int) -> void:
	print("_ON_LOBBY_CREATED")
# etc etc

@Gramps Gramps transferred this issue from GodotSteam/GodotSteam Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants