How Often does OnStatusUpdate get called?

basicly im working with Photon Chat & Playfab. i got the whole add friends thing and such, Im wondering When does the Status Update get called? everytime a chat user status changes? or every 5 seconds? im wondering cause i need to know what to set a player status's When A player opens Up the friend menu.



Another thing that may be useful is to Call a GetFriendStatus Function. that would be really useful and if there is i dont yet know about it.

-cyro

Best Answers

  • Nerfski
    Nerfski
    Accepted Answer
    JohnTube wrote: »
    I'm not sure but could you test that adding friends (chatClient.AddFriends) does not trigger an 'initial' OnStatusUpdate per friend?

    i did a bit of testing and found that whenever you add a friend and that friend's status changes it does get their status. thank you for answering my question because i can use this as the GetFriendStatus method.

    -cyro

Answers

  • Nerfski
    Nerfski
    Accepted Answer
    JohnTube wrote: »
    I'm not sure but could you test that adding friends (chatClient.AddFriends) does not trigger an 'initial' OnStatusUpdate per friend?

    i did a bit of testing and found that whenever you add a friend and that friend's status changes it does get their status. thank you for answering my question because i can use this as the GetFriendStatus method.

    -cyro
  • steamcore
    steamcore ✭✭
    edited August 10
    JohnTube wrote: »
    I'm not sure but could you test that adding friends (chatClient.AddFriends) does not trigger an 'initial' OnStatusUpdate per friend?

    I am not getting an initial status update on a friend after calling AddFriends. I need this to check if a user is offline before performing other game logic. I am testing this with a variety of friends, online and offline, editor and standalone build. I have tried implicitly and explicitly implementing the OnStatusUpdate callback from IChatClientListener. Nothing comes back, ever.
    public string FriendToAdd;
    
    public static void AddFriend()
        {
            var friend = new string[1] { FriendToAdd };
            _client.AddFriends(friend);
        }
    
    public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
        {
            Debug.Log(string.Format("OnStatusUpdate:\r\nUser:{0}, Status:{1}, Msg:{2}, Message:{3}", user, status, gotMessage, message));
        }
    
  • Hi @steamcore,

    I have replied here.