Merge branch 'master' into TreasureRevise
Conflicts:
| | |
| | |
|
| | | public void ResetOriginal()
|
| | | {
|
| | | SnxxzGame.Instance.StopAllCameraCo();
|
| | | StopAllCoroutines();
|
| | | RotationDamping = 0.02f;
|
| | | ZoomDamping = 0.02f;
|
| | | sceneDistance = Distance = originalDistance;
|
| | |
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | if (!AssetSource.allFromEditor)
|
| | | {
|
| | | FileExtersion.DirectoryCopy(ResourcesPath.CONFIG_FODLER, ResourcesPath.Instance.StreamingAssetPath + "config");
|
| | | FileExtersion.DirectoryCopy(ResourcesPath.ResourcesOutPath + "BuiltIn", ResourcesPath.Instance.StreamingAssetPath + "builtin");
|
| | | }
|
| | | #endif
|
| | | if (!firstLaunch)
|
| | | {
|
| | | done = true;
|
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using Snxxz.UI;
|
| | |
|
| | | using System;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | |
| | |
|
| | | bool m_Completed = false;
|
| | | public bool completed { get { return m_Completed; } set { m_Completed = value; } }
|
| | | public float progress { get { return Mathf.Clamp01((Time.time - startTime) * 0.1f + ConfigInitiator.progress * 0.7f); } }
|
| | |
|
| | | float startTime = 0f;
|
| | | DateTime startTime;
|
| | |
|
| | | public void Begin()
|
| | | {
|
| | | completed = false;
|
| | | startTime = Time.time;
|
| | | startTime = DateTime.Now;
|
| | | ConfigInitiator.Init();
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (!completed && ConfigInitiator.done)
|
| | | {
|
| | | DebugEx.LogFormat("解析配置表耗时:{0}", (DateTime.Now - startTime).TotalMilliseconds);
|
| | |
|
| | | try
|
| | | {
|
| | | InGameDownLoad.Instance.ParseRewardConfig();
|
| | |
| | | {
|
| | | AssetDeCompressTask.Delete7zFiles(ResourcesPath.Instance.ExternalStorePath);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("解析配置表耗时:{0}", Time.time - startTime);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void StopAllCameraCo()
|
| | | {
|
| | | StopCoroutine("Co_ResetCamera");
|
| | | StopCoroutine("Co_MovingCamera");
|
| | | }
|
| | |
|
| | | private IEnumerator Co_MovingCamera(int _type)
|
| | | {
|
| | | var _areaCamera = AreaCameraConfig.Get(_type);
|
| | |
| | | Js = 4,// 极速
|
| | | Yj = 5,// 易接
|
| | | Yl = 6,// 易乐
|
| | | Xn = 7,// 小牛
|
| | | Cjm = 8,// 超级梦
|
| | | }
|
| | |
|
| | | public E_ChannelPlatform ChannelPlatform { get; set; }
|
| | |
|
| | | public static string Yj_AppID
|
| | | {
|
| | | get; private set;
|
| | | }
|
| | |
|
| | | public static string Yj_Version
|
| | | {
|
| | | get; private set;
|
| | | }
|
| | |
| | | {
|
| | | Yj_AppID = string.Empty;
|
| | | Yj_SpID = string.Empty;
|
| | | Yj_Version = string.Empty;
|
| | | RegistrationID = string.Empty;
|
| | | AssetCopyFinished = false;
|
| | | ChannelPlatform = E_ChannelPlatform.Free;
|
| | |
| | | {
|
| | | _result = "yileplatform";
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Xn)
|
| | | {
|
| | | using (AndroidJavaClass _jc = new AndroidJavaClass("com.secondworld.univeralsdk.UniversalUtil"))
|
| | | {
|
| | | _result = _jc.CallStatic<string>("getMetaString", "XnAppID");
|
| | | }
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Cjm)
|
| | | {
|
| | | using (AndroidJavaClass _jc = new AndroidJavaClass("com.secondworld.univeralsdk.UniversalUtil"))
|
| | | {
|
| | | _result = _jc.CallStatic<string>("getMetaString", "SUPERDREAM_APPID");
|
| | | }
|
| | | }
|
| | | break;
|
| | | case RuntimePlatform.IPhonePlayer:
|
| | | _result = "ios";//ios平台固定返回ios
|
| | |
| | | {
|
| | | ChannelPlatform = E_ChannelPlatform.Yl;
|
| | | }
|
| | | else if (_channelPlatform.Equals("xn"))
|
| | | {
|
| | | ChannelPlatform = E_ChannelPlatform.Xn;
|
| | | }
|
| | | else if (_channelPlatform.Equals("cjm"))
|
| | | {
|
| | | ChannelPlatform = E_ChannelPlatform.Cjm;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | Yj_SpID = _json["yj_spid"].ToString();
|
| | | }
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Xn)
|
| | | {
|
| | | if (_dict.Contains("xnappid"))
|
| | | {
|
| | | Yj_AppID = _json["xnappid"].ToString();
|
| | | }
|
| | |
|
| | | if (_dict.Contains("xnversion"))
|
| | | {
|
| | | Yj_Version = _json["xnversion"].ToString();
|
| | | }
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Cjm)
|
| | | {
|
| | | if (_dict.Contains("cjmappid"))
|
| | | {
|
| | | Yj_AppID = _json["cjmappid"].ToString();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | if (_dict.Contains("banhao"))
|
| | | {
|
| | |
| | | {
|
| | | m_PaymentTable["RechargeChannel"] = "6";
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Xn)
|
| | | {
|
| | | m_PaymentTable["RechargeChannel"] = "7";
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Cjm)
|
| | | {
|
| | | m_PaymentTable["RechargeChannel"] = "8";
|
| | | }
|
| | |
|
| | | var _stringBuilder = new System.Text.StringBuilder();
|
| | | var _md5Body = _stringBuilder.Append(m_PaymentTable["AppID"]).
|
| | |
| | | m_Json["mount"] = money;
|
| | | m_Json["cpInfo"] = cpInfo;
|
| | | m_Json["title"] = title;
|
| | |
|
| | | if(ChannelPlatform == E_ChannelPlatform.Mr
|
| | | || ChannelPlatform == E_ChannelPlatform.Sp
|
| | | || ChannelPlatform == E_ChannelPlatform.Yl)
|
| | | {
|
| | | m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID;
|
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
|
| | | }
|
| | |
|
| | | if (ChannelPlatform == E_ChannelPlatform.Mr)
|
| | | {
|
| | | m_Json["notifyurl"] = _json["notifyurl"];
|
| | | }
|
| | | else if(ChannelPlatform == E_ChannelPlatform.Sp)
|
| | | {
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString();
|
| | | m_Json["money"] = PlayerDatas.Instance.baseData.Gold.ToString();
|
| | | m_Json["gameName"] = VersionConfig.Get().productName;
|
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
|
| | |
|
| | | if (ChannelPlatform == E_ChannelPlatform.Mr)
|
| | | {
|
| | | m_Json["notifyurl"] = _json["notifyurl"];
|
| | | }
|
| | | #if UNITY_IOS
|
| | | m_Json["identifier"] = VersionConfig.Get().bundleIdentifier;
|
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(LaunchPostProcess); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 1, 2, 1); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 1, 1, 1); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Begin", _m_Begin); |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "completed", _g_get_completed); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "progress", _g_get_progress); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "completed", _s_set_completed); |
| | | |
| | |
| | | |
| | | LaunchPostProcess gen_to_be_invoked = (LaunchPostProcess)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.completed); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_progress(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | LaunchPostProcess gen_to_be_invoked = (LaunchPostProcess)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.progress); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | public void OnSwitchAccount()
|
| | | {
|
| | | IsMatching = false;
|
| | | if (clientMatchClock!=null )
|
| | | {
|
| | | clientMatchClock.Stop();
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | var randomWaitSeconds = UnityEngine.Random.Range(3, 8);
|
| | | clientMatchClock = Clock.Create(DateTime.Now + new TimeSpan(randomWaitSeconds * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | if (StageLoad.Instance.stageType == Stage.E_StageType.Dungeon)
|
| | | IsMatching = false;
|
| | | if (GameNetSystem.Instance.netState == GameNetSystem.NetState.Connected)
|
| | | {
|
| | | ClientCrossServerOneVsOne.FakeMatchOk();
|
| | | }
|
| | |
| | |
|
| | | public void RequestChallangeDungeon(int _dataMapId, int _lineId)
|
| | | {
|
| | | var dungeonConfig = DungeonConfig.Get(GetDungeonId(_dataMapId, _lineId));
|
| | | if (!AssetSource.sceneFromEditor)
|
| | | {
|
| | | var dungeonConfig = DungeonConfig.Get(GetDungeonId(_dataMapId, _lineId));
|
| | | var assetValid = true;
|
| | | if (dungeonConfig != null)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | var model = ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>();
|
| | | if (model.IsMatching)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching8", dungeonConfig.MapID);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (CrossServerLogin.Instance.IsEnterCrossServerPreparing())
|
| | | {
|
| | | return;
|
| | |
| | | {
|
| | | instanceId = _instanceId,
|
| | | npcId = _npcId,
|
| | | hp = boss.ActorInfo.RealHp,
|
| | | maxHp = boss.ActorInfo.RealMaxHp,
|
| | | hp = _hp,
|
| | | maxHp = _maxHp,
|
| | | level = boss.ActorInfo.LV
|
| | | };
|
| | | }
|
| | |
| | |
|
| | | if (_victimId == boss.ServerInstID)
|
| | | {
|
| | | TargetBriefInfo.OnRefreshBossLifeBar(_victimId, 0, 0, 0);
|
| | | TargetBriefInfo.OnRefreshBossLifeBar(_victimId, boss.NpcConfig.NPCID, (ulong)Random.Range(0, 1000), 1000);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | bool inited = false;
|
| | |
|
| | | long m_CurrentHp = BOSSHP_TOTAL;
|
| | | long currentHp
|
| | | {
|
| | | get
|
| | | {
|
| | | long currentHp {
|
| | | get {
|
| | | return m_CurrentHp;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (value <= 0)
|
| | | {
|
| | | m_CurrentHp = 0;
|
| | |
| | | bossInfo = TargetBriefInfo.bossInfo;
|
| | | if (bossInfo.instanceId != 0)
|
| | | {
|
| | | if (inited)
|
| | | {
|
| | | RefreshBossLifeBar();
|
| | | }
|
| | | else
|
| | | {
|
| | | InitBossLifeBar();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void InitBossLifeBar()
|
| | | void InitBossLifeBar()
|
| | | {
|
| | | var config = NPCConfig.Get(TargetBriefInfo.bossInfo.npcId);
|
| | | if (config!=null)
|
| | | {
|
| | | m_BossLifeBar.gameObject.SetActive(true);
|
| | | var npcConfig = NPCConfig.Get(TargetBriefInfo.bossInfo.npcId);
|
| | | currentHp = (long)(model.mission.remainHPPer * 0.000001d * BOSSHP_TOTAL);
|
| | |
|
| | | m_BossLifeBar.SetBaseInfo(TargetBriefInfo.bossInfo.npcId, (ulong)currentHp, BOSSHP_TOTAL, npcConfig.NPCLV);
|
| | | m_BossLifeBar.SetBaseInfo(TargetBriefInfo.bossInfo.npcId, (ulong)currentHp, BOSSHP_TOTAL, config.NPCLV);
|
| | | inited = true;
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateServerRemainHP()
|
| | | {
|
| | |
| | | public SDKUtility.FP_LoginOk sdkLoginResult;
|
| | | public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
|
| | |
|
| | | public string localSaveAccountName {
|
| | | public string localSaveAccountName
|
| | | {
|
| | | get { return LocalSave.GetString(USER_ACCOUNT); }
|
| | | set { LocalSave.SetString(USER_ACCOUNT, value); }
|
| | | }
|
| | |
| | | public event Action accountBindOkEvent;
|
| | |
|
| | | bool m_ReconnecBackGround = false;
|
| | | public bool reconnectBackGround {
|
| | | public bool reconnectBackGround
|
| | | {
|
| | | get { return m_ReconnecBackGround; }
|
| | | set { m_ReconnecBackGround = value; }
|
| | | }
|
| | |
|
| | | bool m_OnCreateRole = false;
|
| | | public bool onCreateRole {
|
| | | public bool onCreateRole
|
| | | {
|
| | | get { return m_OnCreateRole; }
|
| | | set { m_OnCreateRole = value; }
|
| | | }
|
| | |
|
| | | bool m_Busy = false;
|
| | | public bool busy {
|
| | | public bool busy
|
| | | {
|
| | | get { return m_Busy; }
|
| | | set { m_Busy = value; }
|
| | | }
|
| | |
| | | {
|
| | | send.IDType = 6;
|
| | | }
|
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Xn)
|
| | | {
|
| | | send.IDType = 7;
|
| | | send.Extra += ("|" + SDKUtility.Yj_AppID + "|" + SDKUtility.Yj_Version);
|
| | | send.ExtraLen = (byte)send.Extra.Length;
|
| | | }
|
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Cjm)
|
| | | {
|
| | | send.IDType = 8;
|
| | | send.Extra += ("|" + SDKUtility.Yj_AppID + "|" + SDKUtility.Instance.FreePlatformInfo.token);
|
| | | send.ExtraLen = (byte)send.Extra.Length;
|
| | | }
|
| | | send.AccID = sdkLoginResult.account;
|
| | | if (SDKUtility.Instance.ChannelPlatform != SDKUtility.E_ChannelPlatform.Cjm)
|
| | | {
|
| | | send.Password = sdkLoginResult.token;
|
| | | }
|
| | | else
|
| | | {
|
| | | send.Password = "";
|
| | | }
|
| | | send.MAC = DeviceUtility.GetMac();
|
| | | send.Version = _serverInfo.Version;
|
| | | send.LineNO = 255;
|
| | |
| | | {
|
| | | var guideRecord = currentGuide;
|
| | | currentGuide = 0;
|
| | | WindowCenter.Instance.Close<NewBieWin>();
|
| | | WindowCenter.Instance.CloseImmediately("NewBieWin");
|
| | |
|
| | | if (!completeGuidesBuf.Contains(guideRecord))
|
| | | {
|
| | |
| | | GameNetSystem.Instance.SendInfo(send);
|
| | |
|
| | | currentGuide = 0;
|
| | | WindowCenter.Instance.Close<NewBieWin>();
|
| | | WindowCenter.Instance.CloseImmediately("NewBieWin");
|
| | |
|
| | | var allGuideKeys = GuideConfig.GetKeys();
|
| | | for (int i = 0; i < allGuideKeys.Count; i++)
|
| | |
| | | GameNetSystem.Instance.SendInfo(send);
|
| | |
|
| | | currentGuide = 0;
|
| | | WindowCenter.Instance.Close<NewBieWin>();
|
| | | WindowCenter.Instance.CloseImmediately("NewBieWin");
|
| | |
|
| | | completeGuidesBuf.Clear();
|
| | | }
|
| | |
| | |
|
| | | public void RequestPrepareEnterDungeon(bool _prepare)
|
| | | {
|
| | | var crossServerOneVsOneModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>();
|
| | | if (crossServerOneVsOneModel.IsMatching)
|
| | | {
|
| | | crossServerOneVsOneModel.SendCrossMatch(0);
|
| | | }
|
| | |
|
| | | var sendInfo = new CB909_tagCGTeamMemberPrepare();
|
| | | sendInfo.PrepareState = (byte)(_prepare ? 1 : 2);
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|