玩家账号找回功能
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
LoddyController = {}
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Create a new LoddyController
|
||||
function LoddyController.new()
|
||||
setmetatable(M, {__index = IController})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
setmetatable(M, { __index = IController })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.baseType = LoddyController
|
||||
self.class = "Loddy"
|
||||
self.recordList = {}
|
||||
|
|
@ -27,7 +26,7 @@ local function __FillRoomData(s2croom)
|
|||
extend:FillRoomData(s2croom)
|
||||
end
|
||||
|
||||
local function __ConntectGameServer(cmd,room, host, _data,callback)
|
||||
local function __ConntectGameServer(cmd, room, host, _data, callback)
|
||||
-- local _data = {}
|
||||
_data["session"] = room.session
|
||||
local _game_client = NetClient.new(host, "game")
|
||||
|
|
@ -35,7 +34,7 @@ local function __ConntectGameServer(cmd,room, host, _data,callback)
|
|||
ControllerManager.SetGameNetClient(_game_client)
|
||||
_game_client.onconnect:Add(function(code)
|
||||
if (code == SocketCode.Connect) then
|
||||
_game_client:send(cmd, _data, function (response)
|
||||
_game_client:send(cmd, _data, function(response)
|
||||
if (response.ReturnCode == 0) then
|
||||
_game_client.onconnect:Clear()
|
||||
_game_client.onconnect:Add(ControllerManager.OnConnect)
|
||||
|
|
@ -44,39 +43,38 @@ local function __ConntectGameServer(cmd,room, host, _data,callback)
|
|||
end
|
||||
_game_client:destroy()
|
||||
if ControllerManager.GameNetClinet == _game_client then
|
||||
ControllerManager.GameNetClinet =nil
|
||||
ControllerManager.GameNetClinet = nil
|
||||
end
|
||||
callback(response)
|
||||
end)
|
||||
|
||||
else
|
||||
if ControllerManager.GameNetClinet == _game_client then
|
||||
ControllerManager.GameNetClinet =nil
|
||||
ControllerManager.GameNetClinet = nil
|
||||
end
|
||||
_game_client:destroy()
|
||||
callback({ReturnCode = 101})
|
||||
callback({ ReturnCode = 101 })
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
function M:CreateRoom(game_id, _data, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local data = {}
|
||||
data.game_id = game_id
|
||||
local _client = ControllerManager.WebClient
|
||||
local data = {}
|
||||
data.game_id = game_id
|
||||
data["platform"] = GetPlatform()
|
||||
data.config_data = _data
|
||||
-- local runtime = os.clock()
|
||||
_client:send(Protocol.WEB_CREATE_ROOM, data, function(res)
|
||||
if ( res.ReturnCode == Table_Error_code.ERR_IN_ROOM or res.ReturnCode == Table_Error_code.ERR_CREATE_ROOM) then
|
||||
self:JoinRoom("000000",callback)
|
||||
if (res.ReturnCode == Table_Error_code.ERR_IN_ROOM or res.ReturnCode == Table_Error_code.ERR_CREATE_ROOM) then
|
||||
self:JoinRoom("000000", callback)
|
||||
return
|
||||
end
|
||||
if (res.ReturnCode == 0) then
|
||||
local json = res.Data
|
||||
local game_info = json["game_info"]
|
||||
if ExtendHotupdate.CheckVersion(game_info) ~= ExtendHotupdate.VERSION_NORMAL then
|
||||
ExtendHotupdate.UpdateGame(game_info,function()
|
||||
ExtendHotupdate.UpdateGame(game_info, function()
|
||||
res.ReturnCode = -2
|
||||
callback(res)
|
||||
end)
|
||||
|
|
@ -87,7 +85,7 @@ function M:CreateRoom(game_id, _data, callback)
|
|||
local server_ip = json["server_ip"]
|
||||
local server_port = json["server_port"]
|
||||
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
room.game_id = game_id
|
||||
room.room_id = room_id
|
||||
room.server_host = string.concat(server_ip, ":", server_port)
|
||||
|
|
@ -99,12 +97,12 @@ function M:CreateRoom(game_id, _data, callback)
|
|||
local j_data = {}
|
||||
j_data["session"] = room.session
|
||||
if not DataManager.SelfUser.location then
|
||||
DataManager.SelfUser.location = Location.new()
|
||||
DataManager.SelfUser.location = Location.new()
|
||||
end
|
||||
j_data["pos"] = DataManager.SelfUser.location:Location2String()
|
||||
|
||||
-- game_net =
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM,room,room.server_host, j_data, function (response)
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(response)
|
||||
if (response.ReturnCode == 0) then
|
||||
-- game_net:clearEvent()
|
||||
local _s2croom = response.Data
|
||||
|
|
@ -126,13 +124,13 @@ function M:CreateRoom(game_id, _data, callback)
|
|||
callback(response)
|
||||
end)
|
||||
else
|
||||
if callback then callback(res) end
|
||||
if callback then callback(res) end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local join_room_frame = 0
|
||||
function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
||||
function M:PublicJoinRoom(cmd, room_id, callback, group_id, group_layer)
|
||||
-- 同一帧不重复调用
|
||||
local last_frame = join_room_frame
|
||||
join_room_frame = Time.frameCount
|
||||
|
|
@ -147,12 +145,12 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
|||
_data["floor"] = group_layer
|
||||
_data["platform"] = GetPlatform()
|
||||
local _client = ControllerManager.WebClient;
|
||||
_client:send(cmd, _data, function( res)
|
||||
_client:send(cmd, _data, function(res)
|
||||
if (res.ReturnCode == 0) then
|
||||
local json = res.Data
|
||||
local game_info = json["game_info"]
|
||||
if ExtendHotupdate.CheckVersion(game_info) ~= ExtendHotupdate.VERSION_NORMAL then
|
||||
ExtendHotupdate.UpdateGame(game_info,function()
|
||||
ExtendHotupdate.UpdateGame(game_info, function()
|
||||
res.ReturnCode = -2
|
||||
callback(res)
|
||||
end)
|
||||
|
|
@ -162,7 +160,7 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
|||
local server_ip = json["server_ip"]
|
||||
local server_port = json["server_port"]
|
||||
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
room.lev = json["lev"] -- 自己在当前房间所在圈子的职位,1盟主,2管理员,3用户,非圈子房间就是3
|
||||
room.room_id = json["room_id"]
|
||||
room.game_id = game_id
|
||||
|
|
@ -178,14 +176,14 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
|||
DataManager.CurrenRoom = room
|
||||
local j_data = {}
|
||||
if not DataManager.SelfUser.location then
|
||||
DataManager.SelfUser.location = Location.new()
|
||||
DataManager.SelfUser.location = Location.new()
|
||||
end
|
||||
j_data["pos"] = DataManager.SelfUser.location:Location2String()
|
||||
-- local game_net = nil
|
||||
--print(vardump(room))
|
||||
-- game_net =
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM,room,room.server_host, j_data,function ( res1)
|
||||
if (res1.ReturnCode ~= 0 ) then
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
|
||||
if (res1.ReturnCode ~= 0) then
|
||||
if (callback) then callback(res1) end
|
||||
else
|
||||
local _s2croom = res1.Data
|
||||
|
|
@ -198,7 +196,7 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
|||
end
|
||||
room.agent = _s2croom.agent == 1 and true or false
|
||||
-- ControllerManager.SetGameNetClient(game_net)
|
||||
local extend = ExtendManager.GetExtendConfig(room.game_id)
|
||||
local extend = ExtendManager.GetExtendConfig(room.game_id)
|
||||
extend:FillRoomData(_s2croom)
|
||||
ControllerManager.ChangeController(GameController)
|
||||
if callback then callback(res1) end
|
||||
|
|
@ -206,16 +204,15 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
|
|||
end)
|
||||
-- callback(res)
|
||||
else
|
||||
if callback then callback(res) end
|
||||
if callback then callback(res) end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:JoinRoom(room_id,callback,group_id,group_layer)
|
||||
self:PublicJoinRoom(Protocol.WEB_JOIN_ROOM,room_id,callback,group_id,group_layer)
|
||||
function M:JoinRoom(room_id, callback, group_id, group_layer)
|
||||
self:PublicJoinRoom(Protocol.WEB_JOIN_ROOM, room_id, callback, group_id, group_layer)
|
||||
end
|
||||
|
||||
|
||||
function M:ResetJionRoom(callback)
|
||||
local _game = ControllerManager.GetController(GameController)
|
||||
local o_room = DataManager.CurrenRoom
|
||||
|
|
@ -224,7 +221,7 @@ function M:ResetJionRoom(callback)
|
|||
DataManager.SelfUser.location = Location.new()
|
||||
end
|
||||
j_data["pos"] = DataManager.SelfUser.location:Location2String()
|
||||
local room = ExtendManager.GetExtendConfig(o_room.game_id):NewRoom()
|
||||
local room = ExtendManager.GetExtendConfig(o_room.game_id):NewRoom()
|
||||
room.lev = o_room.lev
|
||||
room.room_id = o_room.room_id
|
||||
room.game_id = o_room.game_id
|
||||
|
|
@ -241,14 +238,14 @@ function M:ResetJionRoom(callback)
|
|||
room.create_time = o_room.create_time
|
||||
room:SetReloadStatus(true)
|
||||
DataManager.CurrenRoom = room
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM,room,room.server_host, j_data,function ( res1)
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
|
||||
room:SetReloadStatus(false)
|
||||
if (res1.ReturnCode ~= 0 ) then
|
||||
if (res1.ReturnCode ~= 0) then
|
||||
if (callback) then callback(res1) end
|
||||
else
|
||||
printlog("ResetJionRoom==>>>")
|
||||
pt(res1)
|
||||
ControllerManager.enterPlayerData=res1.Data.tableInfo.playerData
|
||||
ControllerManager.enterPlayerData = res1.Data.tableInfo.playerData
|
||||
local _s2croom = res1.Data
|
||||
local extend = ExtendManager.GetExtendConfig(room.game_id)
|
||||
extend:FillRoomData(_s2croom)
|
||||
|
|
@ -259,8 +256,8 @@ function M:ResetJionRoom(callback)
|
|||
end
|
||||
|
||||
function M:UpdatePlayerInfo(callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(Protocol.WEB_UPDATE_INFO, nil, function (res)
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(Protocol.WEB_UPDATE_INFO, nil, function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
DataManager.SelfUser.diamo = res.Data.diamo
|
||||
DataManager.SelfUser.invited = res.Data.invitation
|
||||
|
|
@ -272,11 +269,11 @@ function M:UpdatePlayerInfo(callback)
|
|||
end)
|
||||
end
|
||||
|
||||
function M:UpdateNotice(id,callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
function M:UpdateNotice(id, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
_data.id = id
|
||||
_client:send(Protocol.WEB_UPDATE_NOTICE, _data, function (res)
|
||||
_client:send(Protocol.WEB_UPDATE_NOTICE, _data, function(res)
|
||||
--print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",res)
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 and #res.Data.notice_list > 0 then
|
||||
|
|
@ -298,10 +295,10 @@ function M:RequestRecordList(callback, roomid)
|
|||
proto = Protocol.WEB_GET_MILITARY_BY_ROOMID
|
||||
_data.roomId = roomid
|
||||
end
|
||||
_client:send(proto, _data, function (res)
|
||||
_client:send(proto, _data, function(res)
|
||||
self.recordList = nil
|
||||
-- print(vardump(res))
|
||||
if (res.ReturnCode == 0 or res.ReturnCode == 19 ) then
|
||||
if (res.ReturnCode == 0 or res.ReturnCode == 19) then
|
||||
--self:RequestRankList(callback)
|
||||
self.recordList = {}
|
||||
if res.ReturnCode == 19 then return end
|
||||
|
|
@ -335,8 +332,8 @@ function M:RequestRecordList(callback, roomid)
|
|||
end
|
||||
local round_count = record_list_item["round"]
|
||||
|
||||
for j = 1,round_count do
|
||||
local round_score_str = record_list_item["round_"..j]
|
||||
for j = 1, round_count do
|
||||
local round_score_str = record_list_item["round_" .. j]
|
||||
local m_round_game = MGameTimes.new()
|
||||
if round_score_str then
|
||||
local round_score_item = json.decode(round_score_str)
|
||||
|
|
@ -359,50 +356,45 @@ function M:RequestRecordList(callback, roomid)
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
function M:RequestPlayBack(_data,callback,game_info)
|
||||
function M:RequestPlayBack(_data, callback, game_info)
|
||||
if game_info and ExtendHotupdate.CheckVersion(game_info) ~= ExtendHotupdate.VERSION_NORMAL then
|
||||
ExtendHotupdate.UpdateGame(game_info,function()
|
||||
self:RequestPlayBack(_data,callback)
|
||||
ExtendHotupdate.UpdateGame(game_info, function()
|
||||
self:RequestPlayBack(_data, callback)
|
||||
end)
|
||||
return
|
||||
else
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(Protocol.WEB_GET_PLAY_BACK , _data , function (res)
|
||||
_client:send(Protocol.WEB_GET_PLAY_BACK, _data, function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
local data = json.decode(res.Data.playback)
|
||||
local cmdList = data.cmdList
|
||||
local info = data.info
|
||||
local extend = ExtendManager.GetExtendConfig(info.game_id)
|
||||
local room = extend:NewRoom()
|
||||
local room = extend:NewRoom()
|
||||
room.game_id = info.game_id
|
||||
DataManager.CurrenRoom = room
|
||||
extend:FillPlayBackData(data)
|
||||
if not room.self_player then
|
||||
room.self_player = room:GetPlayerBySeat(1)
|
||||
end
|
||||
callback(res.ReturnCode,data)
|
||||
callback(res.ReturnCode, data)
|
||||
else
|
||||
callback(res.ReturnCode,nil)
|
||||
callback(res.ReturnCode, nil)
|
||||
end
|
||||
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--获取手机验证码
|
||||
function M:GetPhoneCode(phone,callback)
|
||||
function M:GetPhoneCode(phone, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
_data["phone"]=phone
|
||||
_data["phone"] = phone
|
||||
_client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
function M:GetUserInfo(callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(Protocol.WEB_GET_USER_INFO, nil, function(res)
|
||||
|
|
@ -419,7 +411,7 @@ function M:GetUserInfo(callback)
|
|||
end)
|
||||
end
|
||||
|
||||
function M:UpdateUserInfo(_data,callback)
|
||||
function M:UpdateUserInfo(_data, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(Protocol.WEB_UPDATE_USER_INFO, _data, function(res)
|
||||
callback(res)
|
||||
|
|
@ -435,3 +427,13 @@ function M:SetInvited(on, callback)
|
|||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
--找回账号信息
|
||||
function M:RetrievePassword(data, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
_data.data = RSAHelper.Encrypt(json.encode(data))
|
||||
_client:send(Protocol.WEB_BACK_PASSWORD, _data, function(res)
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ local FilterGame = function(games)
|
|||
end
|
||||
|
||||
local function __Login(cmd, _data, callBack)
|
||||
if not UnityEngine.SystemInfo.deviceUniqueIdentifier or #UnityEngine.SystemInfo.deviceUniqueIdentifier < 6 then
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorMsg(nil, "", "找不到您的设备信息,若无法登录请联系客服人员解决")
|
||||
return
|
||||
end
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:send(cmd, _data, function(res)
|
||||
if (res.ReturnCode == 0) then
|
||||
|
|
@ -47,9 +52,9 @@ local function __Login(cmd, _data, callBack)
|
|||
user.group_id = account["groupId"]
|
||||
user.type = account["type"]
|
||||
user.agent = account["mng"]
|
||||
-- user.bind_pwd = account["bind_pwd"]
|
||||
--默认设置为true
|
||||
user.bind_pwd = true
|
||||
user.bind_pwd = data["havePassword"]
|
||||
--默认设置为false,false为进入强制输入密码
|
||||
-- user.bind_pwd = false
|
||||
|
||||
user.real_info = account.real_info
|
||||
user.phone = account.phone
|
||||
|
|
@ -99,19 +104,24 @@ function M:PhonePasswordLogin(phone, password, callback)
|
|||
__Login(Protocol.WEB_PHONE_PASSWORD_LOGIN, _data, callback)
|
||||
end
|
||||
|
||||
function M:IdPasswordLogin2(uid, password, callback)
|
||||
function M:IdPasswordLogin(uid, password, callback)
|
||||
local _data = {}
|
||||
_data.data = RSAHelper.Encrypt(json.encode({
|
||||
id = tonumber(uid),
|
||||
password = password,
|
||||
deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
}))
|
||||
print("lingmeng IdPasswordLogin", _data.data)
|
||||
-- print("lingmeng IdPasswordLogin RSAHelper", RSAHelper.Decrypt(_data.data))
|
||||
__getCode(Protocol.WEB_ID_PASSWORD_LOGIN_2, _data, callback)
|
||||
local result, resultInfo = pcall(function(...)
|
||||
_data.data = RSAHelper.Encrypt(json.encode({
|
||||
id = tonumber(uid),
|
||||
password = password,
|
||||
deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
}))
|
||||
end)
|
||||
if result then
|
||||
__getCode(Protocol.WEB_ID_PASSWORD_LOGIN_2, _data, callback)
|
||||
else
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorMsg(nil, "", "您的个人信息太长,若无法登录请联系客服人员解决")
|
||||
end
|
||||
end
|
||||
|
||||
function M:IdPasswordLogin(uid, password, callback)
|
||||
function M:IdPasswordLogin2(uid, password, callback)
|
||||
local _data = {}
|
||||
_data["id"] = tonumber(uid)
|
||||
_data["password"] = password
|
||||
|
|
@ -133,29 +143,36 @@ end
|
|||
function M:Login(callback)
|
||||
local user = DataManager.SelfUser
|
||||
local _data = {}
|
||||
_data.data = RSAHelper.Encrypt(json.encode({
|
||||
acc = user.acc,
|
||||
nick = user.nick_name,
|
||||
sex = user.sex,
|
||||
portrait = user
|
||||
.head_url,
|
||||
deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
}))
|
||||
__Login(Protocol.WEB_USER_LOGIN_2, _data, callback)
|
||||
local result = pcall(function(...)
|
||||
_data.data = RSAHelper.Encrypt(json.encode({
|
||||
acc = user.acc,
|
||||
nick = user.nick_name,
|
||||
sex = user.sex,
|
||||
portrait = user
|
||||
.head_url,
|
||||
deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
}))
|
||||
end)
|
||||
if result then
|
||||
__Login(Protocol.WEB_USER_LOGIN_2, _data, callback)
|
||||
else
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorMsg(nil, "", "您的个人信息太长,若无法登录请联系客服人员解决")
|
||||
end
|
||||
end
|
||||
|
||||
function M:QuickLogin2(session_id, callback)
|
||||
function M:QuickLogin(session_id, callback)
|
||||
local _data = {}
|
||||
_data.data = RSAHelper.Encrypt(json.encode({
|
||||
deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
}))
|
||||
local _client = ControllerManager.WebClient
|
||||
_client:setSession(session_id)
|
||||
-- ControllerManager.GroupClient:setSession(session_id)
|
||||
__Login(Protocol.WEB_QUICK_LOGIN_2, _data, callback)
|
||||
end
|
||||
|
||||
function M:QuickLogin(session_id, callback)
|
||||
--快速登入加密
|
||||
function M:QuickLogin2(session_id, callback)
|
||||
local _data = {}
|
||||
_data["deviceCode"] = UnityEngine.SystemInfo.deviceUniqueIdentifier
|
||||
local _client = ControllerManager.WebClient
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ Protocol = {
|
|||
----index----
|
||||
-- 获取公告
|
||||
WEB_UPDATE_NOTICE = "index/get_notice",
|
||||
|
||||
--找回账号
|
||||
WEB_BACK_PASSWORD = "acc/set_back_password",
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@ local IDPasswordAlone = {}
|
|||
|
||||
local M = IDPasswordAlone
|
||||
|
||||
--黑体字提示
|
||||
local Tips1 = { { "当前账号未设置密码,为了您的账号安全请设置密码", "若您为旧用户或者当前账号不属于你,点击左上角可以找回账号" }, { "请输入正确的账号和密码,若忘记请联系客服人员" } }
|
||||
--红字提示
|
||||
local Tips1 = { { "注:初始账号将强制要求设置密码" }, { "注:找回账号功能会删除现有账户,请勿随便使用" } }
|
||||
|
||||
function IDPasswordAlone.new(callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
|
|
@ -16,12 +21,28 @@ end
|
|||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
local text_id = self._view:GetChild("tex_phone")
|
||||
local tex_passwd = self._view:GetChild("tex_passwd")
|
||||
text_id.text = DataManager.SelfUser.account_id
|
||||
|
||||
self._view:GetChild("tex_phone").text = DataManager.SelfUser.account_id
|
||||
local ctr_retrieve = self._view:GetController('retrieve')
|
||||
ctr_retrieve.onChanged:Set(function(context)
|
||||
if ctr_retrieve.selectedIndex == 0 then
|
||||
text_id.text = DataManager.SelfUser.account_id
|
||||
tex_passwd.text = ""
|
||||
else
|
||||
text_id.text = ""
|
||||
tex_passwd.text = ""
|
||||
end
|
||||
end)
|
||||
|
||||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
self:Bind()
|
||||
if ctr_retrieve.selectedIndex == 0 then
|
||||
self:Bind()
|
||||
else
|
||||
self:Retrieve()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
@ -56,7 +77,7 @@ function M:Bind()
|
|||
return
|
||||
end
|
||||
|
||||
_data = {}
|
||||
local _data = {}
|
||||
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
|
|
@ -75,4 +96,29 @@ function M:Bind()
|
|||
end)
|
||||
end
|
||||
|
||||
--找回账号
|
||||
function M:Retrieve()
|
||||
local tex_phone = self._view:GetChild("tex_phone")
|
||||
local text_id = tex_phone.text
|
||||
local tex_passwd = self._view:GetChild("tex_passwd")
|
||||
local password = tex_passwd.text
|
||||
|
||||
local _data = {}
|
||||
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
_data.password = password
|
||||
_data.id = tonumber(text_id)
|
||||
|
||||
loddyctr:RetrievePassword(_data, function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
PlayerPrefs.DeleteKey('session_id')
|
||||
Application.Quit()
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找回账号失败,请联系客服人员")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@ oldGameVersion = 2 --1 原始 2 老游戏新加功能
|
|||
|
||||
--主入口函数。从这里开始lua逻辑
|
||||
function Main()
|
||||
--PlayerPrefs.DeleteKey('session_id')
|
||||
-- PlayerPrefs.DeleteKey('session_id')
|
||||
Application.targetFrameRate = 60
|
||||
FairyGUI.UIConfig.buttonSound = FairyGUI.NAudioClip(ResourcesManager.LoadObject("base/common/sound/click.mp3",
|
||||
typeof(UnityEngine.AudioClip)))
|
||||
FairyGUI.UIConfig.defaultFont = "FZDaBiaoSong-B06S"
|
||||
FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("SIYUAN", "base/static/fonts/SIYUAN.TTF"), null)
|
||||
FairyGUI.FontManager.RegisterFont(
|
||||
FairyGUI.DynamicFont.New("AlimamaFangYuanTiVF-Thin", "base/static/fonts/AlimamaFangYuanTiVF-Thin.ttf"), null)
|
||||
FairyGUI.DynamicFont.New("AlimamaFangYuanTiVF-Thin", "base/static/fonts/AlimamaFangYuanTiVF-Thin.ttf"), null)
|
||||
--FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("FZCuYuan-M03","base/static/fonts/FZCuYuan-M03.TTF"),null)
|
||||
--FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("HYFangLiJ","base/static/fonts/HYFangLiJ.ttf"),null)
|
||||
_game_info = json.decode(GameApplication.Instance.GameInfo)
|
||||
|
|
@ -321,7 +321,7 @@ function LuaPrint(lua_table, limit, indent, step)
|
|||
local kk, vv = next(v._fields)
|
||||
if type(vv) == "table" then
|
||||
content = content .. "\n\t" .. kk.name .. "={" .. LuaPrint(vv._fields, 5, indent + 1, step + 1) ..
|
||||
"}"
|
||||
"}"
|
||||
else
|
||||
content = content .. "\n\t" .. kk.name .. "=" .. vv
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="100,20" extention="Button">
|
||||
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
|
||||
<displayList>
|
||||
<loader id="n3_jg0y" name="icon" xy="0,0" size="100,20" fill="scale">
|
||||
<relation target="" sidePair="width-width,height-height"/>
|
||||
</loader>
|
||||
</displayList>
|
||||
<Button mode="Check"/>
|
||||
</component>
|
||||
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
|
@ -1,21 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="974,588">
|
||||
<controller name="retrieve" pages="0,,1," selected="1"/>
|
||||
<displayList>
|
||||
<component id="n0_svin" name="n0" src="st2l7ijp" fileName="component/Win_BaseWindow_H698.xml" pkg="27vd145b" xy="0,0" size="974,588">
|
||||
<Button icon="ui://2d9xdj6zhz877e2c"/>
|
||||
<gearDisplay controller="retrieve" pages=""/>
|
||||
<gearIcon controller="retrieve" pages="1" values="ui://2d9xdj6zjg0y7e2i" default="ui://2d9xdj6zjg0y7e2g"/>
|
||||
<Button icon="ui://2d9xdj6zjg0y7e2i"/>
|
||||
</component>
|
||||
<component id="n1_svin" name="btn_close" src="vg2c4" fileName="buttons/Btn_close.xml" pkg="27vd145b" xy="898,-17" visible="false" controller="style,0"/>
|
||||
<component id="n2_svin" name="btn_ok" src="ab5pcj5" fileName="component/user_info/btn_ok.xml" xy="396,450">
|
||||
<component id="n2_svin" name="btn_ok" src="ab5pcj5" fileName="component/user_info/btn_ok.xml" xy="359,444" size="256,108">
|
||||
<Button icon="ui://2d9xdj6zab5pcj3"/>
|
||||
</component>
|
||||
<text id="n3_svin" name="n3" xy="228,171" size="164,42" group="n6_svin" font="Microsoft YaHei" fontSize="30" color="#2365bb" align="right" autoSize="none" bold="true" text="账号:"/>
|
||||
<image id="n4_svin" name="n4" src="ab5p1f" fileName="font/images/btn_keyboard/hall_input_bg.png" pkg="27vd145b" xy="405,164" size="320,57" group="n6_svin"/>
|
||||
<text id="n5_svin" name="tex_phone" xy="413,164" size="303,57" group="n6_svin" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" singleLine="true" text="123456"/>
|
||||
<group id="n6_svin" name="n6" xy="228,164" size="497,57" advanced="true"/>
|
||||
<text id="n7_svin" name="n7" xy="255,314" size="133,42" group="n11_svin" font="Microsoft YaHei" fontSize="30" color="#2365bb" align="right" autoSize="none" bold="true" text="密码:"/>
|
||||
<image id="n8_svin" name="n8" src="ab5p1f" fileName="font/images/btn_keyboard/hall_input_bg.png" pkg="27vd145b" xy="399,303" size="320,59" group="n10_svin"/>
|
||||
<text id="n9_svin" name="tex_passwd" xy="408,303" size="302,57" group="n10_svin" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" singleLine="true" text="" input="true" prompt="请输入密码" maxLength="15" keyboardType="1" password="true"/>
|
||||
<group id="n10_svin" name="n10" xy="399,303" size="320,59" group="n11_svin"/>
|
||||
<group id="n11_svin" name="passwd" xy="255,303" size="464,59"/>
|
||||
<text id="n3_svin" name="n3" xy="138,144" size="164,49" group="n6_svin" font="Microsoft YaHei" fontSize="36" color="#aa3300" align="right" autoSize="none" bold="true" text="账号:"/>
|
||||
<graph id="n12_jg0y" name="n12" xy="312,135" size="446,68" group="n6_svin" type="rect" lineSize="0" fillColor="#ffead398" corner="12"/>
|
||||
<text id="n5_svin" name="tex_phone" xy="316,139" size="434,59" group="n6_svin" font="Microsoft YaHei" fontSize="34" color="#ffffff" vAlign="middle" autoSize="none" bold="true" singleLine="true" text="" input="true" prompt="请输入账号">
|
||||
<gearLook controller="retrieve" pages="0" values="1,0,0,0" default="1,0,0,1"/>
|
||||
</text>
|
||||
<group id="n6_svin" name="n6" xy="138,135" size="620,68" advanced="true"/>
|
||||
<text id="n7_svin" name="n7" xy="169,236" size="133,49" group="n11_svin" font="Microsoft YaHei" fontSize="36" color="#aa3300" align="right" autoSize="none" bold="true" text="密码:"/>
|
||||
<graph id="n13_jg0y" name="n13" xy="312,227" size="446,68" group="n10_svin" type="rect" lineSize="0" fillColor="#ffead398" corner="12"/>
|
||||
<text id="n9_svin" name="tex_passwd" xy="316,231" size="435,61" group="n10_svin" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" singleLine="true" text="" input="true" prompt="请输入密码" maxLength="15" keyboardType="1" password="true"/>
|
||||
<group id="n10_svin" name="n10" xy="312,227" size="446,68" group="n11_svin"/>
|
||||
<group id="n11_svin" name="passwd" xy="169,227" size="589,68"/>
|
||||
<text id="n14_jg0y" name="text_tips1" xy="209,331" size="532,34" fontSize="24" text="请输入正确的账号和密码,若忘记请联系客服人员">
|
||||
<gearText controller="retrieve" pages="0,1" values="当前账号未设置密码,为了您的账号安全请设置密码
若您为旧用户或者当前账号不属于你,点击左上角可以找回账号|请输入正确的账号和密码,若忘记请联系客服人员"/>
|
||||
</text>
|
||||
<text id="n15_jg0y" name="text_tips2" xy="210,378" size="400,26" fontSize="18" color="#ff2727" text="注:找回账号功能会删除现有账户,请勿随便使用">
|
||||
<relation target="n14_jg0y" sidePair="top-bottom"/>
|
||||
</text>
|
||||
<component id="n17_jg0y" name="btn_retrieve" src="jg0y7e2k" fileName="component/user_info/btn_mul.xml" xy="43,73" size="60,78">
|
||||
<Button checked="true" icon="ui://2d9xdj6zjg0y7e2j" selectedIcon="ui://2d9xdj6zjg0y7e2l" controller="retrieve" page="1"/>
|
||||
</component>
|
||||
</displayList>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="974,588">
|
||||
<displayList>
|
||||
<component id="n0_svin" name="n0" src="st2l7ijp" fileName="component/Win_BaseWindow_H698.xml" pkg="27vd145b" xy="0,0" size="974,588">
|
||||
<Button icon="ui://2d9xdj6zjg0y7e2i"/>
|
||||
</component>
|
||||
<component id="n1_svin" name="btn_close" src="vg2c4" fileName="buttons/Btn_close.xml" pkg="27vd145b" xy="898,-17" visible="false" controller="style,0"/>
|
||||
<component id="n2_svin" name="btn_ok" src="ab5pcj5" fileName="component/user_info/btn_ok.xml" xy="359,434" size="256,108">
|
||||
<Button icon="ui://2d9xdj6zab5pcj3"/>
|
||||
</component>
|
||||
<text id="n3_svin" name="n3" xy="138,144" size="164,49" group="n6_svin" font="Microsoft YaHei" fontSize="36" color="#aa3300" align="right" autoSize="none" bold="true" text="账号:"/>
|
||||
<graph id="n12_jg0y" name="n12" xy="312,135" size="446,68" group="n6_svin" type="rect" lineSize="0" fillColor="#ffead398" corner="12"/>
|
||||
<text id="n5_svin" name="tex_phone" xy="316,139" size="434,59" group="n6_svin" font="Microsoft YaHei" fontSize="34" color="#ffffff" vAlign="middle" autoSize="none" bold="true" singleLine="true" text="123456" input="true"/>
|
||||
<group id="n6_svin" name="n6" xy="138,135" size="620,68" advanced="true"/>
|
||||
<text id="n7_svin" name="n7" xy="169,236" size="133,49" group="n11_svin" font="Microsoft YaHei" fontSize="36" color="#aa3300" align="right" autoSize="none" bold="true" text="密码:"/>
|
||||
<graph id="n13_jg0y" name="n13" xy="312,227" size="446,68" group="n10_svin" type="rect" lineSize="0" fillColor="#ffead398" corner="12"/>
|
||||
<text id="n9_svin" name="tex_passwd" xy="316,231" size="435,61" group="n10_svin" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" singleLine="true" text="" input="true" prompt="请输入密码" maxLength="15" keyboardType="1" password="true"/>
|
||||
<group id="n10_svin" name="n10" xy="312,227" size="446,68" group="n11_svin"/>
|
||||
<group id="n11_svin" name="passwd" xy="169,227" size="589,68"/>
|
||||
<text id="n14_jg0y" name="n14" xy="209,331" size="556,34" fontSize="24" text="请输入正确的账号和密码,微信将绑定找回后的账号"/>
|
||||
<text id="n15_jg0y" name="n15" xy="210,378" size="220,26" fontSize="18" color="#ff2727" text="注:忘记原账号请联系客服"/>
|
||||
</displayList>
|
||||
</component>
|
||||
|
|
@ -687,6 +687,12 @@
|
|||
<image id="hz875k" name="luxiang.png" path="/images/new/"/>
|
||||
<component id="hz877e2e" name="pop_notice(1).xml" path="/component/notice/"/>
|
||||
<component id="svin7e2f" name="win_id_password_alone.xml" path="/component/user_info/" exported="true"/>
|
||||
<image id="jg0y7e2g" name="xiugaimiam.png" path="/component/user_info/real/"/>
|
||||
<component id="jg0y7e2h" name="win_retrieve_alone.xml" path="/component/user_info/" exported="true"/>
|
||||
<image id="jg0y7e2i" name="zhaohuizhanghao.png" path="/component/user_info/real/"/>
|
||||
<image id="jg0y7e2j" name="Group 923.png" path="/component/user_info/real/"/>
|
||||
<component id="jg0y7e2k" name="btn_mul.xml" path="/component/user_info/"/>
|
||||
<image id="jg0y7e2l" name="Group 924.png" path="/component/user_info/real/"/>
|
||||
</resources>
|
||||
<publish name="Lobby" path="..\wb_unity_pro\Assets\ART\base\lobby\ui" packageCount="2">
|
||||
<atlas name="默认" index="0"/>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 805 KiB After Width: | Height: | Size: 942 KiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.5 MiB |
|
Before Width: | Height: | Size: 876 KiB After Width: | Height: | Size: 875 KiB |
|
Before Width: | Height: | Size: 875 KiB After Width: | Height: | Size: 876 KiB |
|
Before Width: | Height: | Size: 873 KiB After Width: | Height: | Size: 874 KiB |
|
Before Width: | Height: | Size: 872 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 878 KiB After Width: | Height: | Size: 880 KiB |
|
Before Width: | Height: | Size: 872 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 872 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 878 KiB After Width: | Height: | Size: 873 KiB |
|
Before Width: | Height: | Size: 876 KiB After Width: | Height: | Size: 877 KiB |
|
Before Width: | Height: | Size: 872 KiB After Width: | Height: | Size: 870 KiB |
|
Before Width: | Height: | Size: 468 KiB After Width: | Height: | Size: 467 KiB |
|
Before Width: | Height: | Size: 873 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 874 KiB After Width: | Height: | Size: 878 KiB |
|
Before Width: | Height: | Size: 878 KiB After Width: | Height: | Size: 880 KiB |
|
Before Width: | Height: | Size: 879 KiB After Width: | Height: | Size: 881 KiB |
|
Before Width: | Height: | Size: 874 KiB After Width: | Height: | Size: 873 KiB |
|
Before Width: | Height: | Size: 871 KiB After Width: | Height: | Size: 873 KiB |
|
Before Width: | Height: | Size: 881 KiB After Width: | Height: | Size: 874 KiB |
|
Before Width: | Height: | Size: 876 KiB After Width: | Height: | Size: 878 KiB |
|
Before Width: | Height: | Size: 871 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 871 KiB After Width: | Height: | Size: 872 KiB |
|
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 462 KiB |
|
Before Width: | Height: | Size: 876 KiB After Width: | Height: | Size: 875 KiB |
|
Before Width: | Height: | Size: 880 KiB After Width: | Height: | Size: 875 KiB |
|
Before Width: | Height: | Size: 873 KiB After Width: | Height: | Size: 874 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 467 KiB After Width: | Height: | Size: 463 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 465 KiB After Width: | Height: | Size: 464 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 476 KiB After Width: | Height: | Size: 474 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 910 KiB After Width: | Height: | Size: 914 KiB |
|
Before Width: | Height: | Size: 684 KiB After Width: | Height: | Size: 688 KiB |