Open snaulX opened 3 years ago
Same issue found here (I do not use Unity):
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK. CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread) RecordSteamInterfaceCreation (PID 3538489): SteamGameServer013 / RecordSteamInterfaceCreation (PID 3538489): SteamUtils009 / Error: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Steamworks.SteamNetworkingSockets.CreateNormalSocket(NetAddress address, ISocketManager intrface)
Using Facepunch.Steamworks.Posix.dll
with .NET 5.0.301 on Ubuntu 20.04.
The same code works well on Windows using Facepunch.Steamworks.Win64.dll
.
Actual code:
SocketManager manager = SteamNetworkingSockets.CreateNormalSocket(host, myServer);
host
can be NetAddress.AnyIp(32680)
but also NetAddress.From("my-server-ip", 32680);
, it does not matter.
The same thing happens if I directly specify the IP address.
I tried splitting it up even more like this:
SocketManager manager = new SocketManager(); manager = SteamNetworkingSockets.CreateNormalSocket(host, myServer);
The error then happens in the line manager = SteamNetworkingSockets.CreateNormalSocket(host, myServer);
.
@snaulX Did you make any progress?
Edit:
I have noticed this also fails:
SteamNetworkingUtils.DebugLevel = NetDebugOutput.Everything;
with a NRE.
Edit2: I figured out that SteamServer.Init
fails, but doesn't return any error. This is what is causing all the other issues.
Edit3: Of course this is because of #543 🤦♂️
I'm working on Windows so I have other reason for this issue. Also all other steam functions working good so it's not about #543
I have a project on Unity using Facepunch.Steamworks. In Start method of server and client script I create
NetAddress address
use one of two cases (when I want to set the address differently, I comment on one part and uncomment the other):or
But when I trying to make server (
server = SteamNetworkingSockets.CreateNormalSocket(address, this);
) or client (client = SteamNetworkingSockets.ConnectNormal(address, this);
) I get NullReferenceException. And when I trying toDebug.Log(address);
Unity was crashing.What can causes this issue and how to fix it?