From c3820f13ae0345c097771051374147ff3eb60237 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 23 Sep 2021 19:42:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E7=BC=96=E9=98=9F=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=A4=8D=E5=88=B6=E7=BC=96?= =?UTF-8?q?=E9=98=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Formation/FormationManager.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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, {}) From 65df3f1a373d10945decf047706dc73e70ce5ba1 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 23 Sep 2021 19:43:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E5=90=8D=E5=AD=97=E3=80=91?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=8D=E7=A7=B0=E6=AD=A3=E7=A1=AE=E6=80=A7?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Guild/GuildManager.lua | 4 ++++ .../~Lua/Modules/Guild/MyGuildManager.lua | 4 ++++ .../~Lua/Modules/Popup/NameManager.lua | 11 +++++++++++ 3 files changed, 19 insertions(+) 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