diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index 0fb4bb7eff..8f2e9c9ce2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -247,9 +247,7 @@ function this.GetFormationByID(teamId) local _v=tonumber(v) if teamId==_v and #this.formationList[teamId].teamHeroInfos<=0 then for n = 1, #this.formationList[1].teamHeroInfos do - if HeroManager.GetSingleHeroData(this.formationList[1].teamHeroInfos.heroId) then - table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n]) - end + table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n]) end -- FormationManager.SaveFormation(teamId, this.formationList[teamId].teamHeroInfos, {}) diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/GuildManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/GuildManager.lua index 8274b5783c..14667a6e19 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/GuildManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/GuildManager.lua @@ -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 diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua index da79db141d..d04f07e0fb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua @@ -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]) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/NameManager.lua b/Assets/ManagedResources/~Lua/Modules/Popup/NameManager.lua index 6dd2e38d7c..2d4b6b1295 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/NameManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/NameManager.lua @@ -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