feat: game lobby service

This commit is contained in:
Ilia Denisov
2026-04-25 23:20:55 +02:00
committed by GitHub
parent 32dc29359a
commit 48b0056b49
336 changed files with 57074 additions and 1418 deletions
+12 -4
View File
@@ -182,8 +182,13 @@ type ProfileChangedEvent struct {
// Operation stores the profile-change event kind.
Operation ProfileChangedOperation
// RaceName stores the latest exact race name after the commit.
RaceName common.RaceName
// UserName stores the immutable handle associated with the account at the
// moment the event is published.
UserName common.UserName
// DisplayName stores the latest display name after the commit. An empty
// value is valid and means no display name is set.
DisplayName common.DisplayName
}
// Validate reports whether event is structurally complete.
@@ -194,8 +199,11 @@ func (event ProfileChangedEvent) Validate() error {
if !event.Operation.IsKnown() {
return fmt.Errorf("profile changed event operation %q is unsupported", event.Operation)
}
if err := event.RaceName.Validate(); err != nil {
return fmt.Errorf("profile changed event race name: %w", err)
if err := event.UserName.Validate(); err != nil {
return fmt.Errorf("profile changed event user name: %w", err)
}
if err := event.DisplayName.Validate(); err != nil {
return fmt.Errorf("profile changed event display name: %w", err)
}
return nil