question

brendan avatar image
brendan asked

Server side logic, functionality

terenctb
started a topic on Wed, 20 August 2014 at 1:31 AM

Our game will have a news feed system, where random news bits in the game world are fed to the players (i.e. maybe to announce sales in stores or just random news bits that add story flavor). How would we go about implementing this?

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

Best Answer
gwertzman said on Mon, 25 August 2014 at 12:32 AM

You would implement this using our in-game "news" system.

First, you would publish the news items using the Game Manager tool. A screenshot is attached below showing an example. Alternately, you can use the admin API to write your own news management tool (see https://api.playfab.com/Documentation/Admin/method/AddNews)

Then, your game would use the "GetTitleNews" API to retrieve the news items (https://api.playfab.com/Documentation/Client/method/GetTitleNews). We do not currently provide a way to "tag" these items (e.g., show this as interstitial, show this on login), but it's in our backlog, and in the meantime you can create your own system by embedding tags in the titles of news articles and then filtering them out before you display them.


4 Comments
Brendan Vanous said on Mon, 25 August 2014 at 12:27 AM

Hi Terence,

In this case, the simplest approach would be to use the title news functionality:

http://api.playfab.com/Documentation/Admin/method/AddNews

This API allows you to set up text strings which your title can access on the client via the GetTitleNews API method.

Alternately, if your data needs are more complex, you could set up these news items, along with the other data elements needed, as title data, using the SetTitleData API method. In that case, you would be able to set any game-specific data elements needed, in addition to the text of the news item.


gwertzman said on Mon, 25 August 2014 at 12:32 AM

You would implement this using our in-game "news" system.

First, you would publish the news items using the Game Manager tool. A screenshot is attached below showing an example. Alternately, you can use the admin API to write your own news management tool (see https://api.playfab.com/Documentation/Admin/method/AddNews)

Then, your game would use the "GetTitleNews" API to retrieve the news items (https://api.playfab.com/Documentation/Client/method/GetTitleNews). We do not currently provide a way to "tag" these items (e.g., show this as interstitial, show this on login), but it's in our backlog, and in the meantime you can create your own system by embedding tags in the titles of news articles and then filtering them out before you display them.


mattgogii said on Thu, 29 January 2015 at 11:52 AM

Is it up to the game to log which news the user has seen so it's not shown every time or does the game manager take care of that?


Brendan Vanous said on Thu, 29 January 2015 at 8:34 PM

Correct, we do not make assumptions about the usage scenarios for the News items. When the API is called, the last N news items will be returned, as specified in the call.

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.