use distinct types for player and session ids
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"net/netip"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"git.sunturtle.xyz/studio/shotgun/player"
|
||||
)
|
||||
|
||||
@@ -21,7 +23,7 @@ func WithPlayerID(next http.Handler) http.Handler {
|
||||
http.Error(w, "missing or invalid X-Forwarded-For header; check server configuration", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
id := player.ID(addr.As16())
|
||||
id := player.ID{UUID: uuid.UUID(addr.As16())}
|
||||
ctx := ctxWith(r.Context(), id)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
|
Reference in New Issue
Block a user