feat: better getPlayer middleware setup
This commit is contained in:
@@ -106,11 +106,11 @@ func getPlayer(players engine.Players) func(next http.Handler) http.Handler {
|
||||
player, err := players.Register(ctx, playerId, client, r.Header.Get("user-agent"), ip)
|
||||
if err != nil {
|
||||
log.Error("Could not register player", "userName", userName, "client", client)
|
||||
} else {
|
||||
ctx = context.WithValue(ctx, "player", *player)
|
||||
r = r.WithContext(ctx)
|
||||
}
|
||||
|
||||
ctx = context.WithValue(ctx, "player", *player)
|
||||
r = r.WithContext(ctx)
|
||||
|
||||
cookie := &http.Cookie{
|
||||
Name: playerIDCookieName(userName),
|
||||
Value: player.ID,
|
||||
|
||||
Reference in New Issue
Block a user