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