From a8dbeb6865b6f9da65d43627c06aa482eea7d139 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 4 Nov 2022 02:22:01 +0300 Subject: [PATCH 1/3] new fake games --- gameUtils/fakeGames.go | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/gameUtils/fakeGames.go b/gameUtils/fakeGames.go index 49df69b..28ffbd8 100644 --- a/gameUtils/fakeGames.go +++ b/gameUtils/fakeGames.go @@ -3,12 +3,7 @@ package gameUtils var garrysmodGame = SteamGame{ GameId: "garrysmod", SteamId: "4000", - Args: []Argument{ - Argument{ - Body: "+connect", - Value: "127.0.0.1:27015", - }, - }, + Args: []Argument{}, Platforms: map[string]bool{ "linux": true, "windows": true, @@ -21,10 +16,9 @@ var garrysmodGame = SteamGame{ } var openarena = SteamGame{ - GameId: "openarena", - SteamId: "", - //Executable: "/usr/games/openarena", - //Args: []string{}, + GameId: "half-life-1", + SteamId: "70", + Args: []Argument{}, Assets: GameInterfaceAssets{ Title: "Open Arena", Icon: "icon.png", @@ -32,16 +26,4 @@ var openarena = SteamGame{ }, } -var minecraft = SteamGame{ - GameId: "minecraft", - SteamId: "", - //Args: []string{}, - Assets: GameInterfaceAssets{ - Title: "Minecraft", - Icon: "icon.png", - Description: "Minecraft Game", - }, - Platforms: map[string]bool{}, -} - -var SteamFakeGamesList = []SteamGame{garrysmodGame, openarena, minecraft} +var SteamFakeGamesList = []SteamGame{garrysmodGame, openarena} From 948e31d4e3c19ad2a0520b8966cfe8b917b2264f Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 4 Nov 2022 02:22:51 +0300 Subject: [PATCH 2/3] fake sessions and arguments in sessions --- sessionUtils/sessionTypes.go | 15 +++++++++------ sessionUtils/sessionUtils.go | 18 ++++++++++++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/sessionUtils/sessionTypes.go b/sessionUtils/sessionTypes.go index 88d7408..8c762ce 100644 --- a/sessionUtils/sessionTypes.go +++ b/sessionUtils/sessionTypes.go @@ -2,15 +2,18 @@ package sessionUtils import ( "time" + + "git.gregbrzezinski.com/Skirda/skirdaGoBackend/skirdagoutils/gameUtils" ) type Session struct { - GameId string - Icon string - Title string - Status string - Version string - Expires time.Time + GameId string + Icon string + Title string + Status string + Version string + Expires time.Time + Arguments []gameUtils.Argument } type JSSessionInterface struct { diff --git a/sessionUtils/sessionUtils.go b/sessionUtils/sessionUtils.go index 9a75c42..8b4b4f8 100644 --- a/sessionUtils/sessionUtils.go +++ b/sessionUtils/sessionUtils.go @@ -3,6 +3,8 @@ package sessionUtils import ( "encoding/json" "time" + + "git.gregbrzezinski.com/Skirda/skirdaGoBackend/skirdagoutils/gameUtils" ) func ConvertServerSessionsToJSON(s Session) []byte { @@ -14,14 +16,22 @@ func ConvertServerSessionsToJSON(s Session) []byte { var FakeSessions = []Session{ { GameId: "garrysmod", - Title: "Test 1", + 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: "beamng", - Title: "Test 2", - Status: "Super fake session 2", + GameId: "half-lide-1", + Title: "Half-Life 1 МЯСО", + Status: "Retro shit", Expires: time.Time{}, }, { From f5ce5468a8e83320b90a0fe2c50930a15023a3d6 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 4 Nov 2022 03:03:05 +0300 Subject: [PATCH 3/3] merge session utils --- sessionUtils/sessionUtils.go | 52 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/sessionUtils/sessionUtils.go b/sessionUtils/sessionUtils.go index 8b4b4f8..a5c78f0 100644 --- a/sessionUtils/sessionUtils.go +++ b/sessionUtils/sessionUtils.go @@ -13,32 +13,34 @@ func ConvertServerSessionsToJSON(s Session) []byte { return s_json } -var FakeSessions = []Session{ - { - GameId: "garrysmod", - 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", +var FakeSessions = Sessions{ + Sessions: []Session{ + { + GameId: "garrysmod", + 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{}, + { + 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{}, + }, }, }