Removed steam_appid.txt requirement

This commit is contained in:
Garry Newman 2018-01-22 17:19:48 +00:00
parent 1ccea72a13
commit d2331e68e2
20 changed files with 17 additions and 19 deletions

View File

@ -8,7 +8,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class Achievements public class Achievements
{ {
[TestMethod] [TestMethod]

View File

@ -8,7 +8,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class App public class App
{ {
[TestMethod] [TestMethod]

View File

@ -9,7 +9,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public partial class Client public partial class Client
{ {
[TestMethod] [TestMethod]

View File

@ -6,7 +6,6 @@ namespace Facepunch.Steamworks.Test
{ {
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
[TestClass] [TestClass]
public class Friends public class Friends
{ {

View File

@ -7,7 +7,6 @@ namespace Facepunch.Steamworks.Test
{ {
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
[TestClass] [TestClass]
public class Inventory public class Inventory
{ {

View File

@ -9,7 +9,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class Leaderboard public class Leaderboard
{ {
[TestMethod] [TestMethod]

View File

@ -10,7 +10,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem("steam_api.dll")] [DeploymentItem("steam_api.dll")]
[DeploymentItem("steam_api64.dll")] [DeploymentItem("steam_api64.dll")]
[DeploymentItem("steam_appid.txt")]
public class Lobby public class Lobby
{ {
[TestMethod] [TestMethod]

View File

@ -9,7 +9,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public partial class Networking public partial class Networking
{ {
[TestMethod] [TestMethod]

View File

@ -6,7 +6,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class RemoteStorage public class RemoteStorage
{ {
[TestMethod] [TestMethod]

View File

@ -9,7 +9,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class RichPresence public class RichPresence
{ {
[TestMethod] [TestMethod]

View File

@ -5,7 +5,6 @@ namespace Facepunch.Steamworks.Test
{ {
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
[DeploymentItem( "tier0_s.dll" )] [DeploymentItem( "tier0_s.dll" )]
[DeploymentItem( "vstdlib_s.dll" )] [DeploymentItem( "vstdlib_s.dll" )]
[DeploymentItem( "steamclient.dll" )] [DeploymentItem( "steamclient.dll" )]

View File

@ -10,7 +10,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public partial class ServerList public partial class ServerList
{ {
[TestMethod] [TestMethod]

View File

@ -8,7 +8,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class Stats public class Stats
{ {
[TestMethod] [TestMethod]

View File

@ -7,7 +7,6 @@ namespace Facepunch.Steamworks.Test
{ {
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
[TestClass] [TestClass]
public class Voice public class Voice
{ {

View File

@ -9,7 +9,6 @@ namespace Facepunch.Steamworks.Test
[TestClass] [TestClass]
[DeploymentItem( "steam_api.dll" )] [DeploymentItem( "steam_api.dll" )]
[DeploymentItem( "steam_api64.dll" )] [DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_appid.txt" )]
public class WorkshopTest public class WorkshopTest
{ {
[TestMethod] [TestMethod]

View File

@ -1 +0,0 @@
252490

View File

@ -26,6 +26,18 @@ public class BaseSteamworks : IDisposable
private List<SteamNative.CallbackHandle> CallbackHandles = new List<SteamNative.CallbackHandle>(); private List<SteamNative.CallbackHandle> CallbackHandles = new List<SteamNative.CallbackHandle>();
protected BaseSteamworks( uint appId )
{
AppId = appId;
//
// No need for the "steam_appid.txt" file any more
//
System.Environment.SetEnvironmentVariable("SteamAppId", AppId.ToString());
System.Environment.SetEnvironmentVariable("SteamGameId", AppId.ToString());
}
public virtual void Dispose() public virtual void Dispose()
{ {
foreach ( var h in CallbackHandles ) foreach ( var h in CallbackHandles )
@ -57,6 +69,9 @@ public virtual void Dispose()
native.Dispose(); native.Dispose();
native = null; native = null;
} }
System.Environment.SetEnvironmentVariable("SteamAppId", null );
System.Environment.SetEnvironmentVariable("SteamGameId", null );
} }
protected void SetupCommonInterfaces() protected void SetupCommonInterfaces()

View File

@ -63,7 +63,7 @@ public partial class Client : BaseSteamworks
public User User { get; private set; } public User User { get; private set; }
public RemoteStorage RemoteStorage { get; private set; } public RemoteStorage RemoteStorage { get; private set; }
public Client( uint appId ) public Client( uint appId ) : base( appId )
{ {
if ( Instance != null ) if ( Instance != null )
{ {

View File

@ -24,7 +24,7 @@ public partial class Server : BaseSteamworks
/// <summary> /// <summary>
/// Initialize a Steam Server instance /// Initialize a Steam Server instance
/// </summary> /// </summary>
public Server( uint appId, ServerInit init ) public Server( uint appId, ServerInit init) : base( appId )
{ {
if ( Instance != null ) if ( Instance != null )
{ {