Format bot account names
This commit is contained in:
parent
5ec74dd3db
commit
86cc2df9cd
1 changed files with 13 additions and 1 deletions
|
@ -646,8 +646,20 @@ COMMANDS:
|
|||
cmd.client.Terminate("No account was found with the provided username and password. To log in as a guest, do not enter a password.")
|
||||
continue
|
||||
}
|
||||
|
||||
var name []byte
|
||||
if bytes.HasPrefix(a.username, []byte("bot_")) {
|
||||
name = append([]byte("BOT_"), a.username[4:]...)
|
||||
} else {
|
||||
name = a.username
|
||||
}
|
||||
if s.clientByUsername(name) != nil {
|
||||
cmd.client.Terminate("That username is already in use.")
|
||||
continue
|
||||
}
|
||||
|
||||
cmd.client.account = a.id
|
||||
cmd.client.name = a.username
|
||||
cmd.client.name = name
|
||||
cmd.client.sendEvent(&bgammon.EventSettings{
|
||||
Highlight: a.highlight,
|
||||
Pips: a.pips,
|
||||
|
|
Loading…
Reference in a new issue