Accessing RemoveActor() reason Client-side

Options
Hey not sure if this is best for here or the client forum but will ask here first.

If I call RemoveActor(int actorNr, string reasonDetail) in server logic from within my custom Photon Plugin, how do I access the reasonDetail string client-side from within a PUN client?

I'm trying to tell the difference between disconnects caused by networking errors and ones caused by my own server logic and ideally would check against that string.

Currently an ExceptionOnReceive disconnect is being triggered but I can't see any way of accessing that disconnect reason string.

Thanks!

Comments

  • chvetsov
    Options
    hi, @ToddRivers

    your question is in right place.

    the reason you provide during removing is rather for your plugin, so that you will see it during OnLeave call. if you want to disconnect peer with some message just send some event to peer and schedule disconnect for it. During handling of event on the client you may visualize reason and should disconnect client. in any case, after some time server will force client to disconnect

    best,
    ilya
  • Ah ok thanks, I was expecting to be able to trigger a disconnect with the DisconnectByServerLogic cause picked up on the Client but fair enough - I will send a new event out.

    By the way kicking out all Actors is the correct way to close a Room right?
    Or is there some other manual way of closing a Room from within a custom Photon plugin?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited November 2020
    Options
    Hi @ToddRivers,

    Thank you for choosing Photon!

    Read this.
  • Ok thanks guys, I added a custom event which makes Clients remove themselves when a room is closed and it seems to all be working.
    Seems slightly weird you can't remove an Actor plugin side with a reason or message passed down to the Client but it's working so all good.