Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

[help] CS0121 errors when importing Dissonance For Dark Rift 2 #187

Closed Dymstro closed 4 years ago

Dymstro commented 4 years ago

Context

When trying to load Dissonance For Dark Rift 2, unity fails to compile multiple scripts. Below is a screenshot with the errors unity throws out

Expected Behavior

The scripts successfully compile

Actual Behavior

The scripts do not successfully compile

First error: Assets/Plugins/Dissonance/Core/Extensions/ArraySegmentExtensions.cs(52,21): error CS0121: The call is ambiguous between the following methods or properties: 'Dissonance.Extensions.ArraySegmentExtensions.CopyTo<T>(System.ArraySegment<T>, T[], int)' and 'Dissonance.Extensions.ArraySegmentExtensions.CopyTo<T>(System.ArraySegment<T>, T[], int)'

Steps to Reproduce

  1. Import Dark RIft Networking 2 Free
  2. Import Dissonance
  3. Import Dissonance For Dark Rift 2

Your Environment

Include as many relevant details about the environment you experienced the bug in

unity

martindevans commented 4 years ago

This can happen if Unity attempts to load the server side plugin for Dark Rift into the editor - because the plugin contains a copy of some Dissonance code the compiler it then confused which version of Dissonance it should be using! The plugins should not be loaded into the editor, but sometimes the asset store install process does not correctly install the plugins.

If you move Assets/Dissonance/Integrations/DarkRift2/ServerPlugins out of your project (make sure the editor is closed when you do this) it should fix this issue.

Dymstro commented 4 years ago

Thanks for the quick reply, moving the ServerPlugins folder fixed the issue. Now I'm getting a different error: Assets/Dissonance/Integrations/DarkRift2/Demo/StateManager.cs(72,108): error CS1061: 'UnityClient' does not contain a definition for 'IPVersion' and no accessible extension method 'IPVersion' accepting a first argument of type 'UnityClient' could be found (are you missing a using directive or an assembly reference?)

martindevans commented 4 years ago

I've just checked with Jamster (the Dark Rift 2 developer), it looks like the IPVersion parameter has been removed from that method call and we haven't updated the integration package yet. Sorry about that. I'll update the DarkRift2 integration tomorrow to the latest version of the asset tomorrow.

You should just able to delete the IPVersion parameter from that method to fix it for yourself, so it will change from:

 client.ConnectInBackground(IPAddress.Parse(_serverIp), ushort.Parse(_port), client.IPVersion, next.Callback);

To:

 client.ConnectInBackground(IPAddress.Parse(_serverIp), ushort.Parse(_port), next.Callback);
Dymstro commented 4 years ago

Just removing the IPVersion parameter didn't work, so i looked into the documentation for Dark Rift 2 and saw that it wanted a boolean for noDelay so I filled in true and it worked

martindevans commented 4 years ago

I've just submitted an update to the asset store which fixes this. It should be live in a day or two once Unity have reviewed it.

martindevans commented 4 years ago

This version is now live on the asset store. I'll close this issue now but please don't hesitate to re-open it if it's still an issue.