question

lordsplendidhumility avatar image
lordsplendidhumility asked

Have server notice when title news updates?

We want to have a way to send game status messages to logged-in players, and had been considering using PlayFab's Title News system for that. Our clients already check the news once when they initially connect to PlayFab, but we're trying to avoid having the clients repeatedly polling the news service to check for updates.

We had originally been thinking about having our custom game servers subscribe to PlayStream to receive notifications about title news updates, so that they could tell their connected players to fetch the updated news, but it sounds like that PlayStream functionality isn't yet ready for prime time.

Our next fallback position is to have the custom server poll the Title News once every thirty seconds or so (on the theory that servers have a much higher API call limit and there are a lot fewer of them), and to let players know when there's new news to fetch.

Is there another, smarter way to handle this?

(Our clients will nearly always be connected to at least one of our custom server processes; either the lobby server or a match server, and so we could make either one or both responsible for alerting clients to updated news)

Custom Game ServersTitle News
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

·
brendan avatar image
brendan answered

The SignalR integration turned out to have some scaling issues which we hadn't observed in testing, which is why that functionality isn't broadly available - we've got a bug logged to update the docs around that for clarity.

The main question I would ask is, how often are you planning on updating Title News? Having the custom game server be the source of truth for this, so that each client isn't polling, is definitely a good thought. But are you planning to update so frequently that every 30 seconds would be necessary? Or is there something particularly time-critical that will be in your Title News? And if that's the case, why not use Title Data to provide the schedule for when your news items will drop, so that you can just query for the Title Data less often (and then grab the Title News at the right time)?

2 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.

lordsplendidhumility avatar image lordsplendidhumility commented ·

Hi, Brendan!

The idea here was to have an “emergency messaging” feature which let us immediately push out an unscheduled message to all connected users. It’s something which you never want to have to use, but which has definitely saved my bacon on a few client-server games I’ve worked on previously.

This sort of feature is something that only gets used perhaps once or twice per year, which is why it would have been handy to implement it through a PlayStream-style subscription message that gets pushed if it ever does happen, rather than needing anybody to poll to check for it.

Actually, better than having anybody poll would probably be for me to just build a tool which can connect to our custom game servers as an authenticated client, and just send such messages directly through them using the tool, rather than involving PlayFab in the process at all. I’d just been all excited to use your existing already-nicely-UX’ed back-end as part of that functionality, rather than having to write my own!

0 Likes 0 ·
brendan avatar image brendan lordsplendidhumility commented ·

Sure - the whole port 9xxx range is available for you to use to connect, so it would be relatively simple to write a tool that uses GetCurrentGames to get the list of running sessions, connect on port 9999, handshakes with a Secret Key that only you have, and use that to submit a message to the servers. After all, for the scenario you describe, you'll have to be taking direct action anyway, so you might as well make it an immediate action.

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.