mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
## Description We are attempting to hookup maitred to the API Maitred duties will be: - [ ] Hookup to the API - [ ] Wait for signal (from the API) to start Steam - [ ] Stop signal to stop the gaming session, clean up Steam... and maybe do the backup ## Summary by CodeRabbit - **New Features** - Introduced Docker-based deployment configurations for both the main and relay applications. - Added new API endpoints enabling real-time machine messaging and enhanced IoT operations. - Expanded database schema and actor types to support improved machine tracking. - **Improvements** - Enhanced real-time communication and relay management with streamlined room handling. - Upgraded dependencies, logging, and error handling for greater stability and performance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com> Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com>
18 lines
380 B
Go
18 lines
380 B
Go
package realtime
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
"github.com/oklog/ulid/v2"
|
|
"time"
|
|
)
|
|
|
|
func generateClientID() string {
|
|
// Create a source of entropy (cryptographically secure)
|
|
entropy := ulid.Monotonic(rand.Reader, 0)
|
|
// Generate a new ULID
|
|
id := ulid.MustNew(ulid.Timestamp(time.Now()), entropy)
|
|
// Create the client ID string
|
|
return fmt.Sprintf("mch_%s", id.String())
|
|
}
|