From c29d02423f05ee9ab1cbbeca70c8afab7a0c4a86 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Mon, 7 Nov 2022 15:22:09 +0300 Subject: [PATCH] delete fake session from utils and add assets to utils --- sessionUtils/sessionTypes.go | 5 +-- sessionUtils/sessionUtils.go | 67 +++++++++++++++++------------------- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/sessionUtils/sessionTypes.go b/sessionUtils/sessionTypes.go index eeacc4e..f6c1ebb 100644 --- a/sessionUtils/sessionTypes.go +++ b/sessionUtils/sessionTypes.go @@ -9,10 +9,7 @@ import ( type Session struct { SessionId string GameId string - Icon string - Title string - Status string - Version string + Assets gameUtils.GameInterfaceAssets Expires time.Time Arguments []gameUtils.Argument } diff --git a/sessionUtils/sessionUtils.go b/sessionUtils/sessionUtils.go index b5538bb..382d641 100644 --- a/sessionUtils/sessionUtils.go +++ b/sessionUtils/sessionUtils.go @@ -2,9 +2,6 @@ package sessionUtils import ( "encoding/json" - "time" - - "git.gregbrzezinski.com/Skirda/skirdagoutils/gameUtils" ) func ConvertServerSessionsToJSON(s Session) []byte { @@ -13,38 +10,38 @@ func ConvertServerSessionsToJSON(s Session) []byte { return s_json } -var FakeSessions = Sessions{ - Sessions: []Session{ - { - GameId: "garrysmod", - SessionId: "gmod-test", - Icon: "", - Title: "Regular Skirda Gmod server", - Status: "Super fake session", - Version: "", - Expires: time.Time{}, - Arguments: []gameUtils.Argument{ - { - Body: "+connect", - Value: "127.0.0.1:27015", - }, - }, - }, - { - GameId: "half-lide-1", - Title: "Half-Life 1 МЯСО", - Status: "Retro shit", - Expires: time.Time{}, - }, - { - GameId: "minecraft", - Title: "Test 3", - Status: "Testing session", - Version: "1.54.7", - Expires: time.Time{}, - }, - }, -} +// var FakeSessions = Sessions{ +// Sessions: []Session{ +// { +// GameId: "garrysmod", +// SessionId: "gmod-test", +// Icon: "", +// Title: "Regular Skirda Gmod server", +// Status: "Super fake session", +// Version: "", +// Expires: time.Time{}, +// Arguments: []gameUtils.Argument{ +// { +// Body: "+connect", +// Value: "127.0.0.1:27015", +// }, +// }, +// }, +// { +// GameId: "half-lide-1", +// Title: "Half-Life 1 МЯСО", +// Status: "Retro shit", +// Expires: time.Time{}, +// }, +// { +// GameId: "minecraft", +// Title: "Test 3", +// Status: "Testing session", +// Version: "1.54.7", +// Expires: time.Time{}, +// }, +// }, +// } func FindSessionByID(sessionId string, sessions []Session) Session { for _, session := range sessions {