We've been struggling lately about how to show a (limited) list of teams to the player. We want them to be able to get a 15 to 20 teams list in order to be able to join them. That said, we also would like them to perform partial searches, e.g. we would have a text input where they can start typing the begining of the team name they want to join and list all those that match that name criteria.
After checking against the Dashboard we've seen that is only possible to query the teams the player belongs to, but not a list given a custom query or similar.
Is this doable?
Cheers!
Best Answer
C
Customer Support
said
almost 5 years ago
Hi Christian,
You are correct that by default it is only possible to query the teams the user is involved in.
In order to achieve the functionality you're looking for, I'd recommend creating a simple runtime collection storing team names, ids, player numbers, and a flag indicating whether or not the team is full.
- Each time a team is created, add an entry for it to this collection.
- Each time a team is dropped, remove it from the collection.
- Each time a player leaves a team, decrement the player count.If the team was previously full, change the flag to indicate there is now space for a player.
- Each time a player joins a team, increment the player count and check it against the team's max players (Spark.getConfig().getTeam("shortcode").getMaxMembers()). If the team is now full, set the flag to indicate as such.
You could then query this collection by team name and send a GetTeamRequest with the corresponding team id to get the team's details.
Let us know if you have any more questions on implementing this.
You are correct that by default it is only possible to query the teams the user is involved in.
In order to achieve the functionality you're looking for, I'd recommend creating a simple runtime collection storing team names, ids, player numbers, and a flag indicating whether or not the team is full.
- Each time a team is created, add an entry for it to this collection.
- Each time a team is dropped, remove it from the collection.
- Each time a player leaves a team, decrement the player count.If the team was previously full, change the flag to indicate there is now space for a player.
- Each time a player joins a team, increment the player count and check it against the team's max players (Spark.getConfig().getTeam("shortcode").getMaxMembers()). If the team is now full, set the flag to indicate as such.
You could then query this collection by team name and send a GetTeamRequest with the corresponding team id to get the team's details.
Let us know if you have any more questions on implementing this.
Regards,
Vinnie
C
Christian Gascons
said
almost 5 years ago
Hi Vinnie,
Thanks for such a quick response. I was afraid that was going to be the only solution, so I started actually implementing right what you just said. Didn't know about this (Spark.getConfig().getTeam("shortcode").getMaxMembers()) api call though, so good to know!
Christian Gascons
Hi there,
We've been struggling lately about how to show a (limited) list of teams to the player. We want them to be able to get a 15 to 20 teams list in order to be able to join them. That said, we also would like them to perform partial searches, e.g. we would have a text input where they can start typing the begining of the team name they want to join and list all those that match that name criteria.
After checking against the Dashboard we've seen that is only possible to query the teams the player belongs to, but not a list given a custom query or similar.
Is this doable?
Cheers!
Hi Christian,
You are correct that by default it is only possible to query the teams the user is involved in.
In order to achieve the functionality you're looking for, I'd recommend creating a simple runtime collection storing team names, ids, player numbers, and a flag indicating whether or not the team is full.
- Each time a team is created, add an entry for it to this collection.
- Each time a team is dropped, remove it from the collection.
- Each time a player leaves a team, decrement the player count.If the team was previously full, change the flag to indicate there is now space for a player.
- Each time a player joins a team, increment the player count and check it against the team's max players (Spark.getConfig().getTeam("shortcode").getMaxMembers()). If the team is now full, set the flag to indicate as such.
You could then query this collection by team name and send a GetTeamRequest with the corresponding team id to get the team's details.
Let us know if you have any more questions on implementing this.
Regards,
Vinnie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Christian,
You are correct that by default it is only possible to query the teams the user is involved in.
In order to achieve the functionality you're looking for, I'd recommend creating a simple runtime collection storing team names, ids, player numbers, and a flag indicating whether or not the team is full.
- Each time a team is created, add an entry for it to this collection.
- Each time a team is dropped, remove it from the collection.
- Each time a player leaves a team, decrement the player count.If the team was previously full, change the flag to indicate there is now space for a player.
- Each time a player joins a team, increment the player count and check it against the team's max players (Spark.getConfig().getTeam("shortcode").getMaxMembers()). If the team is now full, set the flag to indicate as such.
You could then query this collection by team name and send a GetTeamRequest with the corresponding team id to get the team's details.
Let us know if you have any more questions on implementing this.
Regards,
Vinnie
Christian Gascons
Hi Vinnie,
Thanks for such a quick response. I was afraid that was going to be the only solution, so I started actually implementing right what you just said. Didn't know about this (Spark.getConfig().getTeam("shortcode").getMaxMembers()) api call though, so good to know!
Cheers!
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics