get player ids from sessions, not ips
This commit is contained in:
@@ -15,6 +15,15 @@ type Session struct {
|
||||
uuid.UUID
|
||||
}
|
||||
|
||||
// ParseSession parses a session ID.
|
||||
func ParseSession(s string) (Session, error) {
|
||||
id, err := uuid.Parse(s)
|
||||
if err != nil {
|
||||
return Session{}, fmt.Errorf("couldn't parse session ID: %w", err)
|
||||
}
|
||||
return Session{id}, nil
|
||||
}
|
||||
|
||||
// InitSessions initializes an SQLite table relating player IDs to sessions.
|
||||
func InitSessions(ctx context.Context, db Execer) error {
|
||||
_, err := db.Exec(ctx, initSessions)
|
||||
|
Reference in New Issue
Block a user