(un string)
| 538 | } |
| 539 | |
| 540 | func (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 | |
| 556 | func (u *UserRecord) TempName() string { |
| 557 | hasher := md5.New() |
no test coverage detected