Parcourir la source

feat: added ActiveClients to player state (backend)

Fela Maslen il y a 4 ans
Parent
commit
d5b7696873
1 fichiers modifiés avec 8 ajouts et 9 suppressions
  1. 8 9
      gmus-backend/pkg/server/types.go

+ 8 - 9
gmus-backend/pkg/server/types.go

@@ -26,18 +26,17 @@ type Member struct {
 // an action across first should cause the other to obey the instruction
 // and treat the first as master.
 //
-// The master client is responsible for:
-// 1. Playing the music
-// 2. Keeping the server updated regularly about the current state
+// The master client is responsible for keeping the server updated regularly about the current state
 //
 // This type here is merely used for validation of client state messages.
 // Each client implementation MUST adhere to this spec.
 
 type MusicPlayer struct {
-	SongId      *int    `json:"songId" validate:"omitempty,gte=1"`
-	Playing     bool    `json:"playing" validate:"-"`
-	CurrentTime float32 `json:"currentTime" validate:"gte=0"`
-	SeekTime    float32 `json:"seekTime" validate:"min=-1"`
-	Master      string  `json:"master" validate:"required"`
-	Queue       *[]int  `json:"queue" validate:"required"`
+	SongId        *int      `json:"songId" validate:"omitempty,gte=1"`
+	Playing       bool      `json:"playing" validate:"-"`
+	CurrentTime   float32   `json:"currentTime" validate:"gte=0"`
+	SeekTime      float32   `json:"seekTime" validate:"min=-1"`
+	Master        string    `json:"master" validate:"required"`
+	ActiveClients *[]string `json:"activeClients" validate:"required"`
+	Queue         *[]int    `json:"queue" validate:"required"`
 }