PhotonRealtime internal exception after upgrading PUN2 from 2.17 to 2.18

Hi,
I just upgraded PUN2 in a Unity 2019.3.7f1 project from 2.17 to 2.18. The code works fine with the old version, but
raising an event like this:
byte eventCode;
int id;
MyEnum e;
object o; //o actually being a string with 95 characters
RaiseEventOptions options = new RaiseEventOptions
{
       CachingOption = EventCaching.AddToRoomCacheGlobal,
       Receivers = ReceiverGroup.Others
 };
SendOptions so = new SendOptions
{
      DeliveryMode = DeliveryMode.Reliable
};

PhotonNetwork.RaiseEvent(eventCode, new[] {id, e, o}, options, so);
now throws the following exception:
ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: s
System.Text.UTF8Encoding.GetBytes (System.String s, System.Int32 charIndex, System.Int32 charCount, System.Byte[] bytes, System.Int32 byteIndex) (at <437ba245d8404784b9fbab9b439ac908>:0)
ExitGames.Client.Photon.Protocol18.WriteString (ExitGames.Client.Photon.StreamBuffer stream, System.String value, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.WriteObjectArray (ExitGames.Client.Photon.StreamBuffer stream, System.Collections.IList array, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, ExitGames.Client.Photon.Protocol18+GpType gpType, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.Write (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.WriteParameterTable (ExitGames.Client.Photon.StreamBuffer stream, System.Collections.Generic.Dictionary`2[TKey,TValue] parameters) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.Protocol18.SerializeOperationRequest (ExitGames.Client.Photon.StreamBuffer stream, System.Byte operationCode, System.Collections.Generic.Dictionary`2[TKey,TValue] parameters, System.Boolean setType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.TPeer.SerializeOperationToMessage (System.Byte opCode, System.Collections.Generic.Dictionary`2[TKey,TValue] parameters, ExitGames.Client.Photon.EgMessageType messageType, System.Boolean encrypt) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.TPeer.EnqueueOperation (System.Collections.Generic.Dictionary`2[TKey,TValue] parameters, System.Byte opCode, ExitGames.Client.Photon.SendOptions sendParams, ExitGames.Client.Photon.EgMessageType messageType) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
ExitGames.Client.Photon.PhotonPeer.SendOperation (System.Byte operationCode, System.Collections.Generic.Dictionary`2[TKey,TValue] operationParameters, ExitGames.Client.Photon.SendOptions sendOptions) (at <396d6bd0fb9c405cb8db77d44dc7705c>:0)
Photon.Realtime.LoadBalancingPeer.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) (at Assets/Photon/PhotonRealtime/Code/LoadbalancingPeer.cs:958)
Photon.Realtime.LoadBalancingClient.OpRaiseEvent (System.Byte eventCode, System.Object customEventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1936)
Photon.Pun.PhotonNetwork.RaiseEvent (System.Byte eventCode, System.Object eventContent, Photon.Realtime.RaiseEventOptions raiseEventOptions, ExitGames.Client.Photon.SendOptions sendOptions) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2199)

Comments

  • Hi @Lightbringer,

    Thank you for choosing Photon!

    Update to 2.18.1.
    Thank you for your understanding and sorry for the inconvenience!
Sign In or Register to comment.