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 /
  • General Discussion /
avatar image
Question by sowee · Apr 27, 2018 at 09:48 PM · Custom Game ServersPlayer Inventoryphoton

Calling cloudscript fom custom server?

Hi,

I'm building a multiplayer game and will probably be using Photon Bolt as I want authoritative movement/logic. Bolt allows me to have one of the client be the server or, if I want full authority, I can have a decicated server. As far as I understand, since the server would be a uniy build, I could use your custom server infrastructure to manage it. Now, when a game ends, I'd like the server to be the one to initiate the process of rewarding players, since it knows the results of the game (who won, etc). I think it should call a cloudscript function, passing all the players info and this function would reward each player and then notify (?) them of their reward. Not sure if this is the best workflow. Is there another way of doing that?

Thanks!

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 pfnathan · Apr 27, 2018 at 10:17 PM

Please have a look at this discussion on the forum:

https://community.playfab.com/questions/17852/how-to-design-cloudscript-calls-restricted-to-serv.html

Comment

People who like this

0 Show 9 · 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 pfnathan ♦♦ · Apr 27, 2018 at 10:29 PM 0
Share

Btw, It would actually be much better for you to just make the call from your server and not going thorough CloudScripts path, Can you let us know why you are not approaching this way? - thanks

avatar image sowee pfnathan ♦♦ · Apr 29, 2018 at 07:01 PM 0
Share

Thanks, I'll have a look. As for your question, you mean use the playfab client API (sdk in unity) from my unity headless server? In Photon Bolt the server can be one the client, so I thought I'd have my reward logic on the server. But I'll probably run bolt on a headless server, so I agree I could do it as you suggested. Is it what you meant?

avatar image Brendan ♦♦ sowee · Apr 29, 2018 at 11:22 PM 1
Share

No, he's referring to having the logic in your server, rather than Cloud Script. Since you're doing multiple actions for every player, it would be much better to just make those calls from your server, since Cloud Script has relatively small limits for total runtime and the number of Server API calls you can make from it.

Show more comments
avatar image sowee pfnathan ♦♦ · Apr 29, 2018 at 07:53 PM 0
Share

Just as a side note: if I need to make several calls from my server (for instance, check the player had enough lives to play, reward him, remove life, etc), isn't it better to aggregate this logic in a cloudscript endpoint that just run "locally" ? Thanks

avatar image Brendan ♦♦ sowee · Apr 29, 2018 at 11:26 PM 0
Share

It's the same number of API calls, and the same amount of work in the PlayFab service, either way. With a custom game server, you can make more frequent updates to the locally-stored data, and periodically update the backend, since you shouldn't be making more than a few calls to the service per player, per minute, on average (bursts are fine, it's just that the average number of calls per minute over the life of the session should be within reason). So for example, if you have a shooter game, you would update everything about the player - world position, damage taken, bullets remaining, etc., pretty much constantly. But you would only update the backend with the aggregated info about the player state at the end of the session (or every couple of minutes, if the sessions are long).

Show more comments

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

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    what if we decided to move our game from playfab to custom backend infrastructure in future?,what if we want develop a custom backend for our game in future ?? 1 Answer

    Azure SQL server with PlayFab. How and what to store? 1 Answer

    Connection Problems 1 Answer

    How might I create invitations to a turn-based multiplayer game? 1 Answer

    Custom Photon Server with Playfab 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