Search Unity

Introducing PlayFab, a complete backend-as-service for Unity

Discussion in 'Assets and Asset Store' started by PlayFabJames, Sep 25, 2014.

  1. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    It's a part - Photon Realtime, Photon Turnbased, Photon Chat, and Photon Unity Networking are all part of the Photon Cloud. For purchase operations, I would recommend just calling into the PlayFab methods directly from the client - PurchaseItem for virtual currency purchases, and StartPurchase, PayForPurchase, ConfirmPurchase for real-money purchases. On iOS and Google Play, you do have to use their service for the real-money exchange (they require this), but you'd then use our receipt validation calls (ValidateIOSReceipt and ValidateGooglePlayPurchase) to kick off server-to-server validation and virtual goods fulfillment.

    They're all designed as secure backend calls, so that client-side bad behavior (replay attacks, modified data, etc.) can't be used to cheat the system into giving up an item without payment of the currency (real or otherwise). The three-stage for real money purchasing is designed to provide for a "cart"-like experience while keeping the transaction secure at each stage.

    For adding virtual currency to the player account (aside from scenarios where you're purchasing it with real money or another currency, for which you'd just use the calls above), you can use hosted JavaScript to evaluate the data coming from the client and determine the right amounts to add right now. And again, we'll provide a way to call into that using the Photon webhooks soon.

    We also have time-replenishing currencies, which gives you another server-side mechanism to add a virtual currency. So if you wanted something like the lives system in Candy Crush, you could set up a currency to be limited to 5 max, and to be replenished at a rate of 1 every 30 minutes.

    Brendan
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,294
    not sure of the meaning:
    any exemple?
     
  3. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Sure thing:

    A hosted game server for state-dependent logic would be something like a dedicated server. This would be the way to go if your logic is very time-sensitive, as in a shooter, and you have enough custom logic that you're looking at writing it on Photon Server, for instance. The clients connect directly to the server, which maintains the current state of the session for all connected players and sends frequent updates.

    Hosted code (JavaScript, in this case) for stateless logic is for things you want to be server-authoritative (so that the users can't cheat it), but where you don't need complex state info or twitch-speed (sub-100 millisecond) response. One of the more common examples of this would be awarding a user virtual currency based upon specific in-game actions. You can't trust the client to determine that, since it would be too easy to cheat, but you don't need a full-on hosted server to manage something that simple. The logic would just read from the hosted user data (all the PlayFab API calls are available to the hosted scripts), make a determination about the right thing to do, and then add the virtual currency to the account.

    In between the two would be using Photon Realtime with webhooks (so, replication of state between players is extremely low-latency, but you can afford a small amount of latency on the webhook responses). We'll be offering a way to use the webhooks directly from the Photon Cloud soon.

    Brendan
     
  4. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    Any updates on the catalog manager? I'd like to see / use an official version rather than my own.
     
  5. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    We'll be releasing the updated version of the PlayFab Game Manager later this month. We're pushing to release it as soon as possible, as it's got a ton of added functionality, but we're being careful to test and re-test everything, and we're working on all the docs, so that it's as simple as possible to use. If you'd like to have a look at it pre-release, please email us at devrel@playfab.com.
     
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    I see a mention of game forum integration, so players can use their PlayFab login for the online forum. Could we set it up the other way instead -- so players can use their forum login (already established) to log into PlayFab inside the game? It's a phpBB forum.

    thx
    Dave
     
  7. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    Send you an e-mail.
     
  8. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Dave and I had a good conversation about this via email, but just so everyone knows:

    We have a range of auth options right now, and we have the ability to integrate with OAuth-based solutions. This will commonly require custom work, so we would need to understand your scope and time requirements. If you need a custom integration like this, please do reach out to us, so that we can talk through the details with you.
     
  9. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    I noticed that you don't list Amazon among the supported services for IAP and virtual currencies. Any plans to add it? we get more game sales on Amazon than on Google or Apple.
     
    Meltdown likes this.
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    Also: is PlayFab COPPA-compliant? I'm mainly thinking about how Player Accounts work, and what COPPA considers PII.
     
  11. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    We do indeed have support for Amazon payments at a service level, as well as PayPal (hence, their inclusion in our example code). If either of those are a priority for your title, feel free to let us know. There's a bit of work we need to do in order to fully expose them in our Game Manager, but since we prioritize based on developer needs, it's simply a matter of getting it on the schedule.
     
  12. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    PlayFab has all the tools needed to ensure that your game is COPPA compliant. Since we provide game developers with the ability to store any information they want to, and since the presentation of your game to your audience (including any stated privacy policy) is entirely under your control as a developer, COPPA compliance is something you should understand and plan for, as it relates to your title. If you have a game which specifically targets kids, and in particular if you ever ask your users for information concerning their ages, you should reach out to us at devrel@playfab.com to talk through the specifics.
     
  13. elasto

    elasto

    Joined:
    Mar 20, 2014
    Posts:
    18
    Can I confirm that Bolt Engine builds can be uploaded to run on Playfab's game server hosting?
     
  14. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    What this back-end says it can do sounds awesome! The only thing I worry about is the bandwidth overhead but that can be heavily mitigated with CUSTOM CLOUD SERVER LOGIC! I'm extremely excited about porting the rest of my game over to PlayFab. In fact, I'm thinking whether or not I should sleep tonight.

    I also want to mention that I wrote about PlayFab in a review but I was a bit confused of what exactly PlayFab is: http://forum.unity3d.com/threads/mu...oton-ulink-darkrift-forge-and-playfab.294852/.

    Is there any news on the Cloud integration front? Personally, I'd rather use the networking solution DarkRift with PlayFab but I'll take anything that works.
     
    Last edited: Jan 31, 2015
  15. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @elasto - I haven't worked with Bolt Engine myself, but their write-up states that their tech can run as a dedicated server, and that they provide full source access. If that's the case, and those servers are Windows-compatible, it should be fairly simple to update that code with the couple of calls needed to work with our matchmaker, allowing you to host those servers in PlayFab. If you want to dig in on this further, feel free to send us a note at devrel@playfab.com.

    @jpthek9 - Thanks! :) Also, thanks for the write-up and your posts on our own forums. The same (above) applies to DarkRift - we haven't had the opportunity to play around with it (we've been focused on our own backend services and the Photon integration), but if they run in Windows (we'll be adding a Linux server hosting solution in an upcoming sprint) and you can add the couple of calls needed to work with our matchmaking service, I can't see why it wouldn't work. As above, let us know if you'd like to talk through this.

    Brendan
     
  16. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,294
    i have seen you added the chat feature, is it photon chat(room based) or your own solution ?
     
  17. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Actually, we've had a chat solution for some time, now. For developers bringing new titles onto PlayFab, currently I would recommend using the Photon Chat solution (provided free to Premium tier titles in our service), since it's a relatively simple way to get chat working in your game (our existing solution is XMPP-based, and requires more work).
     
  18. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Hi, all - I wanted to highlight the fact that we'll be at GDC next month, so if you're going to be in San Francisco during the conference (March 2-6), we're available to help answer questions, take your feedback, or provide demos of the latest and greatest features we’re working on. We're also doing three talks and sponsoring the Pocket Gamer Party, so we hope to see you there! Here's the complete write-up, in case you can make it: https://playfab.com/blog/2015/02/12/see-playfab-person
     
  19. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Hi,

    I need undertand something If I need a turn-based game I need to use Photon or with playfab objects can do the same?
     
  20. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
  21. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,294
    this is great, is there a way to state which user is online in the demo you did for matchmaking?
     
  22. JohnTube

    JohnTube

    Joined:
    Sep 29, 2014
    Posts:
    63
    When I first read the post title from PlayFab's tweet I though of the future of PlayFab - Photon integration.
    PlayFab already has its own matchmaking system (and it's open to external ones) and can support a chat feature. If we add this asynchronous server-less thing then why does PlayFab even need to partner with Photon ? Let's omit the idea that they just want to profit from Photon's popularity especially among Unity's community and maybe "lure" some of Photon's users.

    But then I read this :
     
  23. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @JohnTube: Bear in mind that Photon is designed for synchronous gameplay - connecting players directly for game sessions. That's not something you can do with an purely asynchronous solution like the one in that blog post and sample. Our partnership with Photon fills the middle tier of the ways you can enable multiplayer gaming:

    Async only, no player connection - Main PlayFab features (auth, data, catalog, inventory, etc.), plus Cloud Script for server-authoritative logic not requiring twitch-speed response (they're web calls, so they're not really intended for FPS collision detection, for instance).

    Sync player connection, with chat (but not requiring a full-on custom server) - This is where Photon Cloud fits nicely (Realtime, Turnbased, Chat). It also allows for webhooks, which can call into Cloud Script for custom logic, and the Exit Games team recently announced DLL plugins, which offer even more customization options.

    Sync connection, custom server needed - For the highest level of need, we provide game server hosting, so that developers can simply upload their build to us for hosting in our service and take advantage of our ability to scale, as well as use our matchmaking and monitoring tools in order to power their games.
     
    JohnTube likes this.
  24. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @Damien Delmarle: Sorry, could you clarify this? The Cloud Script does have the context of the user making the request, so from that perspective it does indeed know which user is online.
     
  25. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,294
    i have read on playfab forum that it wasnt possible to know when an user is online, so the only way is to use something like LastRequestTime > 5 minutes = not online, right ?
     
  26. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Since our service is Web API based at its core, PlayFab has a sign-in operation which provides a session ticket. We don't specifically have a sign-out operation, as in many cases (mobile, particularly), the game doesn't have a clear point at which it would want to sign the player out - they could be turning off their phone for a few minutes, only to turn it back on and play some more.

    When it comes to matchmaking, I would break this down by synchronous vs asynchronous.

    For asynchronous games, the important thing is knowing when a player last entered a "move" in the game you're playing, so having that tracked would be our recommendation, yes.

    For synchronous games, our matchmaking system lets you query to see what players are actively playing on servers, so that would be one way to tell that a player is online.

    Also, if you're using Photon, you could create rooms based upon the parameters

    And all this said, we continue to base our development on our community's needs. If a sign-out is important to your title, please be sure to let us know on our Feature Requests forum.

    Brendan
     
    JohnTube likes this.
  27. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
  28. jasonMcintosh

    jasonMcintosh

    Joined:
    Jul 4, 2012
    Posts:
    71
    I saw a mention about using C# instead of javascript for server code. Are there any details about that you can share?
     
    JohnTube likes this.
  29. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    242
  30. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    We do plan to add C# as well, for our hosted Cloud Script feature, but that will likely be a few months out, based on our current schedule. Of course, if we get a bunch of titles for whom that's a key need, this could easily change, but if you're planning to ship in the next few months, I would have to recommend using JavaScript.

    Brendan
     
    jasonMcintosh likes this.
  31. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    72
    Hey,

    I'm unsure if this is the thread to do it, but I have a question about PlayFab in Unity.

    I want to access an Item's attributes in Unity.
    I am using the following to get my user inventory:

    PlayFabClientAPI.GetUserInventory (new GetUserInventoryRequest(),OnGetUserInventory, OnPlayFabError);

    Then, in my OnGetUserInventory function there doesn't seem to be a way for me to access an item's attribute with the GetUserInventoryResult array that I return. I can get things like the "ItemId" and "Annotation" etc. but I don't know how to get the attributes.

    Any help would be greatly appreciated! PlayFab has been great so far :)

    Julian
     
  32. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Julian and I have been discussing this over in the PlayFab forums as well, but just so everyone here knows, the need is for key/value pairs specifically on item instances in player inventory (as opposed to on the catalog item, which we already have). As it happens, we're implementing this now, and expect to have it available shortly. I'll update here when it has bene posted publicly.

    Brendan
     
  33. Deevo

    Deevo

    Joined:
    Aug 8, 2012
    Posts:
    8
    Regarding Playfab's pricing - did you guys consider that in non-rich countries, the revenue/user is much lower than North America/Europe? Some countries revenue per user is 1/10 of the US, and if we use Playfab to scale globally (which would be one of the reason to use it to begin with) it seems the US customer would be subsidizing the DAU cost in other less-rich countries. Say the game becomes popular in China, India, or Indonesia, then those DAU's start to become really expensive. I was just wondering if you guys ever considered this angle in your pricing scheme.
     
    JohnTube likes this.
  34. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @Deevo: Our intent is to price our services as low as possible, in order to make the decision of build-versus-buy a no-brainer. After all, we're going to continually invest in making additional features for games, so it's basically like having a complete service engineering and devops team, but for far less money. :)

    When it comes to global release, we're very aware that there's a range of average revenues per player, so we're always considering ways to improve the model. If you have specifics for your title(s) you'd like to discuss, I'd encourage you to contact us privately at devrel@playfab.com to discuss them.
     
  35. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Hi all,

    In case you haven't seen the news yet, PlayFab has introduced a free tier, giving developers the ability to have a fully managed game backend with all the essentials - cross-platform authentication, in-app purchasing, title data (for configuration of your game), and user data (for player-specifics, like game saves). As you can imagine, we're very excited about this, as it means that many developers can have the features they need to get their game launched, then focus on building their community and tuning their game without needing to worry about server-side costs running them out of cash if they get a surge in players before they're ready.

    The blog post on this is at this link, but here's the complete text, for convenience:

    Every game deserves a backend. Every game developer deserves one, too. So, effective immediately, PlayFab will give you one for free.

    Receipt verification, cross-platform authentication, title and player data — our new Free Tier gives you the key features you need to start securely and flexibly engaging your players. And that’s free as in free. No fees ever. Not after your game is live, not even if it’s a big hit.

    Of course, if your game is a big hit, we’re hoping you’ll want to upgrade and use some of our other awesome features, such as virtual currencies, social integration or custom game logic, but that will be totally up to you.

    Like most of our product decisions at PlayFab, the idea of the Free Tier came out of discussions with our customers. Time and again, I’d hear from developers that they loved the idea of our service, but were worried they couldn’t afford it — especially successful games that already had a huge number of DAU, but low ARPU.

    So, we’re making it simple for everyone. Install PlayFab, stick with the Free Tier features, and you won’t even have to give us a credit card number. It really is that easy.

    Included in the Free Tier are the most basic building blocks for a live game: cross-platform authentication, player data storage, catalog management, and receipt verification. With receipt verification you can instantly verify that your players are presenting true receipts from Apple, Google, etc., and that all in-app purchases are real and unique. Cross-platform logins across Steam, Facebook, iOS, and Android mean your players can enjoy your game across multiple devices, and server-side player data means their saved games can travel with them. Finally, server-side title data means you can tune your game after launch and roll out new content without forcing players to update or requiring you to recertify.

    We’re proud to be part of the overall trend of making the latest and greatest game development technology available to the widest possible audience. Almost no one builds their game engine from scratch anymore, and we don’t think they should have to build their own backend either. When developers are free from reinventing the wheel, they can focus more time on the game itself, and on building great relationships with their players. As gamers ourselves, we like the sound of that.

    You can learn more about the Free Tier at http://playfab.com/freetier or on our Pricing page, or go straight to our full list of all included APIs. We can’t wait to see what you build with it.
     
  36. zac_playfab

    zac_playfab

    Joined:
    Nov 25, 2014
    Posts:
    7
    Say hello to the new PlayFab,

    Have you considered using PlayFab but did not know where to start? We are hosting our first ever live webinar. Intended for those new to PlayFab / BaaS development.

    Details and Sign up here

    Overview of the topics covered:
    • How to use PlayFab to get all the benefits of a working backend from day one of your development. This include cross platform player authentication, virtual economy, matchmaking and more.
    • How to manage and optimize your game post launch to improve conversion, retention and revenue out of the box with the PlayFab game management tools.
    Happy Developing!

    -The PlayFab Team
     
  37. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    Can you clarify the Photon multiplayer options? We already have set up our game with PUN+, but we'd like to use Playfab's other features, including banning. I'm unclear about if/how we could connect those together.
     
  38. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Basically, the way to think about it is this: PlayFab is the service where you have user accounts, your economy (catalog, purchasing, etc.), data storage for users and the title, log events and analyze the results, do promotions, provide social features like leaderboards and friends, etc. - everything that requires data which is longer-term that the gameplay session (though we also have hosted game logic and can host custom servers, as well). Banning would definitely be a part of that.

    Since you're already using PUN+, you're probably familiar with the Photon Cloud, but just in case, it's the solution for your realtime connection needs between players, both to make and maintain the connection for data exchange (dealing with NAT and other network issues), holding information about the session state, and replicating messages between players.

    The way we work together is that we've integrated our authentication system with them, so that you can use your PlayFab user identity when creating and joining Rooms in the Photon Cloud, and we've integrated their webhooks into our Cloud Script, so that triggered events in their Rooms can call your custom logic hosted in our service. We provide a baseline Cloud Script when you create a title in PlayFab, which has the handlers needed to manage those calls - you just need to fill in your custom logic.

    We also have a full walkthrough of getting set up with Photon in PlayFab, so that you can quickly see how to create and set up a room using the Photon App IDs we provide: https://playfab.com/docs#/menu/1334/1397.

    Brendan
     
  39. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    Ah, that all makes sense. Thanks for the detailed explanation!
     
  40. PlayFabJames

    PlayFabJames

    Joined:
    Sep 25, 2014
    Posts:
    15
    Hi all, just catching up on this forum thread... a few things worth calling out from earlier posts:
    - as Brendan mentioned above, we now have photon webhook integration.
    - we now have the ability to update item properties in the inventory (https://api.playfab.com/Documentation/Server/method/UpdateUserInventoryItemCustomData)
    - we now have support for Amazon and Kongregate (in Beta) -- https://api.playfab.com/Documentation/Client?beta=1

    If you're interested in playfab, please follow us on Twitter (@playfabnetwork) or Facebook, and please create an account -- that will ensure you get notified of new features and updates as they happen!
     
  41. TommiH

    TommiH

    Joined:
    Jan 14, 2008
    Posts:
    252
    Hello.

    I'm getting a 500 Internal Server Error when I'm trying to initiate a purchase. Here's the code:

    Code (csharp):
    1. StartPurchaseRequestrequest = newStartPurchaseRequest();
    2. request.CatalogVersion = "WolfQuest";
    3. request.Items = newList<ItemPuchaseRequest>();
    4. ItemPuchaseRequestpurchaseRequest = newItemPuchaseRequest();
    5. purchaseRequest.ItemId = catalogItems[selectedLevelOrMode].ItemId;
    6. request.Items.Add(purchaseRequest);
    7. PlayFabClientAPI.StartPurchase(request, OnStartPurchaseSuccess, OnError);
    In addition to the error in the console, the OnError function gets called but the error code is set to "Success" and there's no error message included. (I've also seen this behaviour - "Success" as error code - when I was not connected to the internet, but that's not it: I'm able to log in and get the item listings without problems.) I don't know where to start looking for the issue, so I would appreciate some help.

    Thanks in advance for any assistance!

    Edit: Turns out I had left out Count from my request, and there was no other error message for this situation.

    Best regards,
    Tommi Horttana
     
    Last edited: Jul 28, 2015
  42. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    Just so everyone has the benefit of the info from our mail thread:

    Any 500 error indicates an error condition for which we don't have a more specific, detailed error message. Every time one of those is triggered, we automatically open a bug to make sure we update to provide better error feedback. In this case, the error was in calling StartPurchase with items for which the quantity to purchase was 0, so it was a particularly easy fix - and yes, we're making another pass through all of our test cases to ensure that all boundary conditions are being tested in our automated passes. :)

    Brendan
     
  43. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    Is this for non-coders? Would I be able to implement it into my Windows 10 universal app and use IAP features without coding?
     
  44. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @DeanMarquette: Our service is platform agnostic, so you can use it from literally any device that can make a Web API call. For most platforms, including Windows, you do need to have some basic code knowledge to use it, but between existing HTTP and JSON libraries, it's quite simple and we do provide samples showing how to integrate our service using Unity.

    Brendan
     
  45. fammXyShea849

    fammXyShea849

    Joined:
    May 11, 2013
    Posts:
    17
    What you guys have done is awesome, and I love the built-in features. However, after fooling with it I've realized there is no real way to determine whether a player is online or not. I've read some "workarounds" but, they're just not up-to-par with what I need.

    I would love to use this system, as it makes my life many times easier. I'm aware this project is new and still has a lot of work to be done, so I was just wondering if I can expect to see this feature in the near future?

    The issues I'm facing are:
    1. Players can log into the same account multiple times, and since I can't determine if the account is already online I can't boot the other player off. I plan to sell in-game cosmetics and have a matchmaking system, so players can multibox to gain rank in the game easily and players can share their purchased cosmetics with friends since they can just play on the same account.

    2. It's also an online team game, so it's very important that players be able to see when their friends are online or not.

    Thanks!
     
    Last edited: Oct 20, 2015
  46. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @fammXyShea849: Thanks! For any game which uses custom game servers (online team games, like CoD, etc.), we return the info on the server that player is currently in, as part of the friends list info. That way, you can make sure to get them into the game session with their friend.

    The design of our system is intended to allow for the scenario where you have multiple devices, all of which you need the player to be able to sign into simultaneously (companion applications and the like), but you can still prevent multiple simultaneous sign-ins by doing a "heartbeat" check from your custom game server, the same way PSN and XBL do:

    First, write the timestamp to User Internal Data (this is data which is specific to a user account, but which is not readable or writable by the client - you can write to it via Cloud Script) when the player signs in. Call the key something like "signInTime". When the player joins a game session, have the server query that key and store it locally. Every 20 seconds or so, check to see if the value still matches. If not, kick them out of the game.

    Since the player's Session Ticket could expire while they're playing, forcing them to re-authenticate (and so, cause the signInTime to update), you should also provide for that case. You can approach this a couple of ways. You could check if the old Session Ticket has expired and only allow the player to update the time if it has. If your local client caches the Session Ticket reliably, that would work fine. But if not, you'd potentially be getting a fresh Session Ticket on a sign-in before the old one expired, in which case you would want to be more permissive about letting them update the signInTime.
     
  47. fammXyShea849

    fammXyShea849

    Joined:
    May 11, 2013
    Posts:
    17
    Ah, very clever.
    I was thinking of it too narrowly. I will be fooling with this, thanks!
     
  48. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,071
    Hello!

    I lightly skimmed the thread. Please forgive me if answered previously but:

    1. PS4 support?
    2. Works with Unet, and is there a Unet friendly API?
    3. If it works with PS4, is there an easy way to deal with accounts etc ie friends lists are automatic and accounts are automatically created in the name of whoever logged in? I'd rather just have this invisible service that deals with user accounts. Signing up for accounts on console is a pretty tedious affair, and I don't need cross platform. So I was wondering if I could just automatically create an account for some people based on their PS4 credentials?

    Mostly, I just want robust leaderboards and tracking of items / simple save data and currency stored on the web so if people delete their saves, it doesn't matter. Also somewhat really helps with cheating/loss of data, if it's not stored as a file.
     
  49. Brendan-Vanous

    Brendan-Vanous

    Joined:
    Nov 7, 2014
    Posts:
    73
    @hippocoder:

    1. Yes, Loadout is an example of a PS4 game running on our platform.
    2. Any language capable of making a Web API call is able to use PlayFab. We have SDKs that wrap up those calls with the conveniences of commonly needed libraries (like HTTP and JSON).
    3. Yes, on PS4 you just provide the PSN auth code to us, and we log the player into their PlayFab account - there's no need to ask the player for anything if you don't need the ability to use that account/data cross-platform.

    And to your point - that's part of the core concept. Everything is stored in our service for you, so that players don't need to worry about it, and so that you can make certain people can't cheat the data by modifying it locally. If you also make use of custom game servers or even just Cloud Script, you can also use server authoritative logic to help prevent cheating by hacked clients.
     
    hippocoder likes this.
  50. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,071
    I'd like to move forward with you then :)