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

Build fails for WebGL: The type 'SteamClient' exists in both Win32 and Win64 #735

Open
jan opened this issue Sep 15, 2023 · 2 comments
Open
Assignees

Comments

@jan
Copy link

jan commented Sep 15, 2023

Hey Garry, first: thanks for your work on Facepunch.

I am not sure if it should work for WebGL, but for me it does not:

Describe the bug
A clear and concise description of what the bug is.

Building for WebGL fails with errors like:

The type 'SteamClient' exists in both 'Facepunch.Steamworks.Win32, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

(And same for each other Facepunch class I use.)

To Reproduce
Steps to reproduce the behavior:

  1. Create 3D (URP) Unity project
  2. Extract Facepunch.Steamworks.2.3.2.zip and copy files contained in its Unity folder into Assets/Plugins/Facepunch.Steamworks
  3. Create Empty Object Face Test and assign a new script FaceTest (code see below).
  4. Open Build Settings, switch to WebGL, hit Build & Run.
  5. See error.

Calling Code

using UnityEngine;

public class FaceTest : MonoBehaviour
{
    private void Awake()
    {
        try
        {
            Steamworks.SteamClient.Init(252490);
        }
        catch (System.Exception e)
        {
            Debug.LogError(e);
        }
    }
}

Expected behavior
I'd expect it to build successfully.

Desktop (please complete the following information):

  • OS: MaxOS 12.5
  • Unity: 2022.3.6f1

Additional context
Add any other context about the problem here.

@IndeverGames
Copy link

I'm having the exactly described issue as well. Unity 2021.3.23f1

@shochet
Copy link

shochet commented Apr 23, 2024

I'm also interested in basic webgl support if possible.

You can get around the duplicate library build error above simply by deleting the win32 libraries if you are not worried about that legacy support? But when the webgl window opens it cannot find the correct dll to use at runtime - since likely none are checked for webgl in the import setting meta files. I'm not sure what the right answer is - has anybody gotten the SteamClient.Init to work in webgl?

Perhaps another approach is to call steamworks web apis directly and use openid login if you just need the steam id and friends list and a few simple calls?
https://partner.steamgames.com/doc/webapi_overview

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