CareBoo / unity-algorand-sdk

An Algorand SDK for Unity. Use the Algorand blockchain in your video game.
MIT License
31 stars 15 forks source link

The call is ambiguous between the following methods or properties: WebSocketSharp.Ext #229

Closed Fraccas closed 3 months ago

Fraccas commented 3 months ago

Hello, I'm getting around 700 warnings and 64 errors regarding ambiguous calls from files from within Assets\AlgoSdk\Runtime\websocket-sharp\websocket-sharp\websocket-sharp\ upon importing this package into a Unity project.

Error Example:

Assets\AlgoSdk\Runtime\websocket-sharp\websocket-sharp\websocket-sharp\Server\WebSocketServer.cs(1495,19): error CS0121: The call is ambiguous between the following methods or properties: 'WebSocketSharp.Ext.IsNullOrEmpty(string)' and 'WebSocketSharp.Ext.IsNullOrEmpty(string)'

Warning Example:

Assets\AlgoSdk\Runtime\websocket-sharp\websocket-sharp\websocket-sharp\Server\WebSocketServer.cs(1490,19): warning CS0436: The type 'CloseStatusCode' in 'C:\Users\dalto\Up Battle Royale\Assets/AlgoSdk/Runtime/websocket-sharp/websocket-sharp/CloseStatusCode.cs' conflicts with the imported type 'CloseStatusCode' in 'websocket-sharp, Version=1.0.2.18559, Culture=neutral, PublicKeyToken=5660b08a1845a91e'. Using the type defined in 'C:\Users\dalto\Up Battle Royale\Assets/AlgoSdk/Runtime/websocket-sharp/websocket-sharp/CloseStatusCode.cs'.

It appears that websocket-sharp.dll in also exists in project under Assets/Photon/PhotonLibs/WebSocket/websocket-sharp.dlland Packages/com.unity.services.wire/Plugins/websocket-sharp.dll.

image

What is the best way to resolve this issue?

Fraccas commented 3 months ago

The issue seems to have been resolved by updating the two websocket-sharp.asmdef files.

Enable: Allow 'unsafe' Code Auto Referenced Override References

The two websocket-sharp.asmdef files are located: Assets/AlgoSdk/Runtime/CareBoo.AlgoSdk.WebSocket/CareBoo.AlgoSdk.WebSocket.asmdef Assets/AlgoSdk/Runtime/websocket-sharp/websocket-sharp.asmdef

image