@@ -143,7 +143,7 @@ type Participants struct {
143143}
144144
145145// ByUserID returns all currently connected players in a map where the key is the user-ID.
146- // The map is a snapshot and is not updated (not a reference to the actual, underlying map).
146+ // The returned map is a snapshot and is not updated on changes (not a reference to the actual, underlying map).
147147// Includes spectators.
148148func (ptcp Participants ) ByUserID () map [int ]* common.Player {
149149 res := make (map [int ]* common.Player )
@@ -154,7 +154,7 @@ func (ptcp Participants) ByUserID() map[int]*common.Player {
154154}
155155
156156// ByEntityID returns all currently connected players in a map where the key is the entity-ID.
157- // The map is a snapshot and is not updated (not a reference to the actual, underlying map).
157+ // The returned map is a snapshot and is not updated on changes (not a reference to the actual, underlying map).
158158// Includes spectators.
159159func (ptcp Participants ) ByEntityID () map [int ]* common.Player {
160160 res := make (map [int ]* common.Player )
@@ -165,6 +165,7 @@ func (ptcp Participants) ByEntityID() map[int]*common.Player {
165165}
166166
167167// All returns all currently connected players & spectators.
168+ // The returned slice is a snapshot and is not updated on changes.
168169func (ptcp Participants ) All () []* common.Player {
169170 res := make ([]* common.Player , 0 , len (ptcp .playersByUserID ))
170171 for _ , p := range ptcp .playersByUserID {
@@ -174,6 +175,7 @@ func (ptcp Participants) All() []*common.Player {
174175}
175176
176177// Playing returns all players that aren't spectating or unassigned.
178+ // The returned slice is a snapshot and is not updated on changes.
177179func (ptcp Participants ) Playing () []* common.Player {
178180 res := make ([]* common.Player , 0 , len (ptcp .playersByUserID ))
179181 for _ , p := range ptcp .playersByUserID {
@@ -185,6 +187,7 @@ func (ptcp Participants) Playing() []*common.Player {
185187}
186188
187189// TeamMembers returns all players belonging to the requested team at this time.
190+ // The returned slice is a snapshot and is not updated on changes.
188191func (ptcp Participants ) TeamMembers (team common.Team ) []* common.Player {
189192 res := make ([]* common.Player , 0 , len (ptcp .playersByUserID ))
190193 for _ , ptcp := range ptcp .playersByUserID {
0 commit comments