Open jsmars opened 2 years ago
Have you found any workarounds for this problem?
Sadly not yet. Our main need for upgrading at the moment however was to get access to the IsSteamRunningOnSteamDeck()
, and after some correspondence with valve, we opted for a workaround there to make our own function for that, as it under the hood currently simply checks for the environment variable "SteamDeck" is greater than 0. Important note though, this is not completely future proof as they may change the implementation of that in the future.
I haven't had time to look into this yet unfortunately.
Just to confirm @jsmars, was IsSteamRunningOnSteamDeck() working for you while this crash was occuring? I ask because my initial thoughts were possibly a DLL version mismatch, like old DLL's stuck around from pre-upgrading especially if you upgraded from 15.0.0 or older.
I'm pretty sure I cleared up the old dirs and cleared all temp files, but not sure where any old DLL's might be hanging around?
Steam can initialize though, and IsRunningOnSteamDeck() does return a value, so everything else we are using seems to be working up until the point we try to create a server, it's when an actual server is started and those lines of code are run that unity itself hard crashed (or the build game exe).
Thanks, will be able to look into this tomorrow!
Small addition to this. For steam socket networking options, it is better to set these option on creating connection rather than calling SteamNetworkingUtils.SetConfigValue
later as quoted from Steam DOC
If you need to set any initial config options, pass them here. See SteamNetworkingConfigValue_t for more about why this is preferable to setting the options "immediately" after creation.
In a few places we need to set configuration options on listen sockets and connections, and have them take effect before the listen socket or connection really starts doing anything. Creating the object and then setting the options "immediately" after creation doesn't work completely, because network packets could be received between the time the object is created and when the options are applied. To set options at creation time in a reliable way, they must be passed to the creation function. This structure is used to pass those options.
in network connection creation, last 2 arguments.
Let SteamNetworkingConfigValue_t[] options
Client - SteamNetworkingSockets.ConnectP2P( networkIdentity, virtualPort, options.Length, options )
Server - SteamNetworkingSockets.CreateListenSocketP2P( virtualPort, options.Length, options )
k_ESteamNetworkingConfig_SendBufferSize
This one is associate to k_EResultLimitExceeded
error which happen when too much data to push to network and famously on Valhiem community.
List<SteamNetworkingConfigValue_t> options = new List<SteamNetworkingConfigValue_t>( );
SteamNetworkingConfigValue_t queueSize = new SteamNetworkingConfigValue_t( );
queueSize.m_eValue = ESteamNetworkingConfigValue.k_ESteamNetworkingConfig_SendBufferSize;
queueSize.m_eDataType = ESteamNetworkingConfigDataType.k_ESteamNetworkingConfig_Int32;
queueSize.m_val.m_int32 = 1024 * 1024; // Raise to 1MB queue size
options.Add( queueSize );
Hey @rlabrecque, did you ever get a chance to look into this? This crash also reproduces on my end. The reproduction case is as simple as:
unsafe { float percent = 5f; SteamNetworkingUtils.SetConfigValue( ESteamNetworkingConfigValue.k_ESteamNetworkingConfig_FakePacketLoss_Send, ESteamNetworkingConfigScope.k_ESteamNetworkingConfig_Global, IntPtr.Zero, ESteamNetworkingConfigDataType.k_ESteamNetworkingConfig_Float, new IntPtr(&percent) ); }
Edit: ah, my reproduction case no longer reproduces on 20.2.0, so you may be able to close the issue
We recently updated to the latest Steamworks.NET from 14.0 and are getting a hard unity crash when calling
SteamNetworkingUtils.SetConfigValue()
as such.With the following stack trace from the Editor.log. I've attached the full crash logs. Editor.log error.log
This worked fine before the update. Has anything been changed recently that can be causing this and are there any tips on how to get this working again?
Thanks!