question

tranthor avatar image
tranthor asked

Create Matches with specified information,Create match - PlayFab Cocos2d SDK

Hi,

I'm developing a real-time multiplayer game using cocos2d-x 3.17. I would like to use PlayFab as real-time multiplayer framework. I included PlayFab Cocos2d into my project successfully.

The game will have rooms/matches, and a Player could see all the current matches with the following information per match:

  • matchName (label that indicates the room's name)
  • matchPassword (if it's a private match or not)
  • matchSize (current players in the room)
  • matchMaxSize (max players allowed to join into the room)

So I could create a match named "my match!" with a specific password, and i can tell my friend to join to my room called "my match!" with the password. That's the logic I would like to implement.

The question is: can I do it with PlayFab? I mean, can I create a match/room configuring these parameters? (name, password, size etc).

I've searched in PlayFabClientAPI.h and I couldn't find a method for create matches/rooms. I only see MatchMaker functions.

Thanks

,

Hi,

I'm developing a real-time multiplayer game using cocos2d-x 3.17. I would like to use PlayFab as real-time multiplayer framework. I included PlayFab Cocos2d into my project successfully.

The game will have rooms/matches, and a Player could see all the current matches with the following information per match:

  • matchName (label that indicates the room's name)
  • matchPassword (if it's a private match or not)
  • matchSize (current players in the room)
  • matchMaxSize (max players allowed to join into the room)

So I could create a match named "my match!" with a specific password, and i can tell my friend to join to my room called "my match!" with the password.

That's the logic I would like to implement.

The question is: can I do it with PlayFab? I mean, can I create a match/room configuring these parameters? (name, password, size etc).

I've searched in PlayFabClientAPI.h and I couldn't find a method for create matches/rooms. I only see MatchMaker functions.

Thanks

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

·
Seth Du avatar image
Seth Du answered

Multiplayer server 2.0 doesn't support the feature like Lobby/Room, you will need to implement work around. The current Multiplayer server is a session-based service, which integrate with the new matchmaking system.

Password is not supported by PlayFab, in the normal scenario, when a server instance is requested via API call, the property InitialPlayers is required so that the server can verify the connected players. However, if you mean to create room, like a lobby so that players can invite friends, there should be an external agent server for hosting.

In terms of communications between players, you may use Shared Group, and update dialogs via UpdateSharedGroupData API call. Please refer to: https://docs.microsoft.com/en-us/gaming/playfab/features/social/groups/using-shared-group-data

Moreover, please understand that all the Multiplayer 2.0 related APIs are Entity API, and those in Client API set, along with matchmaker, are the legacy custom server.

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.