samsface / godot-steam-api

Godot Steam integration using GDNative.
400 stars 16 forks source link

Add bindings for headless Linux #7

Open snoopdouglas opened 2 years ago

snoopdouglas commented 2 years ago

I'm currently exporting my project using Godot's headless build. When doing this, it complains - but the build does complete just fine:

ERROR: init_library: does not have a library for the current platform.

This can be fixed by adding Server lines to the .gdnlib:

[general]

singleton=false
load_once=true
symbol_prefix="godot_"
reloadable=true

[entry]

OSX.64="res://addons/steam_api/libsteamsdk-godot.dylib"
Windows.64="res://addons/steam_api/steamsdk-godot.dll"
X11.64="res://addons/steam_api/libsteamsdk-godot.so"
Server="res://addons/steam_api/libsteamsdk-godot.so"

[dependencies]

OSX.64=[ "res://addons/steam_api/libsteam_api.dylib" ]
Windows.64=[ "res://addons/steam_api/steam_api64.dll" ]
X11.64=[ "res://addons/steam_api/libsteam_api.so" ]
Server=[ "res://addons/steam_api/libsteam_api.so" ]

I reckon this wouldn't have any implications outside of build time, as it's unlikely a user will be making a server build which needs the Steam API (for now?)

samsface commented 2 years ago

Added the server entries, don't see this error anymore.

samsface commented 2 years ago

@snoopdouglas btw, if you're doing a headless export for steam, I have some docker images for upload to steam if you need it.

snoopdouglas commented 2 years ago

Would be very interested to see those! Looks like d9143f2fbdf9327556969eb98e0d4fae1bbddeb9 dealt with this :+1:

samsface commented 2 years ago

Would be very interested to see those! Looks like d9143f2 dealt with this +1

I'll add them to this project so in next few days :pray:

hiulit commented 1 year ago

Hi there!

I've stumbled upon this issue because I'm using a macOS headless binary and I'm getting this error:

ERROR: No nativescript_init in "res://addons/steam_api/libsteamsdk-godot.so" found

I've just changed the Server's entry and dependencies to use the OSX.64 ones and it works just fine, but I was wondering if there could be a way to be able to select between Linux/macOS instead of changing it manually? Maybe from a dropdown in the plugin's tab? Or maybe just a heads up on the docs?

Thanks!