question

chorustempo avatar image
chorustempo asked

List of player info for all online players?

I'm trying to get a list of (likely) online players in order to match opponents in a card game. I'm thinking a way to do this would be by assigning players a set currency when they log into the game. Then on log out, deduct that currency. Then I can have a segment that has all players with that currency value as greater than 0 and run a task every few minutes (or as needed) on the client side that pulls a list of player data in that segment to show all online players. It doesn't need to be real-time, so a few minutes off is fine.

I've set up the segment and set up a rule that adds the currency automatically to a player on event type 'playfab.player_logged_in'. Is there a way to do a similar rule on log out? I couldn't see a logged out event type in the list.

unreal
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

·
Gosen Gao avatar image
Gosen Gao answered

PlayFab is a stateless service and there is no “Log out” API call, which means that you cannot know if a player logs out. Since you want to match opponents for your players, have you tried the Matchmaking - PlayFab | Microsoft Learn? It should be able to help you implement the match system.

1 comment
10 |1200

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

chorustempo avatar image chorustempo commented ·

I did have a look at matchmaking, but it would be very difficult to set up the criteria I need to match players (a field value in the title data of player 1 matching the value of a field in an object of player 2). Although I ended up finding a work around by changing the use cases for requesting the data and using segments instead.

0 Likes 0 ·

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]