Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

GrantBartlett
Copy link
Member

@GrantBartlett GrantBartlett commented Dec 30, 2024

Registers the game as playing on steam.

Configurable inside ClientDefs, SteamGameId=2229850

Notes:

Screenshots

image
image
image

Copy link

github-actions bot commented Dec 30, 2024

Nightly build for this pull request:

@@ -184,6 +184,8 @@ public void RefreshSettings()

public string LocalGame => clientDefinitionsIni.GetStringValue(SETTINGS, "LocalGame", "DTA");

public int SteamGameId => clientDefinitionsIni.GetIntValue(SETTINGS, "SteamGameId", 2229850);
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
What about this instead

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this instead

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.

@Metadorius
Copy link
Member

@MahBoiDeveloper please review where the docs for that should be put, if any at all?

@@ -153,6 +155,25 @@ public void Execute()
fhc.CalculateHashes();
}
#endif
// Load native steam binaries.
SteamNative.Initialize();
Copy link
Member

Choose a reason for hiding this comment

The 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.

Comment on lines +28 to +30
<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" />
Copy link
Member

@Metadorius Metadorius Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

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 Steamworks.NET. For a preoprly C# one I think Facepunch.Steamworks should be used (based on some quick reading up I would pick that, even if it's a bit outdated). Please research this question a bit more, maybe there are other better alternatives.

@MahBoiDeveloper
Copy link
Contributor

@MahBoiDeveloper please review where the docs for that should be put, if any at all?

It is not so complex feature like Discord Rich Presence, and documentation doesn't need for that, i suppose.

@SadPencil
Copy link
Member

Ah wait. The common DLL list

Copy link
Member

@SadPencil SadPencil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the common DLL list since new DLLs are introduced. #605

@Saint146
Copy link
Contributor

With this players can do "complete" cncnet steam integration, if they set a launch option in game's steam properties to something like this:
"C:\Program Files\steam\steamapps\common\Command & Conquer Red Alert II\CnCNetYRLauncher.exe" %command%
(obviously changing the path according to proper game and wherever they have it installed)

Maybe it can be useful to add this info to the website? For instance, to the guides https://cncnet.org/yuris-revenge/how-to-play, https://cncnet.org/red-alert-2/how-to-play, https://cncnet.org/tiberian-sun/how-to-play

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants