Hook request: OnTeamMemberPromotedSuggestion

I'm unable to properly detect when a team member is promoted. The existing hook OnTeamMemberPromote is helpful for preventing a promotion but does not mean the promotion actually occured. I would like to recommend adding the hook OnTeamMemberPromoted which would be called after the promotion takes place.

Thanks in advance for the consideration.

Usage within RelationshipManager.PlayerTeam.SetTeamLeader

public void SetTeamLeader(ulong newTeamLeader)
{
if (Interface.CallHook("OnTeamMemberPromote", (object) this, (object) newTeamLeader) != null)
return;
Facepunch.Rust.Analytics.Azure.OnTeamChanged("promoted", this.teamID, this.teamLeader, newTeamLeader, this.members);
ulong oldTeamLeader = this.teamLeader
this.teamLeader = newTeamLeader;
this.MarkDirty()
Interface.CallHook("OnTeamMemberPromoted", (object) this, (object) oldTeamLeader, (object) newTeamLeader)

}

Documentation

void OnTeamMemberPromoted(RelationshipManager.PlayerTeam team, ulong oldTeamLeader, ulong newTeamLeader)
{
    Puts("OnTeamMemberPromoted works!");
}

Just check in nexttick if there the team leader. adding more hooks to the same method is unnessary.

Great idea, thanks.

I'd still prefer a hook though. Umod has already adopted the pre-action and post-action hook patterns in other areas. I figured it would be appropriate.

you caould also use this as its called from MarkDirty somewhere i beleve.

object OnTeamUpdated(ulong currentTeam, PlayerTeam playerTeam, BasePlayer player)
{
    Puts("OnTeamUpdate works!");
    return null;
}​

Within MarkDirty, both OnTeamUpdate and OnTeamUpdated are called in the context of each member's team information changing (promotion/roster/ping/marker/connection state changes) which occurs far more often than I need for my purpose.

I'll stick to OnTeamMemberPromote and using NextTick to check for leadership changes for now.