mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): reconcile authoritative initial connections
This commit is contained in:
@@ -87,6 +87,19 @@ func ServerShutdownerFromStore(db *sql.DB) ServerShutdowner {
|
||||
return postgresServerShutdowner{db: db}
|
||||
}
|
||||
|
||||
type postgresServerConnections struct{ db *sql.DB }
|
||||
|
||||
func (p postgresServerConnections) RecordPlayerConnected(ctx context.Context, binding domain.WorkloadBinding, playerID, idempotencyKey string, now time.Time) error {
|
||||
return store.RecordPlayerConnected(ctx, p.db, binding, playerID, idempotencyKey, now)
|
||||
}
|
||||
|
||||
func ServerConnectionsFromStore(db *sql.DB) ServerConnectionRecorder {
|
||||
if db == nil {
|
||||
return nil
|
||||
}
|
||||
return postgresServerConnections{db: db}
|
||||
}
|
||||
|
||||
// WorkloadVerifierFromSignedToken builds WorkloadVerify from a control-plane
|
||||
// -owned signed token instead of a Kubernetes-projected JWT (see
|
||||
// workload/signed_token.go for why: it needs no live cluster to verify).
|
||||
|
||||
Reference in New Issue
Block a user