Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by goncho · Sep 06, 2017 at 07:21 AM · CloudScriptapisMatchmakingCustom Game Servers

[SERVER or Cloud Script] Retrieving Server CustomData or Tags without Client.GetCurrentGames

I need a way for a custom Server hosted with Playfab to read the changes on its own CustomData or its Tags.

Right now the only way to modify them is via Cloud Script called from a Client. After a GetCurrentGames() I read the CustomData and call the Cloud Script with the CustomData modified so the Cloud Script uses Server.SetGameServerInstanceData to update the value.

Any way I can read that CustomData (or Tags) in the Server instance? It could be a CloudScript function called from the server but I don't find a way to access that data besides the GetCurrentGames().

I actually plan to use a Tag in the server with the LobbyID so in the Client I can update the actual CustomData with a Tag filter in GetCurrentGames. It will be better if I there is a way to ask directly for the CustomData (or Tags) of a Server instance using its LobbyID.

Thanks for your amazing product, our game it's working great thanks to your hard work!

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Sep 06, 2017 at 07:22 AM

Actually, the recommended way to update the CustomData and Tags for a dedicated server would be for the server to call the appropriate Server API call. Is there a reason that's not an option in this case?

Comment

People who like this

0 Show 6 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image goncho · Sep 06, 2017 at 07:41 AM 0
Share

Yes, I want the user to add itself to a "waiting list" in the server, so that's why I'm using the CustomData and updating it from the client via Cloud Script. The plan is to be able to do a background matchmaking while the user is playing and connect to the match when enough people is waiting.

This is the process (if there is a better way to do it just tell me):
1. The client call GetCurrentGames() and selects a game to join (or creates one with Matchmake) but it doesn't get into the game yet, just saves its data.

2.The client adds itself to the waiting list in the server adding its ID to the CustomData on the server with a Cloud Script.

3. The client keeps updating the CustomData (using GetCurrentGames()) to see if there is enough players in the waiting list.

4. When the client sees enough players including itself he connects to the game. Once authenticated with the server, removes him from the waiting list.

What I'm looking for it's a way to read that values, from the server/cloud script and the client. I will love the server to watch for its CustomData and clean the waiting list and close if noone is waiting.

Thanks for your help, hope this clarifies a bit.

avatar image Brendan ♦♦ goncho · Sep 06, 2017 at 07:57 AM 0
Share

No, I really can't recommend that. What you're attempting to do is create a queued matchmaker using the CustomData for the servers themselves. As the calls in question are all web API based, there's a significant amount of latency involved. A matchmaker requires a dedicated server that maintains state information on all active games in-memory, so that it can quickly turn around match information to players authoritatively. Also, having every client hammering on the GetCurrentGames call would result in the title being throttled - the intended use case is that the client calls GetCurrentGames, picks a server, and joins it (potentially with one or two follow-up calls to the API, if joining the first server didn't work).

avatar image goncho Brendan ♦♦ · Sep 06, 2017 at 08:02 AM 0
Share

Okey Breandan, I understand the problem. I was trying to do it using just PlayFab. So what do you recommend for doing a queued matchmaker as you say? Would I need to do my own Matchmaker server to be able to store and manipulate properly the "waiting players" list?

Show more comments
avatar image goncho · Sep 06, 2017 at 08:12 AM 0
Share

Just one last question, is there any way to know the CustomData or Tags from the Server or Cloud Script having the LobbyID?

avatar image Brendan ♦♦ goncho · Sep 06, 2017 at 08:30 AM 0
Share

Since the server is the one setting the tags, what is the context in which it would also need to query its own tags? Or are you referring to your matchmaker? If it's the latter, what would it be using the custom data and tags to do?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    What API calls are needed in PlayFab hosted server vs self hosted server? 1 Answer

    UE4 PlayFab pipeline interactions 1 Answer

    What happens when a client calls ClientAPI.Matchmake then does not connect to a returned server? 2 Answers

    Server API get servers 1 Answer

    Is GetInitialPlayers() guaranteed to return teams together? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges