diff --git a/distribution/sessionTypes.go b/distribution/sessionTypes.go index 0857735..6d9ff63 100644 --- a/distribution/sessionTypes.go +++ b/distribution/sessionTypes.go @@ -17,8 +17,11 @@ type Sessions struct { } type JSSessionInterface struct { - GameID string `json:"gameId"` - SessionId string `json:"sessionId"` - Expires time.Time `json:"expires"` - Assets GameInterfaceAssets `json:"assets"` + GameID string `json:"gameId"` + SessionId string `json:"sessionId"` + Expires time.Time `json:"expires"` + Title string `json:"title"` + Icon string `json:"icon"` + Description string `json:"description"` + Backgrounds []string `json:"backgrounds"` } diff --git a/distribution/sessionUtils.go b/distribution/sessionUtils.go index 4249517..63cccbb 100644 --- a/distribution/sessionUtils.go +++ b/distribution/sessionUtils.go @@ -26,6 +26,19 @@ func FindSessionByID(sessionId string, sessions []Session) Session { } } +func GetJSSessionInterface(s Session) JSSessionInterface { + newInterface := JSSessionInterface{ //TODO: If session icon empty - use game icon + GameID: s.GameId, + SessionId: s.SessionId, + Expires: time.Time{}, + Title: s.Assets.Title, + Icon: s.Assets.Icon, + Description: s.Assets.Description, + Backgrounds: []string{}, //TODO: Complete + } + return newInterface +} + var FakeSessions = Sessions{ //TODO: Move to front Sessions: []Session{ {