add the p2p signal
This commit is contained in:
@@ -34,13 +34,22 @@ func _ready() -> void:
|
|||||||
multiplayer.connected_to_server.connect(_on_connected_to_server)
|
multiplayer.connected_to_server.connect(_on_connected_to_server)
|
||||||
multiplayer.connection_failed.connect(_on_connection_failed)
|
multiplayer.connection_failed.connect(_on_connection_failed)
|
||||||
multiplayer.server_disconnected.connect(_on_server_disconnected)
|
multiplayer.server_disconnected.connect(_on_server_disconnected)
|
||||||
|
Steam.p2p_session_request.connect(_on_p2p_session_request)
|
||||||
|
|
||||||
check_command_line()
|
check_command_line()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_p2p_session_request(steam_id_remote: int) -> void:
|
||||||
|
print("P2P session requested from: %s" % steam_id_remote)
|
||||||
|
Steam.acceptP2PSessionWithUser(steam_id_remote)
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
Steam.run_callbacks()
|
Steam.run_callbacks()
|
||||||
|
|
||||||
|
if Input.is_action_just_pressed("interact"):
|
||||||
|
print(lobby_members)
|
||||||
|
|
||||||
|
|
||||||
func check_command_line() -> void:
|
func check_command_line() -> void:
|
||||||
var args: Array = OS.get_cmdline_args()
|
var args: Array = OS.get_cmdline_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user