diff --git a/MyceliumNetworkingForCW/MyceliumNetwork.cs b/MyceliumNetworkingForCW/MyceliumNetwork.cs index f8e7d9a..9858faf 100644 --- a/MyceliumNetworkingForCW/MyceliumNetwork.cs +++ b/MyceliumNetworkingForCW/MyceliumNetwork.cs @@ -1,6 +1,7 @@ using Steamworks; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; @@ -372,7 +373,7 @@ public static void SetLobbyData(string key, object value) RugLogger.LogWarning($"Accessing lobby data for unregistered key '{key}'. This might not exist."); } - if(!SteamMatchmaking.SetLobbyData(Lobby, key, value.ToString())) + if (!SteamMatchmaking.SetLobbyData(Lobby, key, (string)Convert.ChangeType(value, typeof(string), CultureInfo.InvariantCulture))) { RugLogger.LogError("Error setting lobby data."); } @@ -424,7 +425,7 @@ public static T GetLobbyData(string key) try { - return (T)Convert.ChangeType(value, typeof(T)); + return (T)Convert.ChangeType(value, typeof(T), CultureInfo.InvariantCulture); } catch(Exception ex) { @@ -452,7 +453,7 @@ public static void SetPlayerData(string key, object value) RugLogger.LogWarning($"Accessing player data for unregistered key '{key}'. This might not exist."); } - SteamMatchmaking.SetLobbyMemberData(Lobby, key.ToString(), value.ToString()); + SteamMatchmaking.SetLobbyMemberData(Lobby, key.ToString(), (string)Convert.ChangeType(value, typeof(string), CultureInfo.InvariantCulture)); } /// @@ -503,7 +504,7 @@ public static T GetPlayerData(CSteamID player, string key) { try { - return (T)Convert.ChangeType(value, typeof(T)); + return (T)Convert.ChangeType(value, typeof(T), CultureInfo.InvariantCulture); } catch(Exception ex) { diff --git a/MyceliumNetworkingForCW/MyceliumNetworkingForCW.csproj b/MyceliumNetworkingForCW/MyceliumNetworkingForCW.csproj index 7415551..152bdcf 100644 --- a/MyceliumNetworkingForCW/MyceliumNetworkingForCW.csproj +++ b/MyceliumNetworkingForCW/MyceliumNetworkingForCW.csproj @@ -91,12 +91,12 @@ - - $(ManagedDirectory)Assembly-CSharp.dll - - - $(ManagedDirectory)com.rlabrecque.steamworks.net.dll - + + $(ManagedDirectory)Assembly-CSharp.dll + + + $(ManagedDirectory)com.rlabrecque.steamworks.net.dll +