From ce8d180154b4baf6c897cad023fa256c74e35bd8 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 11 Nov 2022 12:18:59 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20'sessionUtils/sessionTypes.go'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sessionUtils/sessionTypes.go | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 sessionUtils/sessionTypes.go diff --git a/sessionUtils/sessionTypes.go b/sessionUtils/sessionTypes.go deleted file mode 100644 index f6c1ebb..0000000 --- a/sessionUtils/sessionTypes.go +++ /dev/null @@ -1,28 +0,0 @@ -package sessionUtils - -import ( - "time" - - "git.gregbrzezinski.com/Skirda/skirdagoutils/gameUtils" -) - -type Session struct { - SessionId string - GameId string - Assets gameUtils.GameInterfaceAssets - Expires time.Time - Arguments []gameUtils.Argument -} - -type Sessions struct { - Sessions []Session -} - -type JSSessionInterface struct { - GameID string `json:"gameId"` - Icon string `json:"icon"` - Title string `json:"title"` - Status string `json:"status"` - Version string `json:"version"` - Expires time.Time `json:"expires"` -} From e2502298a931ff19a78c985a1de46cc0917a6cc3 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 11 Nov 2022 12:19:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20'sessionUtils/sessionUtils.go'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sessionUtils/sessionUtils.go | 54 ------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 sessionUtils/sessionUtils.go diff --git a/sessionUtils/sessionUtils.go b/sessionUtils/sessionUtils.go deleted file mode 100644 index 382d641..0000000 --- a/sessionUtils/sessionUtils.go +++ /dev/null @@ -1,54 +0,0 @@ -package sessionUtils - -import ( - "encoding/json" -) - -func ConvertServerSessionsToJSON(s Session) []byte { - s_json, err := json.Marshal(s) - _ = err //TODO: Check Errors - 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{}, -// }, -// }, -// } - -func FindSessionByID(sessionId string, sessions []Session) Session { - for _, session := range sessions { - if session.SessionId == sessionId { - return session - } - } - var temp Session = Session{} - return temp -}