Webhooks pathevent sends a lot of evcode:200

Options

When I only configure the PathEvent webhook, I activate only one custom event by setting (raiseEventOptions.Flags.HttpForward = true), and then I receive a large number of evcode:200 events, why are 200 events sent? How to avoid this situation?

webhook path: PathEvent

webhook body:

{"ActorNr":1,"AppVersion":"_2.41","AppId":"myappid","Data":{"5":5,"4":[["QXpuu0CK52kAAAAA"]],"2":-1828246463,"0":17},"GameId":"mygameid","Region":"ASIA","Type":"Event","UserId":"myuserid","Nickname":"myname","EvCode":200}

Answers

  • Tobias
    Options

    Maybe you don't use a separate instance of RaiseEventOptions and the flag "leaks" into all the events that the client sends.

    The issue is very likely on the client side.

  • player110
    Options

    Thanks for you reply, but EvCode 200 can not be raise by client,the doc description:

    A byte identifying the type of event. You might want to use a code per action or to signal which content can be expected. Allowed: 0..199.

    The code in PhotonNetwork.RaiseEvent method:

    if (!InRoom || eventCode >= 200)
    

    and my raise event code:

    private void SendStatEvent(GamePlayer player, GamePlayer killer)
    {
        player.deaths++;
        var content = new object[] { player.id, (byte)0, player.deaths };
        RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.All };
        PhotonNetwork.RaiseEvent(EventCodes.StatUpdate, content, raiseEventOptions,
            SendOptions.SendReliable);
        if (player != killer && killer != null)
        {
            killer.kills++;
            content = new object[] { killer.id, (byte)1, killer.kills };
            if (!killer.bot)
            {
                raiseEventOptions.Flags.HttpForward = true;
            }
    
            PhotonNetwork.RaiseEvent(EventCodes.StatUpdate, content, raiseEventOptions,
                SendOptions.SendReliable);
        }
    }