Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

[help] Custom Integration Network Editor #261

Closed HaleyMueller closed 1 year ago

HaleyMueller commented 1 year ago

Context

I am having this error when I am creating the NetworkEditor from the github docs page:

Assets\Dissonance\CustomCommsNetworkEditor.cs(8,14): error CS0311: The type 'CustomCommsNetwork' cannot be used as type parameter 'TComms' in the generic type or method 'BaseDissonnanceCommsNetworkEditor<TComms, TServer, TClient, TPeer, TClientParam, TServerParam>'. There is no implicit reference conversion from 'CustomCommsNetwork' to 'Dissonance.Networking.BaseCommsNetwork<CustomServer, CustomClient, CustomPeer, CustomClientParam, CustomServerParam>'.
TComms is kicking my butt.

Here is my code:

[CustomEditor(typeof(CustomCommsNetwork))]
public class CustomCommsNetworkEditor
    : BaseDissonnanceCommsNetworkEditor<
        CustomCommsNetwork,
        CustomServer,
        CustomClient,
        CustomPeer,
        CustomClientParam,
        CustomServerParam
    >
{
}

public class CustomCommsNetwork : BaseCommsNetwork<CustomServer, CustomClient, CustomPeer, CustomServerParam, CustomClientParam>

Dissonance version used**: v8.2.1

martindevans commented 1 year ago

It looks like you have some of the parameters in the wrong order.

BaseCommsNetwork takes <TServer, TClient, TPeer, TClientParam, TServerParam> but you have got <CustomServer, CustomClient, CustomPeer, CustomServerParam, CustomClientParam>. i.e. your CustomServerParam and CustomClientParam are backwards in your BaseCommsNetwork.

You've specified them in the correct order in the editor so it doesn't match up and you get this error.

HaleyMueller commented 1 year ago

Thanks! That was it!