Kick a player with Realtime API

I can see that there is a PUN PhotonNetwork.CloseConnection(player). Is there a Realtime equivalent function call?

Thanks.

Comments

  • Kaiserludi
    Kaiserludi admin
    edited January 19
    Hi @AndrewB.

    Unfortunately that feature is only available in PUN and does not have a Realtime equivalent.

    However this is a purely client-side feature and PUN sits on top of Realtime.
    So what you could do is have a look at how it is implemented in PUN and implement it yourself on top of opRaiseEvent().
  • But this relies on the client responding to a 203 event and leaving themselves. It would be better to have the host to tell the server to kick, but I'd imagine this would need custom logic on the server.
  • But this relies on the client responding to a 203 event and leaving themselves.
    Just like PUN PhotonNetwork.CloseConnection(player) also relies on this.
    It would be better to have the host to tell the server to kick, but I'd imagine this would need custom logic on the server.
    Yes, that's correct.
    You can do that with a custom operation via opCustom(), but you need to add custom server side logic for this (which requires you to either self-host or to use Photon Enterprise Cloud, as custom server side code is not permitted on Photon Public/Premium Cloud).