1
This commit is contained in:
parent
8ff8c10ba1
commit
07cb052c8c
@ -7,6 +7,7 @@ import (
|
||||
"main/constant"
|
||||
"fmt"
|
||||
"mt"
|
||||
"strings"
|
||||
. "main/global"
|
||||
)
|
||||
|
||||
@ -89,6 +90,10 @@ func (this *guildMgr) isNameTooLong(name string) bool {
|
||||
return len(name) > 15
|
||||
}
|
||||
|
||||
func (this *guildMgr) isValidName(name string) bool {
|
||||
return !strings.Contains(name, "!")
|
||||
}
|
||||
|
||||
func (this *guildMgr) GetGuildByGuildId(guildId string) common.Guild {
|
||||
if p := this.internalGetGuildByGuildId(guildId); p != nil {
|
||||
return p
|
||||
@ -287,6 +292,11 @@ func (this *guildMgr) AsyncCreateGuild(accountId string, sessionId string, avata
|
||||
cb(2, "Name is to long", "")
|
||||
return
|
||||
}
|
||||
if !this.isValidName(name) {
|
||||
task.SetFail()
|
||||
cb(2, "Name is invalid", "")
|
||||
return
|
||||
}
|
||||
if this.GetGuildByAccountId(accountId) != nil {
|
||||
task.SetFail()
|
||||
cb(3, "You already have a cube", "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user