I could find any reference to this in the documentation.
I would like to have teams persist even when the team leader leaves the team by transferring the ownership of the team to another team member. Is this possible and if so how can I achieve that.
Thanks,
Best Answer
M
Martin Climatiano
said
over 4 years ago
Resolved this by digging through the API documentation object by object.
For future reference, changing team ownership can be done by fetching the team object in Cloud Code and calling setOwnerId.
For example:
// Get the Spark backing team object
var team = Spark.getTeams().getTeam( clan.teamId );
Martin Climatiano
Hi,
I could find any reference to this in the documentation.
I would like to have teams persist even when the team leader leaves the team by transferring the ownership of the team to another team member. Is this possible and if so how can I achieve that.
Thanks,
Resolved this by digging through the API documentation object by object.
For future reference, changing team ownership can be done by fetching the team object in Cloud Code and calling setOwnerId.
For example:
// Get the Spark backing team object
var team = Spark.getTeams().getTeam( clan.teamId );
team.setOwnerId( clan.members[ newLeaderIndex ].id );
Martin Climatiano
Resolved this by digging through the API documentation object by object.
For future reference, changing team ownership can be done by fetching the team object in Cloud Code and calling setOwnerId.
For example:
// Get the Spark backing team object
var team = Spark.getTeams().getTeam( clan.teamId );
team.setOwnerId( clan.members[ newLeaderIndex ].id );
2 people like this
-
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