[PUN 2] RPC only working in editor

Hello,

When I test the game inside the editor there is no problems at all with RPCs but when the game is compiled for Standalone Windows, no one of them works.

Here is the logs output:

[Screenshot]
Capture_d_cran_134

edit: I'm currently using 2018.2.5f1

Best regards

Comments

  • Hi @forplayers,

    you can try to refresh the RPC list before building the game. You can do this by navigating to the PhotonServerSettings file and click on the Refresh RPCs button on the Inspector.
  • Hi,

    Thank you for the reply. I just tried your suggestion but it still happens. I even tried to clear and then refresh the rpc list but it's the same.

    But there is something strange. Before, I was able to see the entire list whereas now I can't. Is it a normal behavior of the 2.0 upgrade ?

    [Screenshot]
    Capture_d_cran_135
  • Usually the error occurs, if you don't mark the RPCs with the [PunRPC] attribute. Since you mentioned, that it works well inside the editor but not in the built game, we can skip rechecking this. Can you please check the other warnings that are logged on the screen? It says, that there are missing scripts. I just want to make sure, that it has nothing to do with it.

    If it isn't working afterwards, you can add the following code snippet to a GameObject in the scene of your choice and check what it logs.
    private void Awake()
    {
        Debug.LogError(PhotonNetwork.PhotonServerSettings.RpcList.Count);
    
        foreach (string function in PhotonNetwork.PhotonServerSettings.RpcList)
        {
            Debug.LogError(function);
        }
    }
    Please use it in the Editor as well as in a standalone (development) build.

    But there is something strange. Before, I was able to see the entire list whereas now I can't. Is it a normal behavior of the 2.0 upgrade ?


    I think so, yes.
  • edited October 11
    Ok so I just found the problem. I almost forgot that I was using an obfuscator. I updated it few weeks ago. This obfuscator had the possibility to skip obfuscating methods with the [PunRPC] label but it seems isn't working since the last update.
    I skipped methods obfuscation and it magically worked!

    Thank you for the support
Sign In or Register to comment.