delete fake session from utils and add assets to utils

This commit is contained in:
cyber-dream 2022-11-07 15:22:09 +03:00
parent 15e727c6c3
commit c29d02423f
2 changed files with 33 additions and 39 deletions

View File

@ -9,10 +9,7 @@ import (
type Session struct { type Session struct {
SessionId string SessionId string
GameId string GameId string
Icon string Assets gameUtils.GameInterfaceAssets
Title string
Status string
Version string
Expires time.Time Expires time.Time
Arguments []gameUtils.Argument Arguments []gameUtils.Argument
} }

View File

@ -2,9 +2,6 @@ package sessionUtils
import ( import (
"encoding/json" "encoding/json"
"time"
"git.gregbrzezinski.com/Skirda/skirdagoutils/gameUtils"
) )
func ConvertServerSessionsToJSON(s Session) []byte { func ConvertServerSessionsToJSON(s Session) []byte {
@ -13,38 +10,38 @@ func ConvertServerSessionsToJSON(s Session) []byte {
return s_json return s_json
} }
var FakeSessions = Sessions{ // var FakeSessions = Sessions{
Sessions: []Session{ // Sessions: []Session{
{ // {
GameId: "garrysmod", // GameId: "garrysmod",
SessionId: "gmod-test", // SessionId: "gmod-test",
Icon: "", // Icon: "",
Title: "Regular Skirda Gmod server", // Title: "Regular Skirda Gmod server",
Status: "Super fake session", // Status: "Super fake session",
Version: "", // Version: "",
Expires: time.Time{}, // Expires: time.Time{},
Arguments: []gameUtils.Argument{ // Arguments: []gameUtils.Argument{
{ // {
Body: "+connect", // Body: "+connect",
Value: "127.0.0.1:27015", // Value: "127.0.0.1:27015",
}, // },
}, // },
}, // },
{ // {
GameId: "half-lide-1", // GameId: "half-lide-1",
Title: "Half-Life 1 МЯСО", // Title: "Half-Life 1 МЯСО",
Status: "Retro shit", // Status: "Retro shit",
Expires: time.Time{}, // Expires: time.Time{},
}, // },
{ // {
GameId: "minecraft", // GameId: "minecraft",
Title: "Test 3", // Title: "Test 3",
Status: "Testing session", // Status: "Testing session",
Version: "1.54.7", // Version: "1.54.7",
Expires: time.Time{}, // Expires: time.Time{},
}, // },
}, // },
} // }
func FindSessionByID(sessionId string, sessions []Session) Session { func FindSessionByID(sessionId string, sessions []Session) Session {
for _, session := range sessions { for _, session := range sessions {