mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-13 01:05:37 +02:00
>Adds `maitred` in charge of handling automated game installs, updates,
and even execution.
>Not only that, we have the hosted stuff here
>- [x] AWS Task on ECS GPUs
>- [ ] Add a service to listen for game starts and stops
(docker-compose.yml)
>- [x] Add a queue for requesting a game to start
>- [x] Fix up the play/watch UI
>TODO:
>- Add a README
>- Add an SST docs
Edit:
- This adds a new landing page, updates the homepage etc etc
>I forgot what the rest of the updated stuff are 😅
32 lines
628 B
Go
32 lines
628 B
Go
package party
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"time"
|
|
|
|
"math/rand"
|
|
|
|
"github.com/charmbracelet/log"
|
|
"github.com/oklog/ulid/v2"
|
|
)
|
|
|
|
var (
|
|
infoLogger = log.NewWithOptions(os.Stderr, log.Options{
|
|
ReportTimestamp: true,
|
|
TimeFormat: time.Kitchen,
|
|
// Prefix: "Realtime",
|
|
})
|
|
)
|
|
|
|
func generateClientID() string {
|
|
// Create a source of entropy (use cryptographically secure randomness in production)
|
|
entropy := rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
|
// Generate a new ULID
|
|
id := ulid.MustNew(ulid.Timestamp(time.Now()), entropy)
|
|
|
|
// Create the client ID string
|
|
return fmt.Sprintf("client_%s", id.String())
|
|
}
|