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

STEAMWORKS_NET compiler symbol added for Android target #656

Open
WildRikku opened this issue Nov 26, 2024 · 3 comments
Open

STEAMWORKS_NET compiler symbol added for Android target #656

WildRikku opened this issue Nov 26, 2024 · 3 comments

Comments

@WildRikku
Copy link

As some others, I also had some issues building a project for Android. I added DISABLESTEAMWORKS to the player's compiler symbols for the Android target and used that to exclude all Steamworks code and it worked. However, I noticed the STEAMWORKS_NET compiler symbol was automatically added to the player for the Android target, which I guess is wrong, because the framework does not support Android (as can be seen in the example SteamManager).

@sandolkakos
Copy link

sandolkakos commented Nov 27, 2024

hey @WildRikku, today I got the same problem and decided to create a Pull Request (#660) with my solution.
While it is not merged into master branch, you can use my commit on your Packages/manifest.json:

"com.rlabrecque.steamworks.net": "https://github.com/sandolkakos/Steamworks.NET.git?path=/com.rlabrecque.steamworks.net#ef0b146ce50b353c60ffcde17175bcecb09c2391",

After setting it, you have to restart Unity (do not select Safe Mode when it is opening), and the STEAMWORKS_NET will automatically be removed. Or just remove it manually.

@rlabrecque
Copy link
Owner

cc: @JamesMcGhee, does all of your stuff work with #660 still?

@JamesMcGhee
Copy link
Contributor

JamesMcGhee commented Nov 29, 2024

It shouldn't be an issue our toolkit isn't dependent on that definition anymore we use our own methods of checking for Steamworks.NET being present or not and also have a tool to help them import your package via UPM from the editor ... if they want.

As to compilation all of our code is wrapped just like your own with DISABLESTEAMWORKS but uses Version Defines to establish STEAMWORKSNET in our assemblies only and only if Steamworks.NET is present
image

for example

#if !DISABLESTEAMWORKS && STEAMWORKSNET
//... our code
#endif

This means our code will not compile at all if Steamworks.NET is not installed via UPM or if they or your code defines DISABLESTEMWORKS

The original use/need/requirement for that STEAMWORKS_NET define was to help Mirror and similar who where using the Player Script Defines and to my knowledge still do

This would only affect their "FizzySteamworks" similar Steam-related transports

I took a quick peek at there transport for Steamworks and they dont seem to use STEAMWORKS_NET anymore either, they are still using DISABLESTEAMWORKS

https://github.com/Chykary/FizzySteamworks

I didn't dig deep just a quick glance

As to the usage of STEAMWORKS_NET and the OP
Its not wrong, STEAMWORKS_NET originally indicated that the Steamworks.NET package was installed ... that's it ... not that it was enabled, or compiled, or in use ... just that it was present. This was needed by other tools or more accurately integrations between other tools and Steamworks.NET so they could know at compile time if Steamworks.NET was in the project ... didn't really have anything to do with rather or not you where using Steamworks.NET

DISABLESTEAMWORKS was used to detect if it was enabled ... or rather disabled

and then there are checks for the Client or GameServer end points if you need to check if it initialized or our toolkit has a simple boolean you can check.

Anyway ... OPs original statement misunderstands the use of STEAMWORKS_NET I think in that it doesn't indicate that Steamworks.NET is in use ... only that its present in the project

The DISABLESTEAMWORKS doesn't remove it from the project it simply causes it to not compile, Unity will or should strip it at that point as its just an empty assembly then ... long way of saying its not really an issue just confusing to the human eye

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

No branches or pull requests

4 participants