Merge branch 'china/dev' into china/xq
commit
ddab583582
|
@ -145,4 +145,24 @@ end
|
||||||
|
|
||||||
function PackageManager.GetCCCode()
|
function PackageManager.GetCCCode()
|
||||||
return ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.PACKAGE_CC_CODE) or ""
|
return ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.PACKAGE_CC_CODE) or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 获取APPID
|
||||||
|
local AppIDConfig = {
|
||||||
|
["com.tcxsw.project"] = "6a7c5e329e565fbecb9761f4ebdff709",
|
||||||
|
["com.tcxkf.project"] = "6a7c5e329e565fbecb9761f4ebdff709",
|
||||||
|
["com.tcxxqcs.project"] = "6a7c5e329e565fbecb9761f4ebdff709",
|
||||||
|
["com.tcxxq.project"] = "2c3239afdb0c14631e8ad97b35e289d9",
|
||||||
|
["com.tcx.project"] = "4bffbf7342f2bbb161734e7b3fe30ffe",
|
||||||
|
["com.tcxzb.project"] = "4bffbf7342f2bbb161734e7b3fe30ffe",
|
||||||
|
["com.tcxttml.project"] = "2cf98795b423de90af647d369efd3419",
|
||||||
|
["com.tcxcsb.project"] = "2806a89515659caecc964d727dbd49c8",
|
||||||
|
["com.tcxcn.test"] = "a3ad5f4090d59aecc42332088987f83b",
|
||||||
|
["com.tcxcn.project"] = "a3ad5f4090d59aecc42332088987f83b",
|
||||||
|
["com.tcxqd.project"] = "d4263a2ed36fd2b34ab8fa23e1f95dea",
|
||||||
|
}
|
||||||
|
function PackageManager.GetAppID()
|
||||||
|
if AppIDConfig[this.PackageName] then
|
||||||
|
return AppIDConfig[this.PackageName]
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -63,6 +63,8 @@ function this.Initialize()
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
-- 防沉迷检测
|
||||||
|
this.CheckRealName()
|
||||||
else
|
else
|
||||||
local errCode = result[2]
|
local errCode = result[2]
|
||||||
if not errCode then
|
if not errCode then
|
||||||
|
@ -92,8 +94,46 @@ function this.Initialize()
|
||||||
-- 发送登出事件
|
-- 发送登出事件
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLogout)
|
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLogout)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
end
|
||||||
|
local _Time
|
||||||
|
function this.CheckRealName()
|
||||||
|
local appId = PackageManager.GetAppID()
|
||||||
|
if appId then
|
||||||
|
local url = "http://identity.tyu89.wang/cp/nppa/loop"
|
||||||
|
local jsonData = string.format("appId;%s;userId;%s", appId, AppConst.OpenId)
|
||||||
|
networkMgr:SendHttpPost_Json_Lua(url, jsonData, function(msg)
|
||||||
|
local json = require 'cjson'
|
||||||
|
local context = json.decode(msg)
|
||||||
|
if context and context.code == 200 then
|
||||||
|
if context.data.allowPlay then
|
||||||
|
if context.data.needLoop then
|
||||||
|
-- 每隔60秒请求一次
|
||||||
|
if _Time then
|
||||||
|
_Time:Stop()
|
||||||
|
end
|
||||||
|
_Time = Timer.New(this.CheckRealName, 60)
|
||||||
|
_Time:Start()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if context.data.allowRemind then
|
||||||
|
MsgPanel.ShowOne(context.data.remindMessage, function()
|
||||||
|
if _Time then
|
||||||
|
_Time:Stop()
|
||||||
|
end
|
||||||
|
Game.Restart()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
if _Time then
|
||||||
|
_Time:Stop()
|
||||||
|
end
|
||||||
|
Game.Restart()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
-- 检测是否是新账户
|
-- 检测是否是新账户
|
||||||
function this.CheckIsRegister(openId, func)
|
function this.CheckIsRegister(openId, func)
|
||||||
if func then
|
if func then
|
||||||
|
|
|
@ -257,7 +257,7 @@ namespace GameEditor.FrameTool {
|
||||||
static string versionPath = Application.dataPath + "/../Version";
|
static string versionPath = Application.dataPath + "/../Version";
|
||||||
static string editorVersion = Application.dataPath + "/../AssetBundles";// + AppConst.GameVersionFile;
|
static string editorVersion = Application.dataPath + "/../AssetBundles";// + AppConst.GameVersionFile;
|
||||||
//static string persistVersion = Application.dataPath + "/Resources/version.txt";
|
//static string persistVersion = Application.dataPath + "/Resources/version.txt";
|
||||||
static string streamVersion = AppConst.StreamPath + AppConst.GameVersionFile;
|
static string streamVersion = AppConst.StreamPath;
|
||||||
|
|
||||||
static VersionTxt m_VersionTxt; // 热更版本
|
static VersionTxt m_VersionTxt; // 热更版本
|
||||||
|
|
||||||
|
@ -311,6 +311,7 @@ namespace GameEditor.FrameTool {
|
||||||
// 保存到version
|
// 保存到version
|
||||||
private static void SaveToVersion(string path, string json)
|
private static void SaveToVersion(string path, string json)
|
||||||
{
|
{
|
||||||
|
path += "/" + AppConst.GameVersionFile;
|
||||||
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
||||||
{
|
{
|
||||||
File.WriteAllText(path, json);
|
File.WriteAllText(path, json);
|
||||||
|
|
Loading…
Reference in New Issue