How to reject player to join to the room?

Options
I use webhook PathJoin and return result:
{ 'ResultCode' : 1, 'Message' : 'Access Diened' }
{ 'ResultCode' : 5, 'Message' : 'Access Diened' }
{ 'ResultCode' : -1, 'Message' : 'Access Diened' }

This not working. Player join to room.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Temka,

    Are you sure your webhook endpoint is being called?
    Did you try with more than one player for a single room? Because first player who creates or loads the room will trigger PathCreate webhook.
    Double check your configuration and enable HasErrorInfo to see if the webhook is being called or not.
  • Temka
    Options
    I want to backend server refused the player at the entrance to the room. Specifically PathJoin error back to the client.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Yes I understood what you are trying to achieve and I got it that you chose webhooks for this.

    I just want to make sure there is no misunderstanding. Please answer my previous questions so I can help you.

    I'm assuming you have your own or a third party web server where you have implemented PathJoin webhook. I also guess that you properly configured webhooks by setting BaseUrl and PathJoin key/values at least. I also pointed out that you need to set HasErrorInfo = true in order to forward error messages back to clients.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited May 2016
    Options
    @Temka just to be clear. Currently, PathJoin cannot cancel join operation. Only PathCreate can cancel create operation or join operation in case of rejoin/load.

    So what you can do, if you do not want to go down the custom Photon Server or Plugins way:

    In the UI, do not let player get into room directly after receiving join operation response or own join event. Instead make some kind of safety timer to wait for any ErrorInfo event and maybe parse its Info message to check that it is indicating that player should be rejected from that room. Or wait for a confirmation message from other client, probably master client. If rejected, leave room.