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 {
SessionId string
GameId string
Icon string
Title string
Status string
Version string
Assets gameUtils.GameInterfaceAssets
Expires time.Time
Arguments []gameUtils.Argument
}

View File

@ -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 {