question

pprkgraphiks avatar image
pprkgraphiks asked

Is there any way to get GameServerData to be Null in GetCurrentGames api?

Good morning. When room maker open DedicatedServer, I want to create a logic so that room maker connects to where GameServerData is Null. I wonder if there is a way to make it accessible only to the null. I see Tag Filter on the GetCurrentGames Api, and I wonder if it will be able to load a list with nulls.

Thanks for read my thread :)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The game server instance data is null by default. You have to call SetGameServerInstanceData to set it to something non-null. Tag filters are for filtering the games returned on their server instance tags, which are separate from data. Could you explain in more detail what the experience is you're trying to enable? Starting with a top-down view - your design goals - is usually the best way to come up with how to implement the feature you need.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pprkgraphiks avatar image
pprkgraphiks answered

Briefly, what we are doing is that when the client presses the Create Room button to create a room, the Dedicated Server window appears on our server. But the problem is that we do not know whose port or who the Dedicated Server was created before. It's a problem. So I designed it. Where the GameServerData is empty, the room creator first wants to create a way to first enter and register the string variable contained in its Controller class in GameServerData. So we want to extract the empty GameServerData first through the TagFilter of the GetCurrentGames API. But how do i use this specifically?

I understand how to create a Playfab json object reference,

which is an example of the GetCurrentGames api Https://api.playfab.com/documentation/client/method/GetCurrentGames

Ex)

"TagFilter": { "Includes": [ { "Data": { "Level_cap": "0" } } ], "Excludes": [ { "Data": { "Newbie": "0" } } ] }

How do I get a list of Games, with the exception of a specific LobbyID, in conjunction with this?

"Excludes": [ { "Data": { "Games": [{"LobbyID": "8324929052911135091"}} } } ] I try to apply it too.

LobbyID: 8324929052911135091 I've tried it all, and I've done it.

I would appreciate it if you let me know how to write it.


tagfilter.jpg (86.1 KiB)
8 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

So, to rephrase, you want to use GetCurrentGames to get the list of currently in-progress games, and then decide which one the player should join using your own custom logic - is that correct? If so, the GameInfo for each game listed in the response contains all the GameServerData and Tags for the server in question, which would allow you to do any local sorting or filtering you like. You can also optionally filter the games you get back using the Tags, but it sounds like you're asking about how to filter based upon the custom data on the server, which I'm afraid isn't an option. I would recommend coming up with a set of keys instead, which represent the key information you want to filter on, and applying those as Tags on the server, so that you can use them for filtering.

0 Likes 0 ·
pprkgraphiks avatar image pprkgraphiks brendan commented ·

@Brendan Can you tell which api is the api that can set the key to filter? If you use the corresponding API, I wonder if you can classify it in Tag Filter of GetCurrentGames API.

0 Likes 0 ·
brendan avatar image brendan pprkgraphiks commented ·

https://api.playfab.com/documentation/server/method/SetGameServerInstanceTags

And yes, that information is available from GetCurrentGames, so you can indeed use it that way.

0 Likes 0 ·
Show more comments
pprkgraphiks avatar image pprkgraphiks commented ·

In conclusion, I would like to import Games except for the value of the GameServerData: Roomname example below. I would appreciate it if you could teach me how to write.

0 Likes 0 ·
responce-json.jpg (159.8 KiB)
brendan avatar image brendan pprkgraphiks commented ·

We do not provide filtering on GameServerData - you would need to use Tags on the server for filtering.

But again, could you clarify what the game play experience is that you're trying to enable? What is the user experience that you need? If we can get a clear picture of what the actual gameplay experience is like, I'm sure we can help to design the right technical approach.

1 Like 1 ·
pprkgraphiks avatar image pprkgraphiks brendan commented ·

Thank you. @Brendan I solved it with your help! :)

0 Likes 0 ·

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.