Room Properties limitations, matchmaking fails.

tonualtonual
edited December 2020 in DotNet
When I use OpSetCustomPropertiesOfRoom with a Hashtable elements count greater then ~1800,
and try to read the property at OnEvent (case EventCode.PropertiesChanged),
the Hashtable entry Key is ok, but the Value equals "False".

However, when I decrease the Hashtable elements to be less than ~1600, the problem does not occur.

For some reason, it occurs for the property Key that was already set (property 253 and property 254 when comes to order) and when the problem occurs, the matchmaking (number of players filter only) fails.

The total size of room properties (1800 properties) content is ~200Kb.

I use the "Free" Photon Engine tier.
I also noticed this problem did not occur eg. in May 2020.

Is this a kind of undocumented limitation I need to obey?

Comments

  • JohnTubeJohnTube mod
    edited December 2020
    Hi @tonual,

    Thank you for choosing Photon!

    We may have added some limits for operations in general and SetProperties in particular to protect games from hackers and some types of attacks.
    I'm not sure if these new limits are live yet.

    how often do you call SetCustomProperties with that number of properties?
    why do you need as many?

    Do you see any errors in the log?
    Maybe implement LoadBalancingClient.OpResponseReceived event and check OperationCode.SetProperties when ReturnCode != OK.

    253 and 254 are byte keys for well known room properties: IsOpen and IsVisible.
    So if the values are false and you did not set this explicitly then maybe the server is closing and hiding the room explicitly as a protection mechanism against what is considered data flood.

    My colleague @chvetsov may know more and confirm if this case is about our new limits or not.
    Or you could send an email to [email protected] with your AppId + Region + AppVersion and more details (link to this forum discussion).
  • tonualtonual
    edited December 2020
    Thank you for your answer!

    how often do you call SetCustomProperties with that number of properties?

    I only set it once meaning - I set ~1600-1800 properties in a single ForEach loop when all players joined the room and the game is about to start.

    why do you need as many?

    This is due to game design. Core game online gameplay is heavily based on "expectedProperties" feature. Surprisingly it works very well! Each property is about ~40bytes and represents a state of game map single "cell". At a game start, I am initializing the whole map using SetCustomProperties.

    Do you see any errors in the log?

    no errors

    For now, I am going to basically not exceed this limitation I encountered. I won't hesitate to reach you via mail in case limitation will be a problem for me.

    P.S :) PhotonEngine is great. Keep up the good work!
  • Hi @tonual,

    Thanks for the update and kind words.

    If there are no errors, try to implement ErrorInfo event (via its own callback interface or EventCode.ErrorInfo in OnEvent callback) to see if it's triggered when the limit is exceeded before closing the room.
    Not sure if this is actually happening, @chvetsov may confirm when he's available.
  • tonualtonual
    edited December 2020
    Again, thank you for pinpointing the problem. The error code is about the cache limit exceeded as stated in docs. Unfortunately, matchmaking fails when it occurs. I will try to maybe decrease the frequency of update operation at that stage and introduce some delay while feeding the room properties at the game start.


    (251) Sent by Photon Cloud when a plugin-call or webhook-call failed or events cache limit exceeded. Usually, the execution on the server continues, despite the issue. Contains: ParameterCode.Info.


    ErrorInfo and Stack trace:
    {"Code":251,"SenderKey":254,"CustomDataKey":245}
    UnityEngine.Debug:LogError(Object)
    Assets.Scripts.Networking.CCPhotonClient:OnEvent(EventData) (at Assets/Scripts/PhotonClient.cs:95)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:659)
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/EnetPeer.cs:575)
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PhotonPeer.cs:1829)
    ExitGames.Client.Photon.PhotonPeer:Service() (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PhotonPeer.cs:1743)
    Photon.Realtime.LoadBalancingClient:Service() (at Assets/Scripts/PhotonLoadbalancingApi/LoadBalancingClient.cs:1272)
    Assets.Scripts.Controller:Update() (at Assets/Scripts/Controller.cs:169)
    
  • The XML documentation may be a bit outdated or incomplete.
    if you don't use SupportLogger or implement IErrorInfoCallback or then you could extract the error info string from EventData in OnEvent callback like this:
    string errorInfoString = eventData[ParameterCode.Info]; // log it
    
    or make use of ErrorInfo class:
    ErrorInfo errorInfo = new ErrorInfo(eventData);
    string errorInfoString = errorInfo.Info; // log it
    
  • tonualtonual
    edited December 2020
    ErrorInfo says:

    "Room closed because of exceeding properties size limit"


    Ok, thank you very much for helping me find the exact cause.
    The room properties size limit seems to be ~200Kb.
Sign In or Register to comment.