expressobits / steam-multiplayer-peer

Steam Sockets Multiplayer Peer for Godot 4 via GDExtension
MIT License
155 stars 8 forks source link

MacOS "can't open dynamic library / not found in the current scope" errors #23

Open ismettaha opened 1 month ago

ismettaha commented 1 month ago

After installing the plugin, I was unable to use SteamMultiplayerPeer. I resolved the issue by updating three lines in the steam-multiplayer-peer.gdextension file. Specifically, I added "macos.framework" to the paths of the lines that began with macos.debug, macos.release, and macos.universal. Additionally, I had to remove the ".framework" extension from the release and debug lines.

After making these changes, I encountered errors stating, "... can't be opened because Apple cannot check it for malicious software." To resolve this, I had to manually open each file within the macos.framework directory through Finder to approve.

I am not opening a pull request because I'm unsure if this is an acceptable solution. Thank you.

Updated Lines: macos.debug = "macos/macos.framework/libsteam-multiplayer-peer.macos.template_debug" macos.release = "macos/macos.framework/libsteam-multiplayer-peer.macos.template_release" . . . macos.universal = { "macos/macos.framework/libsteam_api.dylib": "" }

Godot Version: v4.2.2.stable.official [15073afe3] Steam Multiplayer Peer Version: 0.1.1 OS: MacOS Sonoma 14.4.1

dev-bre commented 1 month ago

yeah I had the same issue. Even fixing the file path, the library still fails on create_hostcall for me with error code 20

kafk3d commented 1 day ago

yeah I had the same issue. Even fixing the file path, the library still fails on create_hostcall for me with error code 20

same problem here, godot 4.3 on macos, fixed the paths but got error on create_host with code 2 windows is working

func _on_lobby_created(conn, id) -> void:
    print("Lobby creation attempt. Result: ", conn)
    if conn == 1:
        lobby_id = id
        print("Lobby ID: ", lobby_id)
        print("Creating host...")
        var my_name : String = Steam.getPersonaName()
        if len(my_name) > 17:
            my_name = my_name.substr(0,17) + '...'
        Steam.setLobbyData(lobby_id, "name", (my_name+"'s Lobby"))
        Steam.setLobbyJoinable(lobby_id, true)
        multiplayer_peer = SteamMultiplayerPeer.new()
        print("multiplayer_peer: ", multiplayer_peer)
        var error = multiplayer_peer.create_host(8004)
        print("Host creation result: ", error)
        if error != OK:
            print("Error code: ", error)
            multiplayer_peer.close()
            Steam.leaveLobby(lobby_id)
            SignalBus.display_error.emit("ERROR CREATING HOST CLIENT\nCODE: " + str(error))
            return
        multiplayer.set_multiplayer_peer(multiplayer_peer)
        players[1] = {"name": my_name, "id": Steam.getSteamID()}
        Steam.allowP2PPacketRelay(true)
        _transition_to_lobby()
    else:
        SignalBus.display_error.emit('ERROR CREATING STEAM LOBBY\nCODE: '+str(conn))

logs:

Initializing Steam...
Steam init result: { "status": 0, "verbal": "" }
Steam init result: true
Steam API initialized successfully
Lobby creation attempt. Result: 1
Lobby ID: 109775243920987967
Creating host...
multiplayer_peer: [Wrapped:0]
Host creation result: 2
Error code: 2