[Suggestion] Teams/tags
Closed this issue · 2 comments
I'd like to suggest a team/tag system, (same thing, just different names), saved on the server, players can be in any amount of teams, but teams would not need registration, they'd
sm.interop.teams.join(player: Player, team: string) => bool -- returns true if a change was made, returns false if player was already in the team
sm.interop.teams.leave(player: Player, team: string) => bool -- returns true if a change was made, returns false if player was not in the team
sm.interop.teams.isMember(player: Player, team: string) => bool -- returns true if player was a member of team, false otherwise
sm.interop.teams.membersOf(team: string) => Array<Player> -- returns an array of all the players in the team
sm.interop.teams.getTeams(player: Player) => Array<string> -- returns an array of the teams that the player is in
This could be used for:
-Restricting access to people on a certain team
-AI ignoring players of certain teams
-etc
Interesting proposal. However, I don't think it should be sm.interop's responsibility to keep track of who is in what team, etc. The permission system works by having a mod register a Permission Manager, which is responsible for the saving/loading. The sm.interop.permissions API just provides a common interface. Do you think a similar system could work for this? Or maybe instead, a general Metadata system?
Interesting proposal. However, I don't think it should be sm.interop's responsibility to keep track of who is in what team, etc.
Yeah, I guess so
The permission system works by having a mod register a Permission Manager, which is responsible for the saving/loading. The sm.interop.permissions API just provides a common interface.
Ah, I haven't looked much into the permissions API yet, I'll take a look.
Do you think a similar system could work for this? Or maybe instead, a general Metadata system?
This is a much better idea than what I suggested, having general metadata would be nice, so anyone could configure metadata to set on players/whatever.