2022-10-28 12:27:34 +00:00
|
|
|
package sessionUtils
|
|
|
|
|
2022-10-28 15:23:14 +00:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
2022-11-02 09:53:47 +00:00
|
|
|
"time"
|
2022-10-28 15:23:14 +00:00
|
|
|
)
|
2022-10-28 12:27:34 +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
|
|
|
|
|
|
|
var FakeSessions = []Session{
|
|
|
|
{
|
|
|
|
GameId: "garrysmod",
|
|
|
|
Title: "Test 1",
|
|
|
|
Status: "Super fake session",
|
|
|
|
Expires: time.Time{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
GameId: "beamng",
|
|
|
|
Title: "Test 2",
|
|
|
|
Status: "Super fake session 2",
|
|
|
|
Expires: time.Time{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
GameId: "minecraft",
|
|
|
|
Title: "Test 3",
|
|
|
|
Status: "Testing session",
|
|
|
|
Version: "1.54.7",
|
|
|
|
Expires: time.Time{},
|
|
|
|
},
|
|
|
|
}
|