MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / SetUsername

Method SetUsername

internal/users/userrecord.go:540–554  ·  view source on GitHub ↗
(un string)

Source from the content-addressed store, hash-verified

538}
539
540func (u *UserRecord) SetUsername(un string) error {
541
542 if err := ValidateName(un); err != nil {
543 return err
544 }
545
546 u.Username = un
547
548 // If no character name, just set it to username for now.
549 if u.Character.Name == "" {
550 u.Character.Name = u.TempName()
551 }
552
553 return nil
554}
555
556func (u *UserRecord) TempName() string {
557 hasher := md5.New()

Callers 2

FinalizeLoginOrCreateFunction · 0.95
apiV1CreateUserFunction · 0.95

Calls 2

TempNameMethod · 0.95
ValidateNameFunction · 0.85

Tested by

no test coverage detected