diff --git a/Assets/LuaFramework/Scenes/LogoChinaIOS.unity b/Assets/LuaFramework/Scenes/LogoChinaIOS.unity new file mode 100644 index 0000000000..04af032248 --- /dev/null +++ b/Assets/LuaFramework/Scenes/LogoChinaIOS.unity @@ -0,0 +1,362 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!1 &2 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 16} + - component: {fileID: 42} + - component: {fileID: 44} + - component: {fileID: 43} + - component: {fileID: 5} + - component: {fileID: 3} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c7cbe2940276bfc4f946d442c07229d2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!81 &5 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_Enabled: 1 +--- !u!4 &16 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!104 &22 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &24 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!114 &42 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 50 +--- !u!114 &43 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &44 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!1 &1013149005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1013149006} + - component: {fileID: 1013149007} + - component: {fileID: 1013149008} + m_Layer: 0 + m_Name: GameStart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1013149006 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1013149005} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.26726648, y: 0.43754014, z: -0.046788022} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1013149007 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1013149005} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae34f89576e17114c97f3cb81dba9ff6, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1013149008 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1013149005} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa01058878b41024abbd731e7118c543, type: 3} + m_Name: + m_EditorClassIdentifier: + settingInfo: + logLevel: 6 + isDebug: 0 + bundleMode: 1 + luaBundleMode: 1 + isUpdate: 1 + isSDK: 1 + isSDKLogin: 1 + isGuide: 1 + isOpenGM: 0 +--- !u!4 &57277738265262265 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3471622135844523394} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1362306110787991495 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3471622135844523394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7df5c5e5307f460e917e72bf75ec567, type: 3} + m_Name: + m_EditorClassIdentifier: + enableLog: 0 + networkType: 3 + tokens: + - appid: 63bdff7d90ca4720b6b6626841f0aad8 + serverUrl: https://thinkingdata.18183g.com + mode: 0 + timeZone: 0 + timeZoneId: +--- !u!1 &3471622135844523394 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 57277738265262265} + - component: {fileID: 1362306110787991495} + - component: {fileID: 3471622135844523395} + - component: {fileID: 3471622135844523396} + m_Layer: 0 + m_Name: SDKConfig + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3471622135844523395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3471622135844523394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 54b4453692b964811aa1c221fd236d88, type: 3} + m_Name: + m_EditorClassIdentifier: + appid: wjtsq7xrwb48t2uw + channel: "TCX-\u56FD\u5185-IOS" +--- !u!114 &3471622135844523396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3471622135844523394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7bc9cc33d9f7284590ba57b9743fb33, type: 3} + m_Name: + m_EditorClassIdentifier: + appid: 22f3fae585 diff --git a/Assets/LuaFramework/Scenes/LogoChinaIOS.unity.meta b/Assets/LuaFramework/Scenes/LogoChinaIOS.unity.meta new file mode 100644 index 0000000000..a24a47335d --- /dev/null +++ b/Assets/LuaFramework/Scenes/LogoChinaIOS.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f10e499239d9486a889e1e5e1eb4258 +timeCreated: 1496386600 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/LuaFramework/Scripts/SDK/Proxy/iOSProxy.cs b/Assets/LuaFramework/Scripts/SDK/Proxy/iOSProxy.cs index ced50d9cf2..fc7ac111a6 100644 --- a/Assets/LuaFramework/Scripts/SDK/Proxy/iOSProxy.cs +++ b/Assets/LuaFramework/Scripts/SDK/Proxy/iOSProxy.cs @@ -78,6 +78,12 @@ namespace SDK public override void NewRoleTutorial(string eventName, string guide_start_time, string guide_end_time, string serverId, string serverName, string roleName, string roleId) { } + + [DllImport("__Internal")] + private static extern void m_SDK_OpenWeb(string url); + public override void OpenWeb(string url) { + m_SDK_OpenWeb(url); + } } } #endif diff --git a/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua b/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua new file mode 100755 index 0000000000..f88ed43960 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua @@ -0,0 +1,55 @@ +-- 对字符串进行加密解密 + +require "Common.BitMath" +function strSplit(input, delimiter) + input = tostring(input) + delimiter = tostring(delimiter) + if (delimiter=='') then return false end + local pos,arr = 0, {} + for st,sp in function() return string.find(input, delimiter, pos, true) end do + table.insert(arr, string.sub(input, pos, st - 1)) + pos = sp + 1 + end + table.insert(arr, string.sub(input, pos)) + return arr +end + +function StrToBytes(s) + local t={} + for i=1,string.len(s) do + table.insert(t,string.byte(string.sub(s,i,i))) + end + return t +end + +function HTTP_ENCRYPT(src, key) + local data = StrToBytes(src) + local keys = StrToBytes(key) + local sb = "" + for i = 1, #data do + local n = BitMath.andOp(255, data[i]) + BitMath.andOp(255, keys[(i - 1) % #keys + 1]) + sb = sb.."@"..n + end + return sb +end + +function HTTP_DECRYPT(src, key) + local list = strSplit(src, "@") + if not list or #list < 1 then + return src + end + table.remove(list, 1) + local keys = StrToBytes(key) + local data = "" + for i = 1, #list do + local n = list[i] - BitMath.andOp(255, keys[(i - 1) % #keys + 1]) + data = data .. string.char(n) + end + return data +end + + +-- local t = HTTP_ENCRYPT("fajkfkahsdfjkhkashd", "123") +-- print(t) +-- local data = HTTP_DECRYPT(t, "123") +-- print(data) \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua.meta b/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua.meta new file mode 100644 index 0000000000..fa031a928d --- /dev/null +++ b/Assets/ManagedResources/~Lua/Base/HttpCrypt.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c0a2e12bba84144f48f8b9b64c1e89c4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/Logic/Game.lua b/Assets/ManagedResources/~Lua/Logic/Game.lua index f94e8cd20a..94b40f27fb 100644 --- a/Assets/ManagedResources/~Lua/Logic/Game.lua +++ b/Assets/ManagedResources/~Lua/Logic/Game.lua @@ -21,7 +21,7 @@ function Game.Initialize() Timer.New(function() UIManager.OpenPanel(UIName.LoginPanel) UIManager.OpenPanel(UIName.HorseRaceLampView) - end, 0.1):Start() + end, 0.5):Start() end --初始化管理器 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index 19eb9996d9..525613d459 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -1,4 +1,4 @@ -BattleManager = {} +BattleManager = {} local this = BattleManager local PassiveSkillLogicConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillLogicConfig) local SkillLogicConfig = ConfigManager.GetConfig(ConfigName.SkillLogicConfig) @@ -1014,7 +1014,7 @@ function this.RequestBattleDataByFightId(serverUrl, fightId, func) local uid = string.split(fightId, "_")[1] local requestUrl = string.format("http://%s/req/getFightRecord?uid=%s&fightid=%s", serverUrl, uid, fightId) LogGreen(requestUrl) - networkMgr:SendGetHttp(requestUrl, function(str) + LoginManager:SendGetHttp(requestUrl, function(str) --LogGreen(str) local json = require 'cjson' local data = json.decode(str) diff --git a/Assets/ManagedResources/~Lua/Modules/BindPhone/BindPhoneNumberManager.lua b/Assets/ManagedResources/~Lua/Modules/BindPhone/BindPhoneNumberManager.lua index 691aaec793..55a5516b9f 100644 --- a/Assets/ManagedResources/~Lua/Modules/BindPhone/BindPhoneNumberManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/BindPhone/BindPhoneNumberManager.lua @@ -61,7 +61,7 @@ function this.DOGetBindPhone(type, phoneNumber, code) local sign = Util.MD5Encrypt(string.format("%s%s%s%s%s%s", pid, gid, type, phoneNumber, time, signKey)) local code = code and code or "" - networkMgr:SendGetHttp(string.format("%s?pid=%s&gid=%s&token=%s&type=%s&phone=%s&code=%s&time=%s&sign=%s", + LoginManager:SendGetHttp(string.format("%s?pid=%s&gid=%s&token=%s&type=%s&phone=%s&code=%s&time=%s&sign=%s", GetBindUrl, pid, gid, token, type, phoneNumber, code, time, sign), this.OnCodeResult, nil, nil, nil) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua index fffadecb1a..73e83e0112 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua @@ -437,6 +437,7 @@ function this.ExecuteBehavior(beType, beArgs) params[i] = s end end + UIManager.CloseAllStack(true) -- 先跳转引导 this.NextGuide() -- 在跳转界面 diff --git a/Assets/ManagedResources/~Lua/Modules/Login/LoginManager.lua b/Assets/ManagedResources/~Lua/Modules/Login/LoginManager.lua index 93d439872b..d5e60749fb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Login/LoginManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Login/LoginManager.lua @@ -1,4 +1,4 @@ -LoginManager = {}; +LoginManager = {}; local this = LoginManager this.sign = "d13b3e8ef74bf72d8aafce3a1c8672a0" this.openId = nil @@ -124,7 +124,7 @@ function this.RequestRegist(name, pw, call) pw, this.sign)) RequestPanel.Show(Language[11132]) - networkMgr:SendGetHttp(LoginRoot_Url .. "jl_loginserver/registerUser?userName=".. name .. "&password=".. pw .."&repeat=".. pw .. "&sign=" .. sign, + this:SendGetHttp(LoginRoot_Url .. "jl_loginserver/registerUser?userName=".. name .. "&password=".. pw .."&repeat=".. pw .. "&sign=" .. sign, function(str) RequestPanel.Hide() if str == nil then @@ -150,7 +150,7 @@ function this.RequestUser(name, pw, call) pw, this.sign)) RequestPanel.Show(Language[11134]) - networkMgr:SendGetHttp(LoginRoot_Url .. "jl_loginserver/userLogin?userName=".. name .. "&password=".. pw .. "&sign=" .. sign, function(str) + this:SendGetHttp(LoginRoot_Url .. "jl_loginserver/userLogin?userName=".. name .. "&password=".. pw .. "&sign=" .. sign, function(str) RequestPanel.Hide() if str == nil then return @@ -179,6 +179,28 @@ function this.RequestUser(name, pw, call) end,nil,nil,nil) end +require("Base.HttpCrypt") +local CRYPT_KEY = "d53b3e8ef74bf72d8aafce3a1c8671a0" +function this:SendGetHttp(url, callback, _, _, failCB) + local request = url + LogGreen("Http请求:"..request) + if AppConst.Platform == "IOS" then + local urlList = string.split(url, "?") + urlList[2] = HTTP_ENCRYPT(urlList[2], CRYPT_KEY) + request = urlList[1] .. "?crypt=" .. urlList[2] + LogGreen("Http加密请求:"..request) + end + networkMgr:SendGetHttp(request, function(msg) + LogGreen("Http请求结果:"..msg) + if AppConst.Platform == "IOS" then + msg = HTTP_DECRYPT(msg, CRYPT_KEY) + LogGreen("Http请求结果解密:"..msg) + end + if callback then + callback(msg) + end + end, nil, nil, failCB) +end return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua b/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua index 4707529936..0367705358 100644 --- a/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua @@ -305,7 +305,7 @@ end function this.CheckNoticeShow() -- 判断公告显示 - IsShowNotice = true--SERVER_VERSION == 0 -- 正式服显示公告 + IsShowNotice = SERVER_VERSION == 0 -- 正式服显示公告 this.btnNotice:SetActive(IsShowNotice) end -- 打开公告界面 @@ -320,7 +320,7 @@ function this.ShowNotice() end local url = LoginRoot_Url .. "jl_loginserver/getNotice?timestamp="..timeStamp.."&sign=".. timeSign.."&packageName="..noticeChannel Log(url) - networkMgr:SendGetHttp(url,function (str) + LoginManager:SendGetHttp(url,function (str) UIManager.OpenPanel(UIName.NoticePopup,str) end, nil, nil, nil) end @@ -334,9 +334,9 @@ function this.RequestServerVersion(func) end local url = LoginRoot_Url .. "jl_loginserver/getServerVersion?serverVersion="..ChannelID LogPink(url) - networkMgr:SendGetHttp(url, function (str) + LoginManager:SendGetHttp(url, function (str) LogPink(str) - if str == "null" or string.find(str, "html") then + if str == "" or str == "null" or string.find(str, "html") then LogWarn("获取到的ServerVersion数据是空值,请检查!") else local json = require 'cjson' @@ -373,7 +373,7 @@ function this.RequestServerList(userId, callback) "%sjl_loginserver/getServerList?openId=%s&channel=%s&plat=android&sub_channel=%s&server_version=%s", LoginRoot_Url, userId, LoginRoot_Channel, LoginRoot_SubChannel, SERVER_VERSION) Log(url) - networkMgr:SendGetHttp(url, callback, nil, nil, nil) + LoginManager:SendGetHttp(url, callback, nil, nil, nil) end) --用户协议,隐私政策 @@ -398,7 +398,7 @@ function this.RequestProtos(userId) end local url = LoginRoot_Url.."jl_loginserver/getAgreement?gamePack="..ChannelID Log(url) - networkMgr:SendGetHttp(url, function (str) + LoginManager:SendGetHttp(url, function (str) local json = require 'cjson' local data = json.decode(str) if data.parms then @@ -778,7 +778,7 @@ function this.RequestHttpLogin() end Log(url) - networkMgr:SendGetHttp(url, this.OnReceiveLogin, nil, nil, nil) + LoginManager:SendGetHttp(url, this.OnReceiveLogin, nil, nil, nil) end --用户id登录 diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index 66e913a8f8..41d2344d46 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -1,4 +1,4 @@ - + local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig) -- 通用得商店逻辑 local ShopView = {} @@ -16,7 +16,7 @@ function this:New(gameObject) end --初始化组件(用于子类重写) function this:InitComponent() - this.spLoader = SpriteLoader.New() + self.spLoader = SpriteLoader.New() self.live = Util.GetGameObject(self.gameObject, "live") self.liveRoot = Util.GetGameObject(self.gameObject, "live/root") self.liveImg = Util.GetGameObject(self.gameObject, "live/img") @@ -359,7 +359,7 @@ function this:RefreshBase() -- 刷新物品计算 local shopInfo = ShopManager.GetShopInfoByType(self.ShopType) local costId, abcd = shopInfo.RefreshItem[1][1], shopInfo.RefreshItem[2] - self.costIcon:GetComponent("Image").sprite = SetIcon(this.spLoader, costId) + self.costIcon:GetComponent("Image").sprite = SetIcon(self.spLoader, costId) -- 商店特权正确性检测 if not shopInfo.RefreshPrivilege or shopInfo.RefreshPrivilege == 0 then Log("错误:商店类型 == " .. self.ShopType .. "商店支持手动刷新,但是未配置刷新次数对应的特权id(无限制次数也需要配置特权id)请检查") @@ -373,7 +373,7 @@ function this:RefreshBase() -- 商店标题 if self.ShopConfig.Title and self.ShopConfig.Title ~= "" then - self.titleImg:GetComponent("Image").sprite = this.spLoader:LoadSprite(self.ShopConfig.Title) + self.titleImg:GetComponent("Image").sprite = self.spLoader:LoadSprite(self.ShopConfig.Title) end -- 对话显示 @@ -467,17 +467,17 @@ function this:ShopItemAdapter(shopItem, itemData) -- 折扣 if price == 0 then discountbg:SetActive(true) - discountbg:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_shop_zhekou_00_zh") + discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_00_zh") else local isDiscount = itemInfo.IsDiscount == 1 discountbg:SetActive(isDiscount) if isDiscount then - discountbg:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_shop_zhekou_0" .. itemInfo.DiscountDegree.."_zh") + discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" .. itemInfo.DiscountDegree.."_zh") end end -- 消耗物品的信息 itemPrice.text = PrintWanNum2(tonumber(price))--tostring(price) - costIcon.sprite = SetIcon(this.spLoader, costId) + costIcon.sprite = SetIcon(self.spLoader, costId) -- 判断商品栏位是否解锁 local _IsUnLock = true @@ -571,7 +571,7 @@ function this:RechargeShopItemAdapter(shopItem, itemData) -- 计算数据 local itemInfo = ShopManager.GetRechargeItemInfo(itemData.goodsId) - icon.sprite = this.spLoader:LoadSprite(GetResourcePath(itemInfo.Resources)) + icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemInfo.Resources)) num.text = itemInfo.BaseReward[1][2] price.text = MoneyUtil.GetMoneyUnitNameWithMoney(itemInfo.Price) --.. MoneyUtil.GetMoney(itemInfo.Price) diff --git a/Assets/Resources/language.txt b/Assets/Resources/Language.json similarity index 100% rename from Assets/Resources/language.txt rename to Assets/Resources/Language.json diff --git a/Assets/Resources/language.txt.meta b/Assets/Resources/Language.json.meta similarity index 75% rename from Assets/Resources/language.txt.meta rename to Assets/Resources/Language.json.meta index 1b41838979..97b599f897 100644 --- a/Assets/Resources/language.txt.meta +++ b/Assets/Resources/Language.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2da61b816f9280346b8ee1f5ab41c5d9 +guid: 11ce2c571a0d245c99e09352a3ae99dd TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Scripts/Core/ResMgr/ResourcesMgr/Manager/ResourcesManager.cs b/Assets/Scripts/Core/ResMgr/ResourcesMgr/Manager/ResourcesManager.cs index 08da6b6dda..88179a3d34 100644 --- a/Assets/Scripts/Core/ResMgr/ResourcesMgr/Manager/ResourcesManager.cs +++ b/Assets/Scripts/Core/ResMgr/ResourcesMgr/Manager/ResourcesManager.cs @@ -131,8 +131,13 @@ namespace ResMgr { } public IEnumerator LoadTextureFromStream(string name, LuaFunction luaFunction) { - XDebug.Log.l(Application.streamingAssetsPath + "/Res/" + name + ".png"); - UnityWebRequest www = UnityWebRequestTexture.GetTexture(Application.streamingAssetsPath + "/Res/"+ name + ".png"); + + string filePath = Application.streamingAssetsPath + "/Res/" + name + ".png"; +#if UNITY_IOS + filePath = "file://" + filePath; +#endif + XDebug.Log.l(filePath); + UnityWebRequest www = UnityWebRequestTexture.GetTexture(filePath); yield return www.SendWebRequest(); if (www.isNetworkError || www.isHttpError) { @@ -158,8 +163,12 @@ namespace ResMgr { } public IEnumerator LoadTextFromStream(string name, LuaFunction luaFunction) { - XDebug.Log.l(Application.streamingAssetsPath + "/Res/" + name + ".txt"); - UnityWebRequest www = UnityWebRequest.Get(Application.streamingAssetsPath + "/Res/" + name + ".txt"); + string filePath = Application.streamingAssetsPath + "/Res/" + name + ".txt"; +#if UNITY_IOS + filePath = "file://" + filePath; +#endif + XDebug.Log.l(filePath); + UnityWebRequest www = UnityWebRequest.Get(filePath); yield return www.SendWebRequest(); if (www.isNetworkError || www.isHttpError) { diff --git a/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs b/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs index 5916e2b96a..fc316790d8 100644 --- a/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs +++ b/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs @@ -173,8 +173,13 @@ namespace ResMgr /// void InitResPathConfig() { - string path = string.Format("LZMA/ResConfigs").ToLower() + ResConfig.ABExtName; - string fullPath = PathHelper.GetFullPath (path); + +#if UNITY_IOS + string path = string.Format("LZMA_ResConfigs").ToLower() + ResConfig.ABExtName; +#else + string path = string.Format("LZMA/ResConfigs").ToLower() + ResConfig.ABExtName; +#endif + string fullPath = PathHelper.GetFullPath (path); AssetBundle ab = AssetBundle.LoadFromFile(fullPath, 0, GameLogic.AppConst.EncyptBytesLength); //AssetBundle ab = AssetBundle.LoadFromMemory(XXTEA.Decrypt(File.ReadAllBytes(fullPath))); ResPathConfig = ab.LoadAsset("ResourcePathConfig"); diff --git a/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs b/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs index cbe6c65c49..5d7fd17f22 100644 --- a/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs +++ b/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs @@ -552,6 +552,9 @@ namespace GameEditor.AssetBundle string assetBundleName = path.Replace(GameLogic.AppConst.GameResName + "/",string.Empty); assetBundleName = compressType.ToString() + "/" + assetBundleName; +#if PLATFORM_IOS + assetBundleName = assetBundleName.Replace("/", "_"); +#endif //Debug.LogError("path:" + path + " => abname:" + assetBundleName); return assetBundleName; } diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs index 3ea421fbac..1e6c709916 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs @@ -125,8 +125,15 @@ namespace GameEditor.FrameTool { { string exportPath = AssetBundle.AssetBundleConfig.GetExportPath(EditorUserBuildSettings.activeBuildTarget); string targetPath = FrameTool.GetStreamingAssetPath(EditorUserBuildSettings.activeBuildTarget); + +#if PLATFORM_IOS + File.Copy(exportPath + "/lzma_luabytes.unity3d", targetPath + "/lzma_luabytes.unity3d", true); + File.Copy(exportPath + "/lzma_resconfigs.unity3d", targetPath + "/lzma_resconfigs.unity3d", true); +#else File.Copy(exportPath + "/lzma/luabytes.unity3d", targetPath + "/lzma/luabytes.unity3d", true); File.Copy(exportPath + "/lzma/resconfigs.unity3d", targetPath + "/lzma/resconfigs.unity3d", true); +#endif + File.Copy(exportPath + "/files.unity3d", targetPath + "/files.unity3d", true); //SaveVersionFile(); } diff --git a/Assets/Scripts/Editor/Util/ProcessUtil.cs b/Assets/Scripts/Editor/Util/ProcessUtil.cs index 43da873b71..7b3d864b10 100644 --- a/Assets/Scripts/Editor/Util/ProcessUtil.cs +++ b/Assets/Scripts/Editor/Util/ProcessUtil.cs @@ -55,6 +55,39 @@ namespace GameEditor.Util } public static void ProcessCommand(string dir, string[] coms, bool isShowWindow = false) { +#if UNITY_IOS + string shellPath = Path.Combine(dir, "coms.shell"); + if (!File.Exists(shellPath)) + { + File.Create(shellPath).Close(); + } + File.WriteAllLines(shellPath, coms); + + System.Diagnostics.Process p = new System.Diagnostics.Process(); + //设置要启动的应用程序 + p.StartInfo.FileName = "/bin/bash"; + //是否使用操作系统shell启动 + p.StartInfo.UseShellExecute = false; + //接受来自调用程序的输入信息 + p.StartInfo.RedirectStandardInput = false; + //输出信息 + p.StartInfo.RedirectStandardOutput = false; + //输出错误 + p.StartInfo.RedirectStandardError = false; + //不显示程序窗口 + p.StartInfo.CreateNoWindow = !isShowWindow; + //设置文件夹 + p.StartInfo.WorkingDirectory = dir; + p.StartInfo.Arguments = shellPath; + //启动程序 + p.Start(); + //等待程序执行完退出进程 + p.WaitForExit(); + //关闭 + p.Close(); + //删除命令行文件 + File.Delete(shellPath); +#else System.Diagnostics.Process p = new System.Diagnostics.Process(); //设置要启动的应用程序 p.StartInfo.FileName = "cmd.exe"; @@ -86,6 +119,7 @@ namespace GameEditor.Util //等待程序执行完退出进程 //p.WaitForExit(); p.Close(); +#endif } diff --git a/Assets/Scripts/GameInit/GameStart.cs b/Assets/Scripts/GameInit/GameStart.cs index 0aa0201784..c9762a57b8 100644 --- a/Assets/Scripts/GameInit/GameStart.cs +++ b/Assets/Scripts/GameInit/GameStart.cs @@ -52,10 +52,16 @@ public class GameStart : MonoBehaviour bool isShowSplash = true; if (isShowSplash) { - string path = AppConst.PersistentDataPath + "lz4/splashpanel.unity3d"; +#if UNITY_IOS + string splashFilePath = "lz4_splashpanel.unity3d"; +#else + string splashFilePath = "lz4/splashpanel.unity3d"; +#endif + + string path = AppConst.PersistentDataPath + splashFilePath; if (!File.Exists(path)) { - path = AppConst.StreamPath + "lz4/splashpanel.unity3d"; + path = AppConst.StreamPath + splashFilePath; } bundle = AssetBundle.LoadFromFile(path, 0, GameLogic.AppConst.EncyptBytesLength); GameObject gameObj = bundle.LoadAsset("SplashPanel"); diff --git a/Assets/Scripts/GameInit/SLanguageMoreLanguageMgr.cs b/Assets/Scripts/GameInit/SLanguageMoreLanguageMgr.cs index 31237ec42e..edb872b0d6 100644 --- a/Assets/Scripts/GameInit/SLanguageMoreLanguageMgr.cs +++ b/Assets/Scripts/GameInit/SLanguageMoreLanguageMgr.cs @@ -93,7 +93,7 @@ namespace GameLogic /// /// 版本号文件 /// - const string languageFilePath = "language"; + const string languageFilePath = "Language"; /// /// 版本文件路径 /// @@ -101,7 +101,7 @@ namespace GameLogic { get { - return AppConst.PersistentDataPath + languageFilePath + ".txt"; + return AppConst.PersistentDataPath + languageFilePath + ".json"; } } public class languageStruct diff --git a/Assets/Scripts/GameInit/UpdateManager.cs b/Assets/Scripts/GameInit/UpdateManager.cs index cdeefded53..22020c9e22 100644 --- a/Assets/Scripts/GameInit/UpdateManager.cs +++ b/Assets/Scripts/GameInit/UpdateManager.cs @@ -114,10 +114,16 @@ namespace GameLogic { void CreateUpdatePanel() { if (AppConst.bundleMode) { - string path = AppConst.PersistentDataPath + "lz4/updatepanel.unity3d"; +#if UNITY_IOS + string updateFilePath = "lz4_updatepanel.unity3d"; +#else + string updateFilePath = "lz4/updatepanel.unity3d"; +#endif + + string path = AppConst.PersistentDataPath + updateFilePath; if (!File.Exists(path)) { - path = AppConst.StreamPath + "lz4/updatepanel.unity3d"; + path = AppConst.StreamPath + updateFilePath; } bundle = AssetBundle.LoadFromFile(path, 0, GameLogic.AppConst.EncyptBytesLength); if (bundle == null) diff --git a/Assets/Scripts/GameInit/UpdatePanel.cs b/Assets/Scripts/GameInit/UpdatePanel.cs index 7129833351..5318239c5e 100644 --- a/Assets/Scripts/GameInit/UpdatePanel.cs +++ b/Assets/Scripts/GameInit/UpdatePanel.cs @@ -39,8 +39,13 @@ namespace GameLogic public IEnumerator LoadFromStream(Action act) { - XDebug.Log.l(Application.streamingAssetsPath + "/Res/PackConfig.txt"); - UnityWebRequest uwr = UnityWebRequest.Get(Application.streamingAssetsPath + "/Res/PackConfig.txt"); + + string filePath = Application.streamingAssetsPath + "/Res/PackConfig.txt"; +#if UNITY_IOS + filePath = "file://" + filePath; +#endif + XDebug.Log.l(filePath); + UnityWebRequest uwr = UnityWebRequest.Get(filePath); yield return uwr.SendWebRequest(); if (uwr.isNetworkError || uwr.isHttpError) { @@ -54,8 +59,11 @@ namespace GameLogic { Hashtable table = MiniJSON.jsonDecode(uwr.downloadHandler.text) as Hashtable; string bgName = table["UpdatePanelBG"] as string; - - UnityWebRequest www = UnityWebRequestTexture.GetTexture(Application.streamingAssetsPath + "/Res/" + bgName + ".png"); + string texPath = Application.streamingAssetsPath + "/Res/" + bgName + ".png"; +#if UNITY_IOS + texPath = "file://" + texPath; +#endif + UnityWebRequest www = UnityWebRequestTexture.GetTexture(texPath); yield return www.SendWebRequest(); if (www.isNetworkError || www.isHttpError) {