封号功能和屏蔽一些网络冗余操作
This commit is contained in:
parent
652b75c637
commit
d5afdffecf
@ -463,6 +463,9 @@ local LocalizationGlobalConst =
|
|||||||
ARENA_DESC_42 = "ARENA_DESC_42",
|
ARENA_DESC_42 = "ARENA_DESC_42",
|
||||||
EQUIP_DESC_26 = "EQUIP_DESC_26",
|
EQUIP_DESC_26 = "EQUIP_DESC_26",
|
||||||
EQUIP_DESC_27 = "EQUIP_DESC_27",
|
EQUIP_DESC_27 = "EQUIP_DESC_27",
|
||||||
|
["SEIZED_DESC_1"] ="SEIZED_DESC_1",
|
||||||
|
["SEIZED_DESC_2"] ="SEIZED_DESC_2",
|
||||||
|
["SEIZED_DESC_3"]= "SEIZED_DESC_3",
|
||||||
}
|
}
|
||||||
|
|
||||||
return LocalizationGlobalConst
|
return LocalizationGlobalConst
|
||||||
@ -463,6 +463,9 @@ local localization_global =
|
|||||||
["ARENA_DESC_42"] = "未领取奖励",
|
["ARENA_DESC_42"] = "未领取奖励",
|
||||||
["EQUIP_DESC_26"] = "武器直升{0}级礼包",
|
["EQUIP_DESC_26"] = "武器直升{0}级礼包",
|
||||||
["EQUIP_DESC_27"] = "防具直升{0}级礼包",
|
["EQUIP_DESC_27"] = "防具直升{0}级礼包",
|
||||||
|
["SEIZED_DESC_1"] ="检测到你的账号存在异常,请联系客服或删除账号使用新建账号继续游戏。",
|
||||||
|
["SEIZED_DESC_2"] ="联系客服",
|
||||||
|
["SEIZED_DESC_3"]= "删除账号",
|
||||||
}
|
}
|
||||||
|
|
||||||
return localization_global
|
return localization_global
|
||||||
@ -732,6 +732,7 @@ end
|
|||||||
GConst.ERROR_STR = {
|
GConst.ERROR_STR = {
|
||||||
SUCCESS = "SUCCESS",
|
SUCCESS = "SUCCESS",
|
||||||
NAME_HAS_EXISTED = "NAME_HAS_EXISTED",
|
NAME_HAS_EXISTED = "NAME_HAS_EXISTED",
|
||||||
|
ACCOUNT_BANNED = "ACCOUNT_BANNED",
|
||||||
}
|
}
|
||||||
|
|
||||||
return GConst
|
return GConst
|
||||||
@ -28,6 +28,7 @@ function AccountManager:onDeleteAccount(result)
|
|||||||
local info = LocalData:getLastLoginInfo()
|
local info = LocalData:getLastLoginInfo()
|
||||||
BIReport:postAccountDelete(info.type)
|
BIReport:postAccountDelete(info.type)
|
||||||
ModuleManager.LoginManager:goToLoginScene()
|
ModuleManager.LoginManager:goToLoginScene()
|
||||||
|
LocalData:saveBattleSnapshot({}) -- 清除
|
||||||
else
|
else
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DELETE_ACCOUNT_FAILED))
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DELETE_ACCOUNT_FAILED))
|
||||||
end
|
end
|
||||||
|
|||||||
@ -183,6 +183,21 @@ function LoginManager:loginFinish(data)
|
|||||||
else
|
else
|
||||||
local info = LocalData:getLastLoginInfo()
|
local info = LocalData:getLastLoginInfo()
|
||||||
BIReport:postAccountLoginFailed(info.type, data.err_code)
|
BIReport:postAccountLoginFailed(info.type, data.err_code)
|
||||||
|
if data.err_code == GConst.ERROR_STR.ACCOUNT_BANNED then -- 封号
|
||||||
|
local params = {
|
||||||
|
content = I18N:getGlobalText(I18N.GlobalConst.SEIZED_DESC_1),
|
||||||
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||||
|
okText = I18N:getGlobalText(I18N.GlobalConst.SEIZED_DESC_2),
|
||||||
|
okFunc = function()
|
||||||
|
ModuleManager.GameSettingManager:showSupport()
|
||||||
|
end,
|
||||||
|
cancelText = I18N:getGlobalText(I18N.GlobalConst.SEIZED_DESC_3),
|
||||||
|
cancelFunc = function()
|
||||||
|
ModuleManager.AccountManager:deleteAccount()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
GFunc.showMessageBox(params)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -198,40 +213,40 @@ function LoginManager:saveAuthArgs(isReconnect, name)
|
|||||||
|
|
||||||
args.client_info = self:getClientInfo()
|
args.client_info = self:getClientInfo()
|
||||||
args.reconnect = isReconnect
|
args.reconnect = isReconnect
|
||||||
local sendQueue = LocalData:getSendQueue()
|
-- local sendQueue = LocalData:getSendQueue()
|
||||||
args.sync =
|
args.sync =
|
||||||
{
|
{
|
||||||
pip = GFunc.getArray()
|
pip = GFunc.getArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
if sendQueue and sendQueue[1] then
|
-- if sendQueue and sendQueue[1] then
|
||||||
local ProtoMsgDispatch = require "app/proto/proto_msg_dispatch"
|
-- local ProtoMsgDispatch = require "app/proto/proto_msg_dispatch"
|
||||||
local pb = require "pb"
|
-- local pb = require "pb"
|
||||||
for _, info in ipairs(sendQueue) do
|
-- for _, info in ipairs(sendQueue) do
|
||||||
local curParams = info.params
|
-- local curParams = info.params
|
||||||
local needAd = false
|
-- local needAd = false
|
||||||
if info.msgName == ProtoMsgType.FromMsgEnum.PipedReq then
|
-- if info.msgName == ProtoMsgType.FromMsgEnum.PipedReq then
|
||||||
local msgName = ProtoMsgDispatch:getReqMsgNameByMsgId(curParams.msg_id)
|
-- local msgName = ProtoMsgDispatch:getReqMsgNameByMsgId(curParams.msg_id)
|
||||||
if msgName then
|
-- if msgName then
|
||||||
local fullMsgName = ProtoMsgDispatch:getMsgFullNameByMsgName(msgName)
|
-- local fullMsgName = ProtoMsgDispatch:getMsgFullNameByMsgName(msgName)
|
||||||
if fullMsgName then
|
-- if fullMsgName then
|
||||||
if curParams.data and type(curParams.data) == "table" then
|
-- if curParams.data and type(curParams.data) == "table" then
|
||||||
local ok, pbData = pcall(function()
|
-- local ok, pbData = pcall(function()
|
||||||
return pb.encode(fullMsgName, curParams.data)
|
-- return pb.encode(fullMsgName, curParams.data)
|
||||||
end)
|
-- end)
|
||||||
if ok then
|
-- if ok then
|
||||||
needAd = true
|
-- needAd = true
|
||||||
curParams.data = pbData
|
-- curParams.data = pbData
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
if needAd then
|
-- if needAd then
|
||||||
table.insert(args.sync.pip, curParams)
|
-- table.insert(args.sync.pip, curParams)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
NetManager:saveAuthArgs(args)
|
NetManager:saveAuthArgs(args)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1073,23 +1073,24 @@ function NetManager:getNotAddCostsRsp(msgName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function NetManager:pipedMessage(msgName, params)
|
function NetManager:pipedMessage(msgName, params)
|
||||||
if msgName == ProtoMsgType.FromMsgEnum.LoginReq or
|
return msgName, params -- 屏蔽PipedReq
|
||||||
msgName == ProtoMsgType.FromMsgEnum.SyncReq or
|
-- if msgName == ProtoMsgType.FromMsgEnum.LoginReq or
|
||||||
msgName == ProtoMsgType.FromMsgEnum.IdleRewardReq or
|
-- msgName == ProtoMsgType.FromMsgEnum.SyncReq or
|
||||||
msgName == ProtoMsgType.FromMsgEnum.IdleExtraRewardReq or
|
-- msgName == ProtoMsgType.FromMsgEnum.IdleRewardReq or
|
||||||
msgName == ProtoMsgType.FromMsgEnum.MailCycleReq or
|
-- msgName == ProtoMsgType.FromMsgEnum.IdleExtraRewardReq or
|
||||||
msgName == ProtoMsgType.FromMsgEnum.GMReq then
|
-- msgName == ProtoMsgType.FromMsgEnum.MailCycleReq or
|
||||||
return msgName, params
|
-- msgName == ProtoMsgType.FromMsgEnum.GMReq then
|
||||||
end
|
-- return msgName, params
|
||||||
local msgId = ProtoMsgDispatch:getMsgIdByMsgName(msgName)
|
-- end
|
||||||
self.msgId = self.msgId + 1
|
-- local msgId = ProtoMsgDispatch:getMsgIdByMsgName(msgName)
|
||||||
local pipedStruct = {
|
-- self.msgId = self.msgId + 1
|
||||||
id = self.msgId,
|
-- local pipedStruct = {
|
||||||
ts = Time:getServerTime() * 1000,
|
-- id = self.msgId,
|
||||||
msg_id = msgId,
|
-- ts = Time:getServerTime() * 1000,
|
||||||
data = params,
|
-- msg_id = msgId,
|
||||||
}
|
-- data = params,
|
||||||
return ProtoMsgType.FromMsgEnum.PipedReq, pipedStruct
|
-- }
|
||||||
|
-- return ProtoMsgType.FromMsgEnum.PipedReq, pipedStruct
|
||||||
end
|
end
|
||||||
|
|
||||||
if EDITOR_MODE then
|
if EDITOR_MODE then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user