【名字】添加名称正确性检测
parent
c3820f13ae
commit
65df3f1a37
|
|
@ -46,6 +46,10 @@ end
|
|||
|
||||
-- 请求创建公会
|
||||
function GuildManager.RequestCreateGuild(name, announce, func)
|
||||
if not NameManager.CheckStringRight(name) then
|
||||
PopupTipPanel.ShowTip("名字不合法")
|
||||
return
|
||||
end
|
||||
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GUILD) then
|
||||
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.GUILD))
|
||||
return
|
||||
|
|
|
|||
|
|
@ -368,6 +368,10 @@ end
|
|||
|
||||
-- 请求修改公会名称
|
||||
function MyGuildManager.RequestChangeGuildName(name, func)
|
||||
if not NameManager.CheckStringRight(name) then
|
||||
PopupTipPanel.ShowTip("名字不合法")
|
||||
return
|
||||
end
|
||||
local pos = this.GetMyPositionInGuild()
|
||||
if pos == GUILD_GRANT.MEMBER then
|
||||
PopupTipPanel.ShowTip(Language[10962])
|
||||
|
|
|
|||
|
|
@ -57,8 +57,19 @@ function this.GetRandomNameData()
|
|||
end)
|
||||
end
|
||||
|
||||
-- 字符正确性检测
|
||||
function this.CheckStringRight(str)
|
||||
if string.find(str, "|") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
--更改玩家姓名
|
||||
function this.ChangeUserName(type, name, teamPosId, sex, callBack)
|
||||
if not this.CheckStringRight(name) then
|
||||
PopupTipPanel.ShowTip("名字不合法")
|
||||
return
|
||||
end
|
||||
NetManager.ChangeUserNameRequest(type, name, teamPosId, sex, function()
|
||||
this.roleSex = sex
|
||||
this.roleName = name
|
||||
|
|
|
|||
Loading…
Reference in New Issue