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 Nikita Matusevich · Oct 09, 2019 at 09:49 PM · apissdksCustom Game Serversunreal

How to set the maximum number of players on the server?

Hello. I am finishing the initial server setup and I have a question: how can I specify the maximum number of players on the server when creating the server (StartGame)? In my game, each player is able to create his own server (for example, to play with his friends) and must set the maximum number of players. The global limit is 32 players (I installed through Game Mode). But the player must create a server with a maximum number of players, for example, 8. When I call GetCurrentGames, I don't get the "MaxPlayers" that the documentation says. As I understand it, I myself must specify "MaxPlayers" inside the server at startup. How can i do this?

Comment
Nikita Matusevich

People who like this

1 Show 1
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 Nikita Matusevich · Oct 09, 2019 at 10:04 PM 1
Share

And one more question: how can I get a ticket to connect to the server from "GetCurrentGames"? I know that you can get a ticket from "StartGame" and "Matchmake", but this does not suit me.

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Oct 10, 2019 at 08:38 AM

Hi @Nikita Matusevich,

It looks like you are using Legacy Multiplayer, is that right? Based on your description and the docs, a possible way to “set” the maximum number of players would be defining more Game Modes specifying distinct max player count (like 2,3,4,…,32), when the player creates his own server ( call StartGame ), select the Game Mode that matches his custom max player count. See aslo: PlayFab matchmaker doesn't seem to know how many players server has.

And, you said “I don't get the "MaxPlayers" that the documentation says”, then what did you get exactly? Can you expose more details about that?

Moreover, according to the API reference GetCurrentGames, tickets are indeed not returned. A possible flow would be:

1) Call GetCurrentGames to retrieve running servers

2) Use Matchmake with to match make against that server instance, then use the ticketed returned to connect to that server.

Comment
Nikita Matusevich

People who like this

1 Show 3 · 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 Nikita Matusevich · Oct 10, 2019 at 09:51 PM 0
Share

Yes, I use Legacy Multiplayer, because I do not understand the difference between it and Servers 2.0. I succeeded in connecting to the match, thanks :) To the account of "MaxPlayers": I get all the data from the return of the GetCurrentGames function, except for "MaxPlayers" and "LastHeartbeat". I’m not interested in the latter, but I would like to know "MaxPlayers". However, I can pass this value to "GameServerData", but it would be better to get it in the usual way that the function provides.

avatar image Citrus Yan Nikita Matusevich · Oct 11, 2019 at 03:39 AM 0
Share

So, you are saying that all the property are returned in this list except for "MaxPlayers" and "LastHeartbeat", is that right? If that's the case, can you provide your title id so we can investigate it, thanks.

avatar image Nikita Matusevich Citrus Yan · Oct 11, 2019 at 09:30 AM 0
Share

Ok, here is the project ID : "BDA22". Just create a new server and game to check. But when you start the game, be sure to add to the custom data:

{\"Map\":\"LVL_Test\"}
Otherwise, the server itself will shut down, because will not see this data.

avatar image

Answer by Nikita Matusevich · Oct 11, 2019 at 09:30 AM

Ok, here is the project ID "BDA22". Just create a new server and game to check. But when you start the game, be sure to add to the custom data:

{\"Map\":\"LVL_Test\"}
Otherwise, the server itself will shut down, because will not see this data.

Comment

People who like this

0 Show 1 · 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 Citrus Yan · Oct 14, 2019 at 09:15 AM 0
Share

Hi @Nikita Matusevich, I checked your title and configuration seems alright. However, I don't have permission to start a game server and check. It would be extremely helpful if you can provide the steps to reproduce associated with necessary screenshots, feel free to remove sensitive information. I'll report this to the engineering team to investigate

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

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    PlayFab Multiplayer 1 Answer

    ​How can a client launch their game server via "Server 2.0" with custom settings? 1 Answer

    There is a problem with the certificate when using the container. 1 Answer

    No confirmation email is received. 5 Answers

    Multiplayer 2.0 StartGame Procedure? 2 Answers

    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