PUN 1.66 ExecuteRpc bug

Options

Exception:
NullReferenceException: Object reference not set to an instance of an object
NetworkingPeer.LogObjectArray (System.Object[] data) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3624)
NetworkingPeer.ExecuteRpc (System.Object[] rpcData, .PhotonPlayer sender) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2160)
NetworkingPeer.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1976)

Code:
protected internal void ExecuteRpc(object[] rpcData, PhotonPlayer sender)
{
if (rpcData == null)
{
Debug.LogError("Malformed RPC; this should never occur. Content: " + LogObjectArray(rpcData));
return;
}

Here rpcData is already null so it cannot be logged :smile:

Comments

  • vadim
    Options
    Good catch :)
    Do you use Photon Cloud or Server? We had similar report when clients of different PUN versions connected to the same room (this is possible only with Photon Server if PUN code is not modified)
  • luxel
    Options
    We use Photon server. The reason this error being triggered when different PUN versions connecting to the same room is - the RPC in latest PUN is not backwards compatible with earlier versions (as stated in the changelog). As a workaround, we modified PUN to use the same data structure as earlier versions.
  • Tobias
    Options
    I'm late but would like to add some input:

    It's a known limitation of the Server SDK, that it doesn't offer the "Virtual Applications" like the cloud does, so the "Game Version" value is being ignored here.

    As workaround:
    You could separate players in different lobbies, if you only use server side matchmaking. If you have invites or use FindFriend, then you can't use this trick.
    You can also "force" every client to update or use different server instances for different versions.

    I will talk to the colleagues and figure out what we can do on the server side. The only thing keeping us from releasing the Virtual Applications solution is, that it's way more complicated to work with (server side).