Open JaySlex opened 3 years ago
I was able to get this property using reflection (which isn't great)...
static SteamId GetSteamId() {
object steamGameServer =
typeof(SteamServer)
.GetProperty(
"Internal", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
.GetValue(null);
return (SteamId) steamGameServer
.GetType()
.GetMethod(
"GetSteamID", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
.Invoke(steamGameServer, null);
}
I was able to get this property using reflection (which isn't great)...
static SteamId GetSteamId() { object steamGameServer = typeof(SteamServer) .GetProperty( "Internal", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) .GetValue(null); return (SteamId) steamGameServer .GetType() .GetMethod( "GetSteamID", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .Invoke(steamGameServer, null); }
I found how to access it directly, update to the last version by compilling it. Not the release
I looked up in the doc and it showed : https://wiki.facepunch.com/steamworks/SteamServer.SteamId, but it doesnt seems to exist.
Add a way to get the server steamId, unless it doesnt exist anymore, but I know it's still used in Steamworks.Net