Structure with string cannot be used as a RPC parameter.

Hi,


I tried to use a struct as a parameter for my RPC:

public struct TestStruct : INetworkStruct
{
    [Capacity(32)]
    public string Text { get; set; }
}

And then:

[Rpc(RpcSources.All, RpcTargets.All)]
public void RPC_Test1(TestStruct message, RpcInfo info = default)

But I cannot compile it - with an errors:

Fusion.CodeGen.ILWeaverException: Failed to get word count of field System.String TestStruct::<Text>k__BackingField

and

(0,0): error ---> Fusion.CodeGen.ILWeaverException: Reference type System.String is not supported

Is using a string in a RPC struct supported? Or is it a bug?

Answers

  • Hi,


    As described by the error, Strings are not yet supported in this scenario.

    We will probably include support for more types as the development advance, always try to be at the latest SDK version to get all updates.


    --

    Ramon Melo

    Photon Fusion Team