question

robertdemjan avatar image
robertdemjan asked

Playstream events for custom game server

Hello!

Is it possible to send custom events from a custom game server to playstream?

Since playfab automatically generates some events for game lobbies, and makes a query for it (called lobby events), it would be nice if we could put in custom datas.

Problem is, I don't see any API call to write playstream event as a gameserver. Only Character, Player and Title events.

I'd like to write events about the server itself( like what's happening in the game: there was disconnect what was caused by this, they completed the mission, reached checkpoints, etc ), I can't really assign playerId to the event. I thought title event would be fine, but somehow the default lobby query does not find these events.

What would be the ideal approach? Is it possible to achieve what I explained?

For example this query:

eventData.lobbyId:90FCF1C5311D4486

does not find the event written like this:

{
    "EventName": "TestEvent", 
    "Body": 
    {
        "lobbyId": "90FCF1C5311D4486",
        "customdata": "mycustomdata"
    }
}
Custom Game ServersPlayStream
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

·
comc avatar image
comc Deactivated answered

If you don't want them to be player events then they can be tagged as title events. The server disconnect fits into that. I would use player events for the objective completed events.

There are server components for both the title and player events in Playstream.

The player events need the PlayFabID and the TitleEvents are keyed to the TitleID

Since these are both server based methods they require the SecretKey to be established for communication.

https://api.playfab.com/documentation/server/method/WriteTitleEvent

https://api.playfab.com/documentation/server/method/WritePlayerEvent

5 comments
10 |1200

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

robertdemjan avatar image robertdemjan commented ·

Yes I know about Title event, as I posted. Problem is, I cannot query them the same manner as the lobby events do. Even if it includes a "lobbyId" field, if I make a query like this:

eventData.lobbyId:90FCF1C5311D4486

It is not in the result list. That would be the main reason I would use this feature, to see what happened in a specific lobby. So I need to query them about lobbyId, but it's not working.

0 Likes 0 ·
brendan avatar image brendan robertdemjan commented ·

Sorry for the delay on this. Is this for Title ID 2ABB? I'm not seeing lobbyId on any of your existing events. Can you clarify how you're trying to use this? It definitely should be query-able as part of our tools, so if you can point to an example use case, I'm sure we can sort this out.

0 Likes 0 ·
robertdemjan avatar image robertdemjan brendan commented ·

Yes this is. It has been deleted since then.

I sent in a new (ID: c572b97d2b4f44fb8645ccd3debe19b9 )

eventData.eventName:TestEvent

This queries the item fine. However, querying this:

eventData.lobbyId:90FCF1C5311D4486

Does not yield any results

0 Likes 0 ·
Show more comments
Show more comments

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.