feat: game lobby service
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user