2262006647 发表于 2017-8-22 19:34:12

手游 猪先 亲芸志 login。lua 疑似明文代码

local unpack = unpack
local EventHelper = UIEventListenerHelper
local uimanager = require("uimanager")
local network = require("network")
local serverlist
local CameraManager = require"cameramanager"
local gameObject
local name
local fields
local selectedServer
local elapsedTime
local bc
g_is_login = true
g_loginName = ""
g_loginPwd = ""
local url_base = "http://127.0.0.1/qyz/"
      --[[
                架设QQ571995418
      --]]
local reg_url = url_base.."reg.php"
local login_url = url_base.."login.php"
local pay_url = url_base.."pay/pay.php"
local url_base = "http://127.0.0.1/qyz/"

local reg_url = url_base.."reg.php"
local login_url = url_base.."login.php"
local pay_url = url_base.."pay/pay.php"
function g_getLoginName()
      return g_loginName
end
function g_getLoginPwd()
      return g_loginPwd
end
function g_getRegLoginUrl()
      if g_is_login then
                return login_url.."?name="..g_loginName.."&pass="..g_loginPwd
      else
                return reg_url.."?name="..g_loginName.."&pass="..g_loginPwd
      end
end
function g_getPayUrl(roleid, rolename, level, vip, orderId, serverid, servername, cash, pid, desc)
      --pid: productid
      local username = Game.Platform.Interface.Instance:GetUserName();
      local token = Game.Platform.Interface.Instance:GetToken();
      return pay_url.."?name="..username.."&rolename="..rolename.."&orderId="..orderId.."&cash="..cash.."&pid="..pid.."&desc="..desc.."&sign="..token
end
function g_showRegLoginErr(msg)
      uimanager.ShowSystemFlyText(msg)
end
local function destroy()

end

local function OpEnable(b)
    fields.UILabel_Change.gameObject:SetActive(b)
    fields.UILabel_Server.gameObject:SetActive(b)
end

local function RegLoginEnable(b)
    fields.UIWidget_RegLogin.gameObject:SetActive(b)
end

local function update()
--[[    if fields.UILabel_Change.gameObject.activeSelf then
      elapsedTime = nil
    else
      if elapsedTime then
            elapsedTime = elapsedTime - Time.deltaTime
            if elapsedTime<0 then
                OpEnable(true)
            end
      else
            elapsedTime = 1
      end
    end--]]
end

local function getLatestLoginServer()
    return network.GetDefaultLogin()
end

local function show(params)
    OpEnable(true)
    local bcObj = fields.UILabel_Change.gameObject
    bc = bcObj:GetComponent("BoxCollider")
    if params and params.bNeedLogin then
      Game.Platform.Interface.Instanceogin()
    else
      uimanager.show"dlgnotice"
    end
    selectedServer = getLatestLoginServer()
end

local function hide()

end

local function serverLabelInfo(serverNum, serverName)
    return string.format(LocalString.mapping.concatStr,serverNum,serverName)
end

local function OnLoginSuccess()
    selectedServer = getLatestLoginServer()
end

local function refresh(params)
    serverlist = GetServerList()
    local platform = Game.Platform.Interface.Instance:GetPlatform()
    if "WindowsPlayer" == platform then
      bc.enabled = false
      fields.UILabel_Change.text = ""
    else
      bc.enabled = true
      fields.UILabel_Change.text = serverLabelInfo(selectedServer, serverlist.name)
    end
end

local function saveLatestLoginServer(idx)
    if IsWindows then
      local platform = Game.Platform.Interface.Instance:GetPlatform()
      UserConfig.win_DefaultLogin = idx
      SaveUserConfig()
    else
      UserConfig.DefaultLogin = idx
      UserConfig.DefaultServer = idx
      SaveUserConfig()
    end

end

local function SetAnchor(fields)
    uimanager.SetAnchor(fields.UIWidget_TopLeft)
    uimanager.SetAnchor(fields.UIWidget_Bottom)
    uimanager.SetAnchor(fields.UIWidget_BottomRight)
    uimanager.SetAnchor(fields.UIWidget_Center)
end

local function init(params)
    name, gameObject, fields = unpack(params)
    SetAnchor(fields)
    EventHelper.SetClick(fields.UILabel_Change, function()
      uimanager.show("dlgselectserver", getLatestLoginServer())
      OpEnable(false)
    end )
    EventHelper.SetClick(fields.UILabel_Server, function()
                local loginstatus = Game.Platform.Interface.Instance:GetLoginStatus();
                if loginstatus == -1 or loginstatus == 0 then
                        --Game.Platform.Interface.Instanceogin()
            OpEnable(false)
                        RegLoginEnable(true)
                else
            CameraManager.ActiveSunShaft()
                        saveLatestLoginServer(selectedServer)
                        network.connect()
            OpEnable(false)
                        RegLoginEnable(false)
                end
    end )

    EventHelper.SetClick(fields.UIButton_Announcement, function()
      uimanager.show("dlgnotice")
      OpEnable(false)
    end )
      function doRegLogin()
                local name = fields.UIInput_Name.value
                local pwd = fields.UIInput_Passwd.value
                if name == "" then
                        uimanager.ShowSystemFlyText("请输入用户名")
                        return
                else
                        local ret = name:find('%w+%a*%d*')
                        if ret ~= 1 then
                              uimanager.ShowSystemFlyText("用户名不合法");
                              return
                        end
                end
                local namelen = string.len(name)
                if namelen < 4 then
                        uimanager.ShowSystemFlyText("用户名过短");
                        return
                end
                if namelen > 12 then
                        uimanager.ShowSystemFlyText("用户名过长");
                        return
                end
                local pwdlen = string.len(pwd)
                if pwd == "" then
                        uimanager.ShowSystemFlyText("请输入密码");
                        return
                else
                        local ret = pwd:find('%w+%a*%d*')
                        if ret ~= 1 then
                              uimanager.ShowSystemFlyText("密码不合法");
                              return
                        end
                end
                if pwdlen < 4 then
                        uimanager.ShowSystemFlyText("密码过短");
                        return
                end
                if pwdlen > 12 then
                        uimanager.ShowSystemFlyText("密码过长");
                        return
                end
                g_loginName = name
                g_loginPwd = pwd
      Game.Platform.Interface.Instanceogin()
                local loginstatus = Game.Platform.Interface.Instance:GetLoginStatus();
                if loginstatus == -1 or loginstatus == 0 then
                else
            CameraManager.ActiveSunShaft()
                        saveLatestLoginServer(selectedServer)
                        network.connect()
            OpEnable(false)
                        RegLoginEnable(false)
                end
      end
    EventHelper.SetClick(fields.UIButton_Reg, function()
                g_is_login = false
                doRegLogin()
    end )
      
    EventHelper.SetClick(fields.UIButton_Login, function()
                g_is_login = true
                doRegLogin()
    end )

    EventHelper.SetClick(fields.UILabel_Account,function()
      Game.Platform.Interface.Instanceogout()
      --Game.Platform.Interface.Instanceogin()
      OpEnable(false)
                RegLoginEnable(true)
    end)

    fields.UIButton_Scan.gameObject:SetActive(false)
end

local function ResetSelectedServer(idx)
    selectedServer = idx
    network.setSelectedServer(selectedServer)
    refresh()
end

return {
    init = init,
    show = show,
    hide = hide,
    update = update,
    destroy = destroy,
    refresh = refresh,
    serverLabelInfo = serverLabelInfo,
    ResetSelectedServer = ResetSelectedServer,
    OpEnable = OpEnable,
    OnLoginSuccess = OnLoginSuccess,
}

jj19831017 发表于 2017-8-22 19:57:13

汗,这个有啥用?

jzmin2000 发表于 2017-8-22 20:22:20

用神马工具打开能看到呢

sai1801 发表于 2017-8-22 20:30:12

好像有用,,路过看看:

joker0619 发表于 2017-8-22 20:38:19

太高深 小白根本什么都不懂 唉

shake1 发表于 2017-8-23 16:11:34

光明正大的发源码。。

夏天的太阳 发表于 2017-9-3 10:37:52

rane然而并不懂
页: [1]
查看完整版本: 手游 猪先 亲芸志 login。lua 疑似明文代码

本站内容如若侵犯到您的权益,请来电来函告知,我们会尽快处理!
联系QQ:1953150286,2251387361,123784736,免责申明