question

Ilya Meparishvili avatar image
Ilya Meparishvili asked

Can i catch events in unity where server api is enabled?

Hello

I just want to get information in unity when example character_created or character_inventory_item_added events is triggered.

I found some class about data in PlayStreamModels but can not figure out how to define events to receive data with PlayStreamModels classes.

Sorry if my English is very bad

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Do you mean you want to write a server with Unity? If you build a web server with Unity and your server has an external network IP address. You can pass the data for the events via Webhooks. PlayStream Webhooks are POST calls to your provided endpoint, which pass along all the data for the event in the body of the call. The data will be passed in the JSON format. And you can refer to PlayStream Event Models and handle this data by yourself. If so you even don’t need to use PlayFab server API.

And PlayStreamEventsModels are not for such usage that defining or receiving these data. These are the built-in PlayStream events which are automatically generated by PlayFab Game Services APIs and written to the event pipeline. If you want to create your own event, you can use the WriteEvent APIs. If you want to receive data info on the Unity Server, you can use Webhooks that mentioned in the first paragraph. Or you can trigger actions based on properties values in the PlayStream tab of the Game Manager. You can check the doc PlayStream for more detailed.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.