steam ui join
This commit is contained in:
@@ -26,6 +26,7 @@ func _ready() -> void:
|
|||||||
Steam.lobby_joined.connect(_on_lobby_joined)
|
Steam.lobby_joined.connect(_on_lobby_joined)
|
||||||
Steam.lobby_chat_update.connect(_on_lobby_chat_update)
|
Steam.lobby_chat_update.connect(_on_lobby_chat_update)
|
||||||
Steam.p2p_session_request.connect(_on_p2p_session_request)
|
Steam.p2p_session_request.connect(_on_p2p_session_request)
|
||||||
|
Steam.join_requested.connect(_on_lobby_join_requested)
|
||||||
|
|
||||||
multiplayer.peer_connected.connect(_on_peer_connected)
|
multiplayer.peer_connected.connect(_on_peer_connected)
|
||||||
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
|
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
|
||||||
@@ -38,6 +39,7 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
if not steam_initialized:
|
if not steam_initialized:
|
||||||
return
|
return
|
||||||
@@ -72,6 +74,11 @@ func join_lobby(this_lobby_id: int):
|
|||||||
Steam.joinLobby(this_lobby_id)
|
Steam.joinLobby(this_lobby_id)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_lobby_join_requested(this_lobby_id: int, friend_id: int) -> void:
|
||||||
|
print("[CLIENT] 1. Attempting to join lobby (ID: %s)..." % this_lobby_id)
|
||||||
|
Steam.joinLobby(this_lobby_id)
|
||||||
|
|
||||||
|
|
||||||
func _on_lobby_joined(this_lobby_id: int, _p, _l, response: int):
|
func _on_lobby_joined(this_lobby_id: int, _p, _l, response: int):
|
||||||
if response != Steam.CHAT_ROOM_ENTER_RESPONSE_SUCCESS:
|
if response != Steam.CHAT_ROOM_ENTER_RESPONSE_SUCCESS:
|
||||||
print("[CLIENT] !!! Failed to join lobby: %s" % get_join_fail_reason(response))
|
print("[CLIENT] !!! Failed to join lobby: %s" % get_join_fail_reason(response))
|
||||||
|
|||||||
Reference in New Issue
Block a user