Structure with string cannot be used as a RPC parameter.
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Structure with string cannot be used as a RPC parameter.
[Deleted User]
2022-01-05 21:14:59
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::
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?
Comments
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
Back to top