-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Steamworks SDK #595
base: develop
Are you sure you want to change the base?
Add Steamworks SDK #595
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ | |
using Microsoft.Xna.Framework.Graphics; | ||
using DTAConfig; | ||
using System.Collections.Generic; | ||
using SteamworksSharp.Native; | ||
using SteamworksSharp; | ||
|
||
namespace DTAClient | ||
{ | ||
|
@@ -62,7 +64,7 @@ | |
thread.Start(); | ||
} | ||
|
||
GenerateOnlineIdAsync(); | ||
Check warning on line 67 in DXMainClient/Startup.cs
|
||
|
||
#if ARES | ||
Task.Factory.StartNew(() => PruneFiles(SafePath.GetDirectory(ProgramConstants.GamePath, "debug"), DateTime.Now.AddDays(-7))); | ||
|
@@ -153,6 +155,25 @@ | |
fhc.CalculateHashes(); | ||
} | ||
#endif | ||
// Load native steam binaries. | ||
SteamNative.Initialize(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, does the Steam SDK work (or at least doesn't crash the client) in Linux? It's better to test it. If not (I don't know whether it works or not), an if statement should be introduced to skip the Steam API if the OS is not Windows. |
||
|
||
if (SteamApi.IsSteamRunning()) | ||
{ | ||
// Provide appId so it automatically creates a "steam_appid.txt" file. | ||
if (SteamApi.Initialize(ClientConfiguration.Instance.SteamGameId)) | ||
{ | ||
Logger.Log($"Logged in as: {SteamApi.SteamFriends.GetPersonaName()}"); | ||
} | ||
else | ||
{ | ||
Logger.Log("SteamApi failed to initialize."); | ||
} | ||
} | ||
else | ||
{ | ||
Logger.Log("Steam is not running."); | ||
} | ||
|
||
gameClass.Run(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
<PackageVersion Include="Rampastring.XNAUI.UniversalGL.Debug" Version="$(RampastringXNAUIVersion)" /> | ||
<PackageVersion Include="Rampastring.XNAUI.WindowsXNA.Debug" Version="$(RampastringXNAUIVersion)" /> | ||
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.9" /> | ||
<PackageVersion Include="SteamworksSharp" Version="1.0.8" /> | ||
<PackageVersion Include="SteamworksSharp.Native" Version="1.0.8" /> | ||
<PackageVersion Include="SteamworksSharp.Native.Windows_x64" Version="1.0.8" /> | ||
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhh I don't think we should be using this. This is a pretty random wrapper wrote by a random person 6 years ago. For a 1:1 Steamworks mappings use |
||
<PackageVersion Include="System.DirectoryServices" Version="$(DotnetLibrariesVersion)" /> | ||
<PackageVersion Include="System.Management" Version="$(DotnetLibrariesVersion)" /> | ||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="$(DotnetLibrariesVersion)" /> | ||
|
@@ -51,7 +54,6 @@ | |
<!-- and -p:Engine=WindowsDX -f net48 --> | ||
<PackageReference Include="NETStandard.Library" /> | ||
<PackageVersion Include="NETStandard.Library" Version="2.0.3" /> | ||
|
||
<PackageReference Include="System.IO.FileSystem" /> | ||
<PackageVersion Include="System.IO.FileSystem" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be configured to the default value of YR one explicitly. you should check if it's a YR or Ares config via ifdef and use that as default, elif TS - use Steam TS one, else assign a missing ID value (idk if 0 is correct for Steam?) and check before even initializing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? It's not hard to change the default value for something sane based on the build config, and I don't think having am ability for people change steam app ID is something that should be exposed a lot. Besides, there are only two such games that are on Steam and are supported by the client - TS and YR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Steam Game Identityficator can be set from
ClientDefinitions.ini
? Is there possible situation when modder publish its mod in the Steam as the standalone game? If not -- better to hardcode YR and TS Steam IDs as Kerbiter said.In addition to the above, i believe a button to enable/disable feature (like DRP) is needed.