sharedutils/sessionUtils/sessionUtils.go

47 lines
857 B
Go
Raw Normal View History

package sessionUtils
2022-10-28 15:23:14 +00:00
import (
"encoding/json"
2022-11-02 09:53:47 +00:00
"time"
"git.gregbrzezinski.com/Skirda/skirdaGoBackend/skirdagoutils/gameUtils"
2022-10-28 15:23:14 +00:00
)
func ConvertServerSessionsToJSON(s Session) []byte {
s_json, err := json.Marshal(s)
_ = err //TODO: Check Errors
return s_json
}
2022-11-02 09:53:47 +00:00
2022-11-04 00:03:05 +00:00
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",
},
},
},
2022-11-04 00:03:05 +00:00
{
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{},
},
2022-11-02 09:53:47 +00:00
},
}