Wait for state JoinedLobby or ConnectedToMaster and their callbacks before calling operations.

I am getting this on client side:
"Operation 253 could not be executed (yet). Wait for state JoinedLobby or ConnectedToMaster and their callbacks before calling operations. WebRPCs need a server-side configuration. Enum OperationCode helps identify the operation."
And if we talk about getting state joinedLobby or ConnectedTomaster. I am getting state of ConnectedToMaster but didn't get their callbacks.

second things is :
How do I recongnize that joining is finished because I am raising event after getting state of joined and OnJoinedRoom Callback.

Answers

  • As I check the server side code and find that joinstate goes to complete until it published all cacheevents. If you can help me to identifiy which event is cache even or which event is direct coming from other client. It wil be really helpful.
  • @JohnTube ,
    Hi John,
    Can you have look into this. Let me know best possible solution.
  • JohnTubeJohnTube mod
    edited February 1
    Hi @ashishhellotech7,

    First of all, we will need to fix the error message as it's misleading here.
    Operation 253 is RaiseEvent, in this case, you don't need to wait for JoinedLobby or ConnectedToMaster callbacks but instead OnJoinedRoom one.

    As my colleague @chvetsov mentioned in the other discussion, you are probably trying to call RaiseEvent too soon, before ALL server cached events are sent.
    So this could mean that you have cached too many or cached some big messages which led to the server taking too long to send them.

    There is no notification from the server to the client to when ALL cached events have been sent by the server. So what the server does:

    1. returns operation response for the join request to the joining client
    2. sends a join event to the joining client. at this point, the OnJoinedRoom client callback is triggered
    3. sends the cached events if any to the joining client

    What you could do:

    1. Have your own way to identify that none or all cached events have been received. Some cached events (or events that are sent by the server only) will have ActorNumber set to 0, this could be a hint. Or add some sequence number or signature or identification to the event data to know if it's old or new.
    2. After OnJoinedRoom is triggered, add a backoff timer to wait for some time before calling RaiseEvent.
Sign In or Register to comment.