diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bdb0491383fb90577004f937d0317a530403cfa..82f2b394820d845ea246db6e3113d267423fcb11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] +### Added +- Event contexts now contain user information for external events. + ### Fixed - Add missing 'rank' field from the Lua runtime `tournament_records_haystack` function results. diff --git a/server/api_event.go b/server/api_event.go index 12d4d1e5989bd0124f031829c4d533837b574220..981443371319830d7096add1631421660e79f4d9 100644 --- a/server/api_event.go +++ b/server/api_event.go @@ -53,7 +53,9 @@ func (s *ApiServer) Event(ctx context.Context, in *api.Event) (*empty.Empty, err // Add event to processing queue if there are any event handlers registered. if fn := s.runtime.Event(); fn != nil { - fn(ctx, in) + clientIP, clientPort := extractClientAddressFromContext(s.logger, ctx) + evtCtx := NewRuntimeGoContext(ctx, s.config.GetName(), s.config.GetRuntime().Environment, RuntimeExecutionModeEvent, nil, ctx.Value(ctxExpiryKey{}).(int64), ctx.Value(ctxUserIDKey{}).(uuid.UUID).String(), ctx.Value(ctxUsernameKey{}).(string), ctx.Value(ctxVarsKey{}).(map[string]string), "", clientIP, clientPort) + fn(evtCtx, in) } // After hook.