| | |
| | | {
|
| | | GameNetSystem.Instance.LoginOut();
|
| | | ServerForceExitHintWin.reason = 111;
|
| | | WindowCenter.Instance.Open<ServerForceExitHintWin>();
|
| | | }
|
| | | } |
| | | |
| | |
| | |
|
| | | #if UNITY_IOS
|
| | | tasks.Enqueue(getVersionInfoTask);
|
| | | #if !UNITY_EDITOR
|
| | | tasks.Enqueue(assetCopyTask);
|
| | | #endif
|
| | | #endif
|
| | |
|
| | |
|
| | | tasks.Enqueue(checkAssetValidTask);
|
| | | tasks.Enqueue(downLoadAssetTask);
|
| | |
| | | public class AssetCopyTask : LaunchTask
|
| | | {
|
| | | int completedCount = 0;
|
| | | int totalCount = 1;
|
| | | int totalCount = -1;
|
| | | List<FileInfo> copyTasks = new List<FileInfo>();
|
| | |
|
| | | public override float expectTime {
|
| | |
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | duration = Mathf.Max(0.5f, expectTime);
|
| | | outTime = 50f;
|
| | | #if UNITY_ANDROID
|
| | | #if UNITY_ANDROID && !UNITY_EDITOR
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.FullAsset:
|
| | |
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 1)
|
| | | {
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | |
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | done = true;
|
| | | #endif
|
| | |
|
| | | }
|
| | |
|
| | | public override void End()
|
| | | {
|
| | | expectTime = timer;
|
| | | DebugEx.LogFormat("{0}执行时长:{1};", this.GetType().Name, timer);
|
| | | #if UNITY_IOS
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | LocalSave.SetString("AssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | #endif
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | timer += Time.deltaTime;
|
| | | #if UNITY_ANDROID
|
| | | #if UNITY_ANDROID && !UNITY_EDITOR
|
| | | if (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | done = false;
|
| | |
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | if (totalCount > 0)
|
| | | {
|
| | | if (completedCount < totalCount)
|
| | |
| | |
|
| | | public override void UnInitialize()
|
| | | {
|
| | | ServerForceExitHintWin.reason = 0;
|
| | | StopAllCoroutines();
|
| | | base.UnInitialize();
|
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | | if (ServerForceExitHintWin.reason != 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<ServerForceExitHintWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnLateUpdate()
|
| | | {
|
| | | base.OnLateUpdate();
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Thursday, February 14, 2019
|
| | | // [ Date ]: Saturday, February 16, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public readonly int DanType;
|
| | | public readonly string IconKey;
|
| | | public readonly int LVUpScore;
|
| | | public readonly int robotProbability;
|
| | |
|
| | | public CrossServerArenaConfig()
|
| | | {
|
| | |
| | | IconKey = tables[3];
|
| | |
|
| | | int.TryParse(tables[4],out LVUpScore);
|
| | |
|
| | | int.TryParse(tables[5],out robotProbability); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: f10a2faba8659904ab5c13d1a770a7e2 |
| | | timeCreated: 1550121679 |
| | | timeCreated: 1550288387 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Saturday, February 16, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class CrossServerOneVsOneRobotConfig |
| | | { |
| | | |
| | | public readonly int id; |
| | | public readonly int scoreClass; |
| | | public readonly string equips; |
| | | |
| | | public CrossServerOneVsOneRobotConfig() |
| | | { |
| | | } |
| | | |
| | | public CrossServerOneVsOneRobotConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out id); |
| | | |
| | | int.TryParse(tables[1],out scoreClass); |
| | | |
| | | equips = tables[2]; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, CrossServerOneVsOneRobotConfig> configs = new Dictionary<string, CrossServerOneVsOneRobotConfig>(); |
| | | public static CrossServerOneVsOneRobotConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("CrossServerOneVsOneRobotConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | CrossServerOneVsOneRobotConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new CrossServerOneVsOneRobotConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static CrossServerOneVsOneRobotConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<CrossServerOneVsOneRobotConfig> GetValues() |
| | | { |
| | | var values = new List<CrossServerOneVsOneRobotConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/CrossServerOneVsOneRobot.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/CrossServerOneVsOneRobot.txt"); |
| | | } |
| | | |
| | | var tempConfig = new CrossServerOneVsOneRobotConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new CrossServerOneVsOneRobotConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new CrossServerOneVsOneRobotConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c590e4deb8bcd944b93494938f79c731 |
| | | timeCreated: 1550281835 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public PlayerRankData rank { get { return m_Rank; } }
|
| | |
|
| | | StoreModel m_StoreModel;
|
| | | StoreModel StoreModel {
|
| | | StoreModel StoreModel
|
| | | {
|
| | | get { return m_StoreModel ?? (m_StoreModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | if (vNetData.RefreshType[i].RefreshType == (int)PlayerDataRefresh.HP)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | var data = new H0418_tagObjInfoRefresh();
|
| | | data.socketType = vNetData.socketType;
|
| | | data.ObjID = vNetData.ObjID;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public partial class CrossServerOneVsOneRobotConfig : IConfigPostProcess |
| | | { |
| | | static Dictionary<int, List<CrossServerOneVsOneRobotConfig>> classToConfigs = new Dictionary<int, List<CrossServerOneVsOneRobotConfig>>(); |
| | | |
| | | public void OnConfigParseCompleted() |
| | | { |
| | | if (!classToConfigs.ContainsKey(scoreClass)) |
| | | { |
| | | classToConfigs[scoreClass] = new List<CrossServerOneVsOneRobotConfig>(); |
| | | } |
| | | |
| | | classToConfigs[scoreClass].Add(this); |
| | | } |
| | | |
| | | |
| | | public static CrossServerOneVsOneRobotConfig GetRandomRobotConfig(int scoreClass) |
| | | { |
| | | if (!classToConfigs.ContainsKey(scoreClass)) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | var configs = classToConfigs[scoreClass]; |
| | | var random = UnityEngine.Random.Range(0, configs.Count); |
| | | return configs[random]; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7be599c0e1e7c1543982783f9b9e6070 |
| | | timeCreated: 1550288532 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A2 31 前端开始自定义场景 #tagCMClientStartCustomScene |
| | | |
| | | public class CA231_tagCMClientStartCustomScene : GameNetPackBasic |
| | | { |
| | | |
| | | public CA231_tagCMClientStartCustomScene() |
| | | { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA231; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dac5e3d3907d6e94a86612907372331c |
| | | timeCreated: 1550133153 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // C1 08 跨服PK挑战机器人结算 #tagCMCrossRealmPKRobotOver |
| | | |
| | | public class CC108_tagCMCrossRealmPKRobotOver : GameNetPackBasic |
| | | { |
| | | public byte IsWin; //是否获胜 |
| | | |
| | | public CC108_tagCMCrossRealmPKRobotOver() |
| | | { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xC108; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(IsWin, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 920284967326a6b4cbb749c4c87899f9 |
| | | timeCreated: 1550133362 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine;
|
| | | using Snxxz.UI;
|
| | |
|
| | | using System;
|
| | | //01 02 玩家初始化#tagCDBPlayer
|
| | |
|
| | |
| | | PlayerDatas.Instance.InitPlayerData(package);
|
| | | PlayerDatas.Instance.RequestWorldTick();
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
|
| | | }
|
| | |
|
| | | if (package.socketType == ServerType.Main)
|
| | | {
|
| | | if (playerIdBuf != 0 && playerIdBuf != PlayerDatas.Instance.baseData.PlayerID)
|
| | |
| | | package.VIPLv.ToString());
|
| | | }
|
| | |
|
| | | var dataMapId = MapUtility.GetDataMapId(package.MapID);
|
| | | var lineId = MapUtility.GetLineId(package.MapID, (int)package.ExAttr3);
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = MapUtility.GetDataMapId(mapId);
|
| | | var lineId = MapUtility.GetLineId(mapId, (int)package.ExAttr3);
|
| | | var mapResourceConfig = MapResourcesConfig.GetConfig(dataMapId, lineId);
|
| | | if (mapResourceConfig != null)
|
| | | {
|
| | |
| | | GA_Hero.MapOffset.z = 0;
|
| | | }
|
| | |
|
| | | var mapConfig = MapConfig.Get(package.MapID);
|
| | | var mapConfig = MapConfig.Get(mapId);
|
| | | DungeonStage.CurrentMapType = (MapType)mapConfig.MapFBType;
|
| | | if (DungeonStage.CurrentMapType != MapType.OpenCountry)
|
| | | {
|
| | |
| | |
|
| | | DropItemManager.ReleaseAll();
|
| | | StatusMgr.Instance.ReleaseActor(PlayerDatas.Instance.PlayerId);
|
| | |
|
| | | if (!ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | GAMgr.Instance.UnInit();
|
| | | }
|
| | |
|
| | | hero.OnPathFindStop -= MapTransferUtility.Instance.OnHeroStopPathFind;
|
| | | hero.OnPathFindStop += MapTransferUtility.Instance.OnHeroStopPathFind;
|
| | | GA_Hero.s_MapSwitching = true;
|
| | |
| | | StageLoad.Instance.UpdateServerFlag(package.socketType, false);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = mapConfig.MapID,
|
| | | toLineId = MapUtility.GetLineId(mapConfig.MapID, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | toMapId = mapId,
|
| | | toLineId = MapUtility.GetLineId(mapId, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | needEmpty = true,
|
| | | needLoadResource = false,
|
| | | serverType = package.socketType,
|
| | |
| | | StageLoad.Instance.UpdateServerFlag(package.socketType, false);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = mapConfig.MapID,
|
| | | toLineId = MapUtility.GetLineId(mapConfig.MapID, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | toMapId = mapId,
|
| | | toLineId = MapUtility.GetLineId(mapId, PlayerDatas.Instance.baseData.dungeonLineId),
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = package.socketType,
|
| | |
| | | {
|
| | | SDKUtility.Instance.FreePlatformLoginout();
|
| | | }
|
| | |
|
| | | //if (vNetData.Reason != 0
|
| | | // && vNetData.Reason != 11
|
| | | // && vNetData.Reason != 28
|
| | | // && vNetData.Reason != 51
|
| | | // && vNetData.Reason != 110)
|
| | | //{
|
| | | // DebugPkgCache.UpLoad();
|
| | | //}
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<ServerForceExitHintWin>();
|
| | | NetLinkWin.Hide();
|
| | | break;
|
| | | case ServerType.CrossSever:
|
| | |
| | | public class DTC0319_tagFBHelp : DtcBasic
|
| | | {
|
| | | DungeonModel m_Model;
|
| | | DungeonModel model
|
| | | {
|
| | | get
|
| | | {
|
| | | DungeonModel model {
|
| | | get {
|
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>());
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0319_tagFBHelp vNetData = vNetPack as H0319_tagFBHelp;
|
| | |
|
| | | model.UpdateMission(vNetData.Msg);
|
| | |
|
| | | switch (PlayerDatas.Instance.baseData.MapID)
|
| | |
| | | GAMgr.Instance.AddReJustPosActor(_actor);
|
| | | }
|
| | |
|
| | | if (CrossServerUtility.IsCrossServer())
|
| | | if (CrossServerUtility.IsCrossServer()
|
| | | || ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | if (vNetPack.socketType == ServerType.Main)
|
| | | {
|
| | | _actor.Pos = Constants.Special_Hide_Position;
|
| | | GAMgr.Instance.AddReJustPosActor(_actor);
|
| | | }
|
| | | }
|
| | |
| | | GAMgr.Instance.AddReJustPosActor(_actor); |
| | | } |
| | | |
| | | if (CrossServerUtility.IsCrossServer()) |
| | | if (CrossServerUtility.IsCrossServer() |
| | | || ClientDungeonStageUtility.isClientDungeon) |
| | | { |
| | | if (vNetData.socketType == ServerType.Main) |
| | | { |
| | | _actor.Pos = Constants.Special_Hide_Position; |
| | | GAMgr.Instance.AddReJustPosActor(_actor); |
| | | } |
| | | } |
| | |
| | | using UnityEngine; |
| | | using Snxxz.UI; |
| | | |
| | | //04 23 对象状态刷新通知(只显示)#tagObjPropertyRefreshView |
| | | //04 23 ����״̬ˢ��֪ͨ(ֻ��ʾ)#tagObjPropertyRefreshView |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (ClientDungeonStageUtility.isClientDungeon |
| | | #if UNITY_EDITOR |
| | | || RuntimeLogUtility.TEST_CLIENT_PVP |
| | | #endif |
| | | ) |
| | | { |
| | | if (vNetData.ObjID == PlayerDatas.Instance.PlayerId) |
| | | { |
| | | if (vNetData.AttackType == (byte)HurtAttackType.Recovery) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | GActor _target = GAMgr.Instance.GetBySID(vNetData.ObjID); |
| | | |
| | | if (_target == null) |
| | |
| | | }
|
| | | break;
|
| | | case CrossServerOneVsOneModel.CrossServerDataMapId:
|
| | | case ClientCrossServerOneVsOne.mapId:
|
| | | if (!WindowCenter.Instance.IsOpen<BattlePrepareCoolDownWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<BattlePrepareCoolDownWin>();
|
| | |
| | | GAMgr.Instance.AddReJustPosActor(_player);
|
| | | }
|
| | |
|
| | | if (CrossServerUtility.IsCrossServer())
|
| | | if (CrossServerUtility.IsCrossServer()
|
| | | || ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | if (vNetPack.socketType == ServerType.Main)
|
| | | {
|
| | | _player.Pos = Constants.Special_Hide_Position;
|
| | | GAMgr.Instance.AddReJustPosActor(_player);
|
| | | }
|
| | | }
|
| | |
| | | GAMgr.Instance.AddReJustPosActor(_pet); |
| | | } |
| | | |
| | | if (CrossServerUtility.IsCrossServer()) |
| | | if (CrossServerUtility.IsCrossServer() |
| | | || ClientDungeonStageUtility.isClientDungeon) |
| | | { |
| | | if (vNetPack.socketType == ServerType.Main) |
| | | { |
| | | _pet.Pos = Constants.Special_Hide_Position; |
| | | GAMgr.Instance.AddReJustPosActor(_pet); |
| | | } |
| | | } |
| | |
| | | teamModel.RequestCancelAutoMatchTeam();
|
| | | }
|
| | |
|
| | | CrossServerLogin.Instance.UpdateCrossServerOneVsOneData(package);
|
| | | CrossServerLogin.Instance.UpdateCrossServerOneVsOneData(package,false);
|
| | | WindowCenter.Instance.Open<CrossServerOneVsOneEnterConfirmWin>();
|
| | | ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>().IsMatching = false;
|
| | | }
|
| | |
| | | || skill.skillInfo.config.Skillactmark == GAStaticDefine.Act_Roll)
|
| | | {
|
| | | GActorFight _target = null;
|
| | |
|
| | | CB405_tagCMSuperAtk _b405 = null;
|
| | | if (!ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | // 创建发包协议
|
| | | CB405_tagCMSuperAtk _b405 = new CB405_tagCMSuperAtk();
|
| | | _b405 = new CB405_tagCMSuperAtk();
|
| | | _b405.SkillID = (ushort)skill.id;
|
| | | _b405.PosX = (ushort)(m_Hero.Pos.x * 2 + GA_Hero.MapOffset.x);
|
| | | _b405.PosY = (ushort)(m_Hero.Pos.z * 2 + GA_Hero.MapOffset.z);
|
| | | _b405.TagPosX = (ushort)(skill.targetPosition.x * 2 + GA_Hero.MapOffset.x);
|
| | | _b405.TagPosY = (ushort)(skill.targetPosition.z * 2 + GA_Hero.MapOffset.z);
|
| | | _b405.WorldTick = PlayerDatas.Instance.GetWorldTick();
|
| | | }
|
| | |
|
| | | _serverHurtList.Clear();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 人物, 非小怪不计算伤害,不生成客户端数据
|
| | | if (_target.ActorType == GameObjType.gotPlayer)
|
| | | if (_target.ActorType == GameObjType.gotPlayer
|
| | | && !(_target is GA_PVPClientPlayer))
|
| | | {
|
| | | GA_Player _player = _target as GA_Player;
|
| | | if (_player != null)
|
| | |
| | | skill.hurtClientList.Add(_hurtObject);
|
| | | }
|
| | |
|
| | | if (_b405 != null)
|
| | | {
|
| | | _b405.HurtCount = (ushort)_serverHurtList.Count;
|
| | | _b405.HurtList = new CB405_tagCMSuperAtk.tagSkillPosHurtObj[_b405.HurtCount];
|
| | | for (int i = 0; i < _b405.HurtCount; ++i)
|
| | |
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(_b405);
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | string _content = string.Format("# CB405_tagCMSuperAtk => {0} 使用技能 {1}",
|
| | |
| | | {
|
| | | PlayerDatas.Instance.FightRefreshPlayerHp((uint)target.ActorInfo.RealHp);
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | if (target.ServerInstID == PlayerDatas.Instance.PlayerId && target.ActorInfo.RealHp == 0)
|
| | | {
|
| | | GA_PVPClientPlayer.Result(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (target.ServerInstID == PlayerDatas.Instance.PlayerId)
|
| | |
| | | // -------------- 指定攻击方属性 --------------
|
| | | if (attacker.ActorType == GameObjType.gotPlayer)
|
| | | {
|
| | | float _rate = 1f;
|
| | | if (attacker is GA_PVPClientPlayer)
|
| | | {
|
| | | _rate = GeneralDefine.ClientPvpAttributePer;
|
| | | }
|
| | | _hitRate = PlayerDatas.Instance.extersion.HIT;
|
| | | _aSuperHitRate = PlayerDatas.Instance.extersion.SuperHitRate;
|
| | | _aLuckyHitRate = PlayerDatas.Instance.extersion.luckHitRate;
|
| | | _aZhuxianHurtPer = PlayerDatas.Instance.extersion.zhuxianHurtPer;
|
| | | _aZhuXianHitRate = PlayerDatas.Instance.extersion.zhuxianRate;
|
| | | _aMaxAtk = PlayerDatas.Instance.extersion.MAXATK;
|
| | | _aMinAtk = PlayerDatas.Instance.extersion.MINATK;
|
| | | _aMaxAtk = (int)(PlayerDatas.Instance.extersion.MAXATK * _rate);
|
| | | _aMinAtk = (int)(PlayerDatas.Instance.extersion.MINATK * _rate);
|
| | | _aIgnoreDefRate = PlayerDatas.Instance.extersion.IgnoreDefRate;
|
| | | _aSkillAtkRate = PlayerDatas.Instance.extersion.SkillAtkRate;
|
| | | _aDamagePer = PlayerDatas.Instance.extersion.DamagePer;
|
| | | _aFinalHurt = PlayerDatas.Instance.extersion.FinalHurt;
|
| | | _aIceAtk = PlayerDatas.Instance.extersion.realATK;
|
| | | _aFinalHurt = (int)(PlayerDatas.Instance.extersion.FinalHurt);
|
| | | _aIceAtk = (int)(PlayerDatas.Instance.extersion.realATK * _rate);
|
| | | _aOnlyFinalHurt = PlayerDatas.Instance.extersion.OnlyFinalHurt;
|
| | | _luckyHit = PlayerDatas.Instance.extersion.luckHitVal;
|
| | | _superHit = PlayerDatas.Instance.extersion.SuperHit;
|
| | |
| | |
|
| | | // PVE
|
| | | if (attacker.ActorType == GameObjType.gotPlayer
|
| | | && target.ActorType == GameObjType.gotNPC)
|
| | | && (target.ActorType == GameObjType.gotNPC || target is GA_PVPClientPlayer))
|
| | | {
|
| | | //"PVE_1" :"int(max((((max((aMaxAtk if isLuckyHit else (aMinAtk + (aMaxAtk - aMinAtk)*rand))
|
| | | // -dDef*max(1-aIgnoreDefRate/10000.0,0),1))*(1+(aLuckyHit/10000.0 if isLuckyHit else 0))
|
| | |
| | | #endif
|
| | | }
|
| | | // EVP
|
| | | else if (attacker.ActorType == GameObjType.gotNPC
|
| | | && target.ActorType == GameObjType.gotPlayer)
|
| | | else if ((attacker.ActorType == GameObjType.gotNPC
|
| | | && target.ActorType == GameObjType.gotPlayer) || attacker is GA_PVPClientPlayer)
|
| | | {
|
| | | // "EVP_1" :"max((max((aMinAtk+aMaxAtk)/2.0-dDef,0)+max(aIceAtk - dIceDef, 0))*(atkSkillPer+aSkillAtkRate/10000.0)*(1-min(dDamReduce,8000)/10000.0)*(1-min(dDamChanceDef,8000)/10000.0)+max(aFinalHurt-dFinalHurtReduce, 0)+atkSkillValue,1)"
|
| | |
|
| | |
| | |
|
| | | bool _clientRefreshCD = !PreFightMission.Instance.IsFinished()
|
| | | || PlayerDatas.Instance.baseData.MapID == 52020
|
| | | || userSID != PlayerDatas.Instance.PlayerId;
|
| | | || userSID != PlayerDatas.Instance.PlayerId
|
| | | || ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | ;
|
| | |
|
| | | if (_clientRefreshCD)
|
| | | {
|
| | | cd = skillInfo.config.CoolDownTime * Constants.F_GAMMA;
|
| | | }
|
| | |
|
| | | if (_clientRefreshCD = !PreFightMission.Instance.IsFinished()
|
| | | if (_clientRefreshCD
|
| | | || PlayerDatas.Instance.baseData.MapID == 52020)
|
| | | {
|
| | | if (RefreshCD != null)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (AttackHandler.CheckPull(attacker, target, bodyControlId) == false)
|
| | | {
|
| | | return;
|
| | |
| | |
|
| | | if (m_NpcPosList.Count > 0)
|
| | | {
|
| | | if (!ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
|
| | | _beatBack.ObjType = (byte)GameObjType.gotNPC;
|
| | | _beatBack.Count = (byte)m_NpcPosList.Count;
|
| | |
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(_beatBack);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_fight.ServerInstID == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (PreFightMission.Instance.IsFinished())
|
| | |
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | |
|
| | | if (OnCirclePanelTouched != null)
|
| | | {
|
| | | OnCirclePanelTouched();
|
| | |
| | | _movementVector = CameraController.Instance.transform.TransformDirection(inputVector);
|
| | | _movementVector.y = 0f;
|
| | | _movementVector.Normalize();
|
| | |
|
| | | if (_hero != null)
|
| | | {
|
| | | _hero.destForward = _movementVector;
|
| | |
|
| | | if (IsMoveValid())
|
| | | {
|
| | | if (!_hero.SkillMgr.DoingPrepareSkill
|
| | |
| | | _hero.State = E_ActorState.CtrlRun;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | | )
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | CB409_tagCMPyMove _b409 = new CB409_tagCMPyMove
|
| | | {
|
| | | ClientPosX = (ushort)(_hero.Pos.x * 100),
|
| | |
| | | case E_ActorClassType.PlayerSgzcRobot:
|
| | | _actor = new GA_NpcFightSgzcZZ();
|
| | | break;
|
| | | case E_ActorClassType.PVPClientPlayer:
|
| | | _actor = new GA_PVPClientPlayer();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return _actor as T;
|
| | | }
|
| | |
|
| | | public T ReqClntPlayer<T>(GA_PlayerClient.PlayerInfo info, E_ActorGroup group) where T : GActorPlayerBase
|
| | | public T ReqClntPlayer<T>(GActorPlayerBase.PlayerInfo info, E_ActorGroup group) where T : GActorPlayerBase
|
| | | {
|
| | | uint serverInstID = m_SimulateServerID.Request();
|
| | | byte _actorClassType = GetActorClassType(typeof(T));
|
| | |
|
| | | GA_PlayerClient _actor = GetPoolActor(_actorClassType) as GA_PlayerClient;
|
| | | GActorPlayerBase _actor = null;
|
| | |
|
| | | if ((E_ActorClassType)_actorClassType == E_ActorClassType.PVPClientPlayer)
|
| | | {
|
| | | _actor = GetPoolActor(_actorClassType) as GA_PVPClientPlayer;
|
| | |
|
| | | if (_actor == null)
|
| | | {
|
| | | _actor = new GA_PVPClientPlayer();
|
| | | }
|
| | |
|
| | | if (_actor != null)
|
| | | {
|
| | | (_actor as GA_PVPClientPlayer).Init(serverInstID, m_ClientId.Request(), info, group);
|
| | | BuildManagerRelation(_actor, _actorClassType);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _actor = GetPoolActor(_actorClassType) as GA_PlayerClient;
|
| | |
|
| | | if (_actor == null)
|
| | | {
|
| | |
| | |
|
| | | if (_actor != null)
|
| | | {
|
| | | _actor.Init(serverInstID, m_ClientId.Request(), info, group);
|
| | | (_actor as GA_PlayerClient).Init(serverInstID, m_ClientId.Request(), info, group);
|
| | | BuildManagerRelation(_actor, _actorClassType);
|
| | | }
|
| | | }
|
| | |
|
| | | return _actor as T;
|
| | |
| | | {
|
| | | return (byte)E_ActorClassType.PlayerSgzcRobot;
|
| | | }
|
| | | else if (_type == typeof(GA_PVPClientPlayer))
|
| | | {
|
| | | return (byte)E_ActorClassType.PVPClientPlayer;
|
| | | }
|
| | |
|
| | | return (byte)E_ActorClassType.UnDefine;
|
| | | }
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | using Snxxz.UI; |
| | | |
| | | public class GA_PVPClientPlayer : GActorPlayerBase, IOtherSelectable |
| | | { |
| | | public static UnityEngine.Events.UnityAction<bool> OnPVPResult; |
| | | |
| | | private PlayerInfo info; |
| | | |
| | | private static bool doAILogic = false; |
| | | |
| | | public static void AutoAI(bool startOrStop) |
| | | { |
| | | doAILogic = startOrStop; |
| | | } |
| | | |
| | | public void Init(uint serverInstID, uint clientInstID, PlayerInfo playerInfo, E_ActorGroup group) |
| | | { |
| | | info = playerInfo; |
| | | |
| | | Init(serverInstID, clientInstID, group, null); |
| | | } |
| | | |
| | | public static void Result(bool winOrLose) |
| | | { |
| | | #if UNITY_EDITOR |
| | | Debug.Log(winOrLose ? "============ 赢了" : "============ 输了"); |
| | | RuntimeLogUtility.TEST_CLIENT_PVP_AI = false; |
| | | #endif |
| | | |
| | | if (OnPVPResult != null) |
| | | { |
| | | OnPVPResult(winOrLose); |
| | | } |
| | | } |
| | | |
| | | public static void Reset() |
| | | { |
| | | var _list = GAMgr.Instance.GetTypeList(E_ActorClassType.PVPClientPlayer); |
| | | if (_list != null) |
| | | { |
| | | _list[0].ActorInfo.ResetHp((int)_list[0].ActorInfo.MaxHp); |
| | | _list[0].ActorInfo.serverDie = false; |
| | | _list[0].IdleImmediate(); |
| | | } |
| | | |
| | | PlayerDatas.Instance.FightRefreshPlayerHp((uint)PlayerDatas.Instance.extersion.MaxHP); |
| | | PlayerDatas.Instance.hero.ActorInfo.ResetHp((int)PlayerDatas.Instance.extersion.MaxHP); |
| | | PlayerDatas.Instance.hero.IdleImmediate(); |
| | | } |
| | | |
| | | int[] m_Skills = { 50000, 50100, 50200, 50300, 50400 }; |
| | | |
| | | protected override void OnInit(GameNetPackBasic package) |
| | | { |
| | | base.OnInit(package); |
| | | |
| | | CapsuleCollider _capCollider = Root.AddMissingComponent<CapsuleCollider>(); |
| | | _capCollider.height = 1.2f; |
| | | _capCollider.center = new Vector3(0, .6f, 0); |
| | | _capCollider.radius = .4f; |
| | | |
| | | Evt_PlayerClick _evtClick = Root.AddMissingComponent<Evt_PlayerClick>(); |
| | | _evtClick.ownerSID = ServerInstID; |
| | | |
| | | // 初始化坐标 |
| | | AdjustPos(PlayerDatas.Instance.baseData.PosX, PlayerDatas.Instance.baseData.PosY); |
| | | |
| | | ActorInfo.moveSpeed = 500f / 150; |
| | | ActorInfo.atkSpeed = 1; |
| | | |
| | | JobSetup = JobSetupConfig.Get(info.job); |
| | | CEquipInfo _itemInfo; |
| | | if (info.itemDatas != null) |
| | | { |
| | | // 因为衣服是所有装备的父节点, 需要预先处理衣服 |
| | | for (int i = 0; i < info.itemDatas.Length; ++i) |
| | | { |
| | | _itemInfo = info.itemDatas[i]; |
| | | |
| | | if (_itemInfo.place == (int)RoleEquipType.retClothes) |
| | | { |
| | | SwitchClothes((uint)_itemInfo.id); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果没有任何衣服, 则穿上默认装备 |
| | | if (ClothesItemID == 0 || ClothesItemID == uint.MaxValue) |
| | | { |
| | | SwitchClothes(0); |
| | | } |
| | | |
| | | if (info.itemDatas != null) |
| | | { |
| | | for (int i = 0; i < info.itemDatas.Length; ++i) |
| | | { |
| | | _itemInfo = info.itemDatas[i]; |
| | | |
| | | if (_itemInfo.place == (int)RoleEquipType.retWeapon) |
| | | { |
| | | SwitchWeapon((uint)_itemInfo.id); |
| | | } |
| | | else if (_itemInfo.place == (int)RoleEquipType.retWeapon2) |
| | | { |
| | | SwitchSecondary((uint)_itemInfo.id); |
| | | } |
| | | else if (_itemInfo.place == (int)RoleEquipType.retWing) |
| | | { |
| | | SwitchWing((uint)_itemInfo.id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (WeaponItemID == 0 || WeaponItemID == uint.MaxValue) |
| | | { |
| | | SwitchWeapon(0); |
| | | } |
| | | |
| | | var _funcOpenLv = FuncOpenLVConfig.Get((int)FuncOpenEnum.CrossServer); |
| | | |
| | | int _ranVal = Random.Range(10, 101); |
| | | int _lv = PlayerDatas.Instance.baseData.LV - _ranVal; |
| | | int _limitLv = _funcOpenLv.LimitLV; |
| | | ActorInfo.LV = (ushort)(_lv < _limitLv ? _limitLv : _lv); |
| | | |
| | | ActorInfo.Job = (byte)JobSetup.Job; |
| | | ActorInfo.PlayerName = info.name; |
| | | ActorInfo.MaxHp = info.hp; |
| | | ActorInfo.Hp = info.maxHp; |
| | | |
| | | _ranVal = Random.Range(3, 6); |
| | | int _realm = PlayerDatas.Instance.baseData.realmLevel - _ranVal; |
| | | int _limitRealm = _funcOpenLv.LimiRealmLV; |
| | | ActorInfo.realm = (uint)(_realm < _limitRealm ? _limitRealm : _realm); |
| | | |
| | | RequestName(); |
| | | |
| | | IdleImmediate(); |
| | | } |
| | | |
| | | public override void Destroy() |
| | | { |
| | | } |
| | | |
| | | protected sealed override void OnUpdate() |
| | | { |
| | | if (ActorInfo.serverDie) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | base.OnUpdate(); |
| | | |
| | | UpdateAI(); |
| | | |
| | | if (ActorInfo.RealHp <= 0) |
| | | { |
| | | ActorInfo.serverDie = true; |
| | | Result(true); |
| | | } |
| | | } |
| | | |
| | | protected sealed override void OnUnit() |
| | | { |
| | | base.OnUnit(); |
| | | } |
| | | |
| | | public sealed override void OnHorse(byte upOrDown) { } |
| | | |
| | | public sealed override void RefreshLifeBar(ulong value) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null && _hero.SelectTarget == this) |
| | | { |
| | | if (GA_Player.s_OnRefreshLife != null) |
| | | { |
| | | GA_Player.s_OnRefreshLife(ServerInstID, ActorInfo.RealHp, ActorInfo.RealMaxHp); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public sealed override void RequestName() |
| | | { |
| | | ReleaseName(); |
| | | if (MovingState == E_MovingState.Ride) |
| | | { |
| | | m_HeadUpName = HeadUpName.RequireHeadUpName(HeadUpName.Pattern.Player, MP_Name1, 0, CameraController.Instance.CameraObject); |
| | | } |
| | | else |
| | | { |
| | | m_HeadUpName = HeadUpName.RequireHeadUpName(HeadUpName.Pattern.Player, MP_Name, 0, CameraController.Instance.CameraObject); |
| | | } |
| | | |
| | | m_HeadUpName.SetPlayerInfo((int)ActorInfo.realm, ActorInfo.titleID, ActorInfo.PlayerName, ActorInfo.familyName, false); |
| | | } |
| | | |
| | | protected sealed override void OnPutonClothes(uint clothesItemID, GameObject clothed) |
| | | { |
| | | clothed.layer = LayerUtility.Player; |
| | | |
| | | SkinnedMeshRenderer _renderer = clothed.GetComponentInChildren<SkinnedMeshRenderer>(); |
| | | _renderer.gameObject.SetLayer(LayerUtility.Player, false); |
| | | } |
| | | |
| | | protected sealed override void OnPutonSecondary(uint secondaryItemID, GameObject secondary) |
| | | { |
| | | Renderer _renderer = secondary.GetComponentInChildren<Renderer>(); |
| | | _renderer.gameObject.SetLayer(LayerUtility.Player, false); |
| | | } |
| | | |
| | | protected sealed override void OnPutonWeapon(uint weaponItemID, GameObject weapon) |
| | | { |
| | | Renderer _renderer = weapon.GetComponentInChildren<Renderer>(); |
| | | _renderer.gameObject.SetLayer(LayerUtility.Player, false); |
| | | } |
| | | |
| | | protected sealed override void OnPutonWing(uint wingItemID, GameObject wing) |
| | | { |
| | | SkinnedMeshRenderer _renderer = wing.GetComponentInChildren<SkinnedMeshRenderer>(); |
| | | _renderer.gameObject.SetLayer(LayerUtility.Player, false); |
| | | } |
| | | |
| | | protected sealed override void OnSwitchHorse(uint horseID, GameObject horse) |
| | | { |
| | | } |
| | | |
| | | public sealed override bool CanAtked() { return !ActorInfo.serverDie; } |
| | | |
| | | public bool CanBeSelected() |
| | | { |
| | | if (ActorInfo.serverDie) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public void OnClick() |
| | | { |
| | | if (ActorInfo.serverDie) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | _hero.LockTarget = this; |
| | | _hero.SelectTarget = this; |
| | | } |
| | | |
| | | public void OnSelect() |
| | | { |
| | | if (CanAtked()) |
| | | { |
| | | SelectionManager.Request(SelectionManager.E_Type.Red, this); |
| | | } |
| | | else |
| | | { |
| | | SelectionManager.Request(SelectionManager.E_Type.Green, this); |
| | | } |
| | | |
| | | if (GA_Player.s_OnSelected != null) |
| | | { |
| | | GA_Player.s_OnSelected(ServerInstID, true); |
| | | } |
| | | } |
| | | |
| | | public void OnUnSelect() |
| | | { |
| | | SelectionManager.Release(SelectionManager.E_Type.Green); |
| | | SelectionManager.Release(SelectionManager.E_Type.Red); |
| | | |
| | | if (GA_Player.s_OnSelected != null) |
| | | { |
| | | GA_Player.s_OnSelected(ServerInstID, false); |
| | | } |
| | | } |
| | | |
| | | public sealed override void SyncSuitEffect() { } |
| | | |
| | | private float m_LastAttackTime; |
| | | private int m_ComAtkIndex; |
| | | |
| | | DungeonModel m_DungeonModel; |
| | | DungeonModel dungeonModel |
| | | { |
| | | get |
| | | { |
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | | |
| | | private void UpdateAI() |
| | | { |
| | | if (dungeonModel.dungeonFightStage != DungeonFightStage.Normal |
| | | || !doAILogic) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | SelectTarget = PlayerDatas.Instance.hero; |
| | | |
| | | if (SelectTarget == null || SelectTarget.ActorInfo.serverDie) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | // 攻击间隔中 |
| | | if (Time.time - m_LastAttackTime |
| | | < (1f / ActorInfo.atkSpeed) * .8f) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Skill _skill = SkillMgr.CurCastSkill; |
| | | |
| | | // 判断主角当前是否有技能尚未释放完毕 |
| | | if (_skill != null) |
| | | { |
| | | if (!_skill.SkillCompelete) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (SkillMgr.DoingPrepareSkill) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < m_Skills.Length; ++i) |
| | | { |
| | | _skill = SkillMgr.Get(m_Skills[i]); |
| | | if (_skill.IsValid()) |
| | | { |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | _skill = null; |
| | | } |
| | | } |
| | | |
| | | if (_skill == null) |
| | | { |
| | | if (m_ComAtkIndex > JobSetup.ComAtkIdList.Length - 1) |
| | | { |
| | | m_ComAtkIndex = 0; |
| | | } |
| | | int _comSkillId = JobSetup.ComAtkIdList[m_ComAtkIndex]; |
| | | _skill = SkillMgr.Get(_comSkillId); |
| | | m_ComAtkIndex += 1; |
| | | } |
| | | |
| | | // 判断技能范围, 不在可释放范围需要移动至目标 |
| | | float _compareDist = _skill.skillInfo.config.AtkDist * .5f; |
| | | float _compareDistSqrt = _compareDist * _compareDist; |
| | | |
| | | // 计算当前和目标的距离 |
| | | float _currentDistSqrt = MathUtility.DistanceSqrtXZ(Pos, SelectTarget.Pos); |
| | | // 比较距离 |
| | | if (_currentDistSqrt >= _compareDistSqrt) |
| | | { |
| | | // 移动至目标 |
| | | MoveToTarget(SelectTarget, _compareDist, true); |
| | | |
| | | return; |
| | | } |
| | | |
| | | Vector3 _forward = MathUtility.ForwardXZ(SelectTarget.Pos, Pos); |
| | | destForward = Forward = _forward; |
| | | |
| | | Vector3 _targetPosition = Pos + Forward * (_skill.skillInfo.config.AtkDist * .5f); |
| | | _targetPosition.y = 0; |
| | | UnityEngine.AI.NavMeshHit _navMeshHit; |
| | | if (UnityEngine.AI.NavMesh.Raycast(Pos, _targetPosition, out _navMeshHit, -1)) |
| | | { |
| | | _targetPosition = _navMeshHit.position; |
| | | } |
| | | _targetPosition.y = Pos.y; |
| | | _skill.targetPosition = _targetPosition; |
| | | |
| | | E_SkillCastType _castType = (E_SkillCastType)(_skill.skillInfo.config.Tag % 10); |
| | | if (_castType == E_SkillCastType.NeedTarget) |
| | | { |
| | | _skill.targetPosition = SelectTarget.Pos; |
| | | _skill.mainTarget = SelectTarget as GActorFight; |
| | | } |
| | | |
| | | SkillMgr.CastSkill(ServerInstID, _skill.id); |
| | | |
| | | if (_skill.skillInfo.config.Skillactmark > 0 |
| | | && _skill.skillInfo.config.Skillactmark < 20) |
| | | { |
| | | switch (_skill.skillInfo.config.Skillactmark) |
| | | { |
| | | case 10: |
| | | Play(GAStaticDefine.State_Attack1Hash, 0); |
| | | break; |
| | | case 11: |
| | | Play(GAStaticDefine.State_Attack2Hash, 0); |
| | | break; |
| | | case 12: |
| | | Play(GAStaticDefine.State_Attack3Hash, 0); |
| | | break; |
| | | case 13: |
| | | Play(GAStaticDefine.State_Attack4Hash, 0); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | switch (_skill.skillInfo.config.Skillactmark) |
| | | { |
| | | case 21: |
| | | Play(GAStaticDefine.State_Skill21, 0); |
| | | break; |
| | | case 22: |
| | | Play(GAStaticDefine.State_Skill22, 0); |
| | | break; |
| | | case 23: |
| | | Play(GAStaticDefine.State_Skill23, 0); |
| | | break; |
| | | case 24: |
| | | Play(GAStaticDefine.State_Skill24, 0); |
| | | break; |
| | | case 25: |
| | | Play(GAStaticDefine.State_Skill25, 0); |
| | | break; |
| | | case 26: |
| | | Play(GAStaticDefine.State_Skill26, 0); |
| | | break; |
| | | case 27: |
| | | Play(GAStaticDefine.State_Skill27, 0); |
| | | break; |
| | | case 28: |
| | | Play(GAStaticDefine.State_Skill28, 0); |
| | | break; |
| | | case 29: |
| | | Play(GAStaticDefine.State_Skill29, 0); |
| | | break; |
| | | case 99: |
| | | Play(GAStaticDefine.State_RollHash, 0); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | uint hurtValue = 0; |
| | | byte attackType = 0; |
| | | |
| | | AttackHandler.CalculateDamage(this, SelectTarget as GActorFight, |
| | | _skill, |
| | | 0, |
| | | ref hurtValue, ref attackType); |
| | | |
| | | AttackHandler.HurtObjs _hurtObject = new AttackHandler.HurtObjs |
| | | { |
| | | AttackType = attackType, |
| | | clientInstID = SelectTarget.ClientInstID, |
| | | CurHP = SelectTarget.ActorInfo.Hp, |
| | | CurHPEx = SelectTarget.ActorInfo.HpEx, |
| | | HurtHP = hurtValue, |
| | | ObjID = SelectTarget.ServerInstID, |
| | | ObjType = (byte)SelectTarget.ActorType |
| | | }; |
| | | |
| | | _skill.hurtClientList.Add(_hurtObject); |
| | | |
| | | m_LastAttackTime = Time.time; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fe1900c33f2012242b329b6274817cde |
| | | timeCreated: 1549970812 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | public class GA_PlayerClient : GActorPlayerBase
|
| | | {
|
| | | public struct CEquipInfo
|
| | | {
|
| | | public int id;
|
| | | public int place;
|
| | | public int isSuit;
|
| | | public int suitLevel;
|
| | | }
|
| | |
|
| | | public class PlayerInfo
|
| | | {
|
| | | public Vector3 pos;
|
| | | public byte job;
|
| | | public uint playerID;
|
| | | public string FamilyName;
|
| | | public uint FamilyID;
|
| | | public string name;
|
| | | public ushort level;
|
| | | public uint hp;
|
| | | public uint maxHp;
|
| | | public CEquipInfo[] itemDatas;
|
| | | }
|
| | |
|
| | | private PlayerInfo m_PlayerInfo;
|
| | | private float m_LastUseSkillTime;
|
| | | private int nextConAtkIndex;
|
| | |
| | | } |
| | | else |
| | | { |
| | | if (!ClientDungeonStageUtility.isClientDungeon |
| | | #if UNITY_EDITOR |
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP |
| | | #endif |
| | | ) |
| | | { |
| | | Hp = SyncServerHp; |
| | | } |
| | | else |
| | | { |
| | | Hp = 0; |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | // } |
| | | // } |
| | | |
| | | // 如果处于客户端战斗则不进行血量矫正了 |
| | | if (!ClientDungeonStageUtility.isClientDungeon |
| | | #if UNITY_EDITOR |
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP |
| | | #endif |
| | | ) |
| | | { |
| | | if (HpEx * FullHp + Hp < SyncServerHpEx * FullHp + SyncServerHp) |
| | | { |
| | | Hp = SyncServerHp; |
| | | HpEx = SyncServerHpEx; |
| | | } |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // if (HpEx != SyncServerHpEx) |
| | | // { |
| | | // Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx); |
| | | // } |
| | | // } |
| | | if (sid == PlayerDatas.Instance.PlayerId) |
| | | { |
| | | if (Hp == 0) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // if (HpEx != SyncServerHpEx) |
| | | // { |
| | | // Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx); |
| | | // } |
| | | // } |
| | | |
| | | if (OnHpChange != null) |
| | | { |
| | |
| | |
|
| | | public abstract class GActorPlayerBase : GActorFight
|
| | | {
|
| | | public class PlayerInfo
|
| | | {
|
| | | public Vector3 pos;
|
| | | public byte job;
|
| | | public uint playerID;
|
| | | public string FamilyName;
|
| | | public uint FamilyID;
|
| | | public string name;
|
| | | public ushort level;
|
| | | public uint hp;
|
| | | public uint maxHp;
|
| | | public CEquipInfo[] itemDatas;
|
| | | }
|
| | |
|
| | | public struct CEquipInfo
|
| | | {
|
| | | public int id;
|
| | | public int place;
|
| | | public int isSuit;
|
| | | public int suitLevel;
|
| | | }
|
| | |
|
| | | private GameObject m_EmptyJY;
|
| | | public static UnityAction<bool> onShowEffect;
|
| | | private bool m_LoadDefaultHorse;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class ClientDungeonStageUtility |
| | | { |
| | | |
| | | public static bool isClientDungeon { get; private set; } |
| | | public static ushort clientMapId { get; private set; } |
| | | |
| | | public static void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += Reset; |
| | | } |
| | | |
| | | public static void SetClientDungeon(bool value, ushort mapId) |
| | | { |
| | | isClientDungeon = value; |
| | | clientMapId = mapId; |
| | | } |
| | | |
| | | private static void Reset() |
| | | { |
| | | isClientDungeon = false; |
| | | clientMapId = 0; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 00fc9d81b67abac47852c54aa4561009 |
| | | timeCreated: 1550225074 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System;
|
| | | using Snxxz.UI;
|
| | | using LitJson;
|
| | | using System.Collections;
|
| | |
|
| | | public class DropItemManager
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | JsonData _userData = JsonMapper.ToObject(h0701.UserData);
|
| | |
|
| | | if (DungeonStage.CurrentMapType != MapType.OpenCountry
|
| | | && (_userData as IDictionary).Contains("4")
|
| | | && CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | string _info = StringUtility.Contact(h0701.DropID, "|",
|
| | | h0701.ItemTypeID, "|",
|
| | | h0701.OwnerType, "|",
|
| | | h0701.OwnerID);
|
| | | #if UNITY_EDITOR
|
| | | Debug.Log(_info);
|
| | | #endif
|
| | | ExceptionCatcher.ReportException("收到服务端掉落封包", _info);
|
| | | }
|
| | |
|
| | | if (((System.Collections.IDictionary)_userData).Contains("5"))
|
| | | {
|
| | |
| | | remainTime = h0701.RemainTime * Constants.F_GAMMA
|
| | | };
|
| | |
|
| | | if (DungeonStage.CurrentMapType != MapType.OpenCountry
|
| | | && (_userData as IDictionary).Contains("4")
|
| | | && CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | string _info = StringUtility.Contact(h0701.DropID, "|",
|
| | | h0701.ItemTypeID, "|",
|
| | | h0701.OwnerType, "|",
|
| | | h0701.OwnerID, "|",
|
| | | _dropPosition);
|
| | | #if UNITY_EDITOR
|
| | | Debug.Log(_info);
|
| | | #endif
|
| | | ExceptionCatcher.ReportException("创建客户端掉落对象", _info);
|
| | | }
|
| | |
|
| | | if (h0701.UserDataLen > 2)
|
| | | {
|
| | | _dropObject.userData = _userData;
|
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.SceneManagement; |
| | | using UnityEngine; |
| | | using Snxxz.UI; |
| | | using Snxxz.UI; |
| | | using System; |
| | | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.Events; |
| | | |
| | | public class StageLoad : SingletonMonobehaviour<StageLoad> |
| | |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using UnityEngine.SceneManagement; |
| | | using Snxxz.UI; |
| | | |
| | | using System; |
| | | |
| | | public class StageLoadProcessor : MonoBehaviour |
| | | { |
| | |
| | | case 3: |
| | | stage = stageGameObject.AddComponent<SelectRoleStage>(); |
| | | break; |
| | | case ClientCrossServerOneVsOne.mapId: |
| | | stage = stageGameObject.AddComponent<ClientCrossServerOneVsOneStage>(); |
| | | break; |
| | | case 31250: |
| | | stage = stageGameObject.AddComponent<GuardDungeonStage>(); |
| | | break; |
| | |
| | | |
| | | stage.mapId = mapId; |
| | | StageLoad.Instance.currentStage = stage; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | public static bool IsCrossServerOneVsOne() |
| | | { |
| | | if (ClientCrossServerOneVsOne.isClientCrossServerOneVsOne) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>(); |
| | | var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID); |
| | | return PlayerDatas.Instance.baseData.CrossServerFlag > 2 |
| | |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_Ensure.SetListener(() => { CrossServerLogin.Instance.CrossServerOneVsOneLogin(); }); |
| | | m_Ensure.SetListener(() => |
| | | { |
| | | if (CrossServerLogin.Instance.oneVsOnePlayerData.isClient) |
| | | { |
| | | ClientCrossServerOneVsOne.StartClientCrossServerOneVsOne(); |
| | | } |
| | | else |
| | | { |
| | | CrossServerLogin.Instance.CrossServerOneVsOneLogin(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | private bool _isMatching;
|
| | | public bool IsMatching {
|
| | | get { return _isMatching; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | _isMatching = value;
|
| | | if(UpdateMatchStateEvent != null)
|
| | | {
|
| | |
| | |
|
| | | private void UpdateFBHelp()
|
| | | {
|
| | | if (!CrossServerUtility.IsCrossServer()) return;
|
| | | if (!CrossServerUtility.IsCrossServerOneVsOne())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | var mission = dungeonModel.mission;
|
| | |
| | | UpdatePkResultEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | Clock clientMatchClock;
|
| | | PlayerBuffDatas buffDatas { get { return ModelCenter.Instance.GetModel<PlayerBuffDatas>(); } }
|
| | | /// <summary>
|
| | | ///0-取消匹配; 1-进行匹配
|
| | |
| | | {
|
| | | if (type == 1 && TryGetMatchTip()) return;
|
| | |
|
| | | CC101_tagCMCrossRealmPKMatch match = new CC101_tagCMCrossRealmPKMatch();
|
| | | if (type == 1)
|
| | | {
|
| | | var danLevel = CrossServerOneVsOnePlayerInfo.Instance.DanLV;
|
| | | if (ClientCrossServerOneVsOne.TryClientCrossServerOneVsOne(danLevel))
|
| | | {
|
| | | var onMatchPackage = new HC002_tagGCCrossRealmPKStartMatch();
|
| | | GameNetSystem.Instance.PushPackage(onMatchPackage, ServerType.Main);
|
| | | 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)
|
| | | {
|
| | | ClientCrossServerOneVsOne.FakeMatchOk();
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | var match = new CC101_tagCMCrossRealmPKMatch();
|
| | | match.Type = (byte)type;
|
| | | GameNetSystem.Instance.SendInfo(match);
|
| | | CrossServerOneVsOneRewardModel.PkType = buffDatas.PkType;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (clientMatchClock != null && !clientMatchClock.stopped)
|
| | | {
|
| | | clientMatchClock.Stop();
|
| | | IsMatching = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | var match = new CC101_tagCMCrossRealmPKMatch();
|
| | | match.Type = (byte)type;
|
| | | GameNetSystem.Instance.SendInfo(match);
|
| | | CrossServerOneVsOneRewardModel.PkType = buffDatas.PkType;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendBuyMatchCount()
|
| | | {
|
| | |
| | |
|
| | | public void UpdatePkResult(HC003_tagGCCrossRealmPKOverInfo pKOverInfo)
|
| | | {
|
| | | this.AddScore = pKOverInfo.AddScore;
|
| | | this.CurScore = (int)pKOverInfo.Score;
|
| | | this.DanLV = pKOverInfo.DanLV;
|
| | | this.WinStreak = pKOverInfo.CWinCnt;
|
| | |
|
| | | if (ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
|
| | | {
|
| | | this.PkEndTime = ClientCrossServerOneVsOne.resultSupplement.endTime.ToString();
|
| | | this.OverType = ClientCrossServerOneVsOne.resultSupplement.overType;
|
| | | this.WinnerID = ClientCrossServerOneVsOne.resultSupplement.winPlayerId;
|
| | | this.RoundCount = ClientCrossServerOneVsOne.resultSupplement.roundCount;
|
| | | this.RoundWinnerIDs = ClientCrossServerOneVsOne.resultSupplement.roundWinnerId;
|
| | | this.VsPlayerName = ClientCrossServerOneVsOne.resultSupplement.opponentName;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.PkEndTime = pKOverInfo.TimeStr;
|
| | | this.OverType = pKOverInfo.OverType;
|
| | | this.WinnerID = (int)pKOverInfo.WinnerID;
|
| | | this.RoundCount = pKOverInfo.RoundCount;
|
| | | this.RoundWinnerIDs = pKOverInfo.RoundWinnerID;
|
| | | this.AddScore = pKOverInfo.AddScore;
|
| | | this.CurScore = (int)pKOverInfo.Score;
|
| | | this.DanLV = pKOverInfo.DanLV;
|
| | | this.WinStreak = pKOverInfo.CWinCnt;
|
| | | this.VsPlayerName = pKOverInfo.TagName;
|
| | | }
|
| | | }
|
| | |
|
| | | public void GetWinAndFailNum(out int winNum, out int failNum)
|
| | | {
|
| | |
| | |
|
| | | private void UpdatePkResultEvent()
|
| | | {
|
| | | if (CrossServerUtility.IsCrossServer())//副本结算界面
|
| | | if (CrossServerUtility.IsCrossServerOneVsOne() )//副本结算界面
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<CrossServerOneVsOneRoundWin>())
|
| | | {
|
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | [XLua.Hotfix] |
| | | public class CrossServerSettlementWin : Window |
| | |
| | | #endregion |
| | | private void ExitDungeon()
|
| | | {
|
| | | if (ClientCrossServerOneVsOne.isClientCrossServerOneVsOne) |
| | | { |
| | | ClientCrossServerOneVsOne.StopClientCrossServerOneVsOne(); |
| | | }
|
| | | else
|
| | | {
|
| | | CrossServerOneVsOneRewardModel.ExitCrossRealm();
|
| | | }
|
| | |
|
| | | CloseClick();
|
| | | } |
| | | |
| | |
| | | [SerializeField] Text m_ScoreText2;
|
| | | [SerializeField] Text m_CountdownText;
|
| | |
|
| | |
|
| | | public float UpperAndLower = 17f;
|
| | | public float ItemHeight = 135f;
|
| | | public float MaxHeight = 422f;
|
| | |
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | dungeonEndTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.TowerTake);
|
| | | dungeonEndTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.FightStart);
|
| | | PlaceOfBirth(positionType);//从出生位置设置信息
|
| | | Viewport1.gameObject.SetActive(false); |
| | | Viewport2.gameObject.SetActive(false);
|
| | |
| | | } |
| | | private void DungeonCoolDownEvent(DungeonCoolDownType type)
|
| | | {
|
| | | if (type == DungeonCoolDownType.TowerTake)
|
| | | if (type == DungeonCoolDownType.FightStart)
|
| | | {
|
| | | dungeonEndTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.TowerTake);
|
| | | dungeonEndTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.FightStart);
|
| | | }
|
| | | } |
| | | private void Updatefighting(PlayerDataRefresh _tCDBPlayerRefresh)
|
| | |
| | | {
|
| | | if (type == 1)
|
| | | {
|
| | | string PlayerName = UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName);
|
| | | string PlayerName = UIHelper.ServerStringTrim(CrossServerLogin.Instance.oneVsOnePlayerData.myName);
|
| | | m_RoleInformation1.SetHeroLvAndName((int)PlayerDatas.Instance.baseData.LV, PlayerName);
|
| | | m_RoleInformation1.SetHeroHP(PlayerDatas.Instance.extersion.MaxHP, (int)PlayerDatas.Instance.baseData.HP);
|
| | | m_RoleInformation1.SetShieldNumber(PlayerDatas.Instance.extersion.MaxProDef, (int)PlayerDatas.Instance.baseData.ExAttr4);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | string PlayerName = UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName);
|
| | | string PlayerName = UIHelper.ServerStringTrim(CrossServerLogin.Instance.oneVsOnePlayerData.myName);
|
| | | m_RoleInformation2.SetHeroLvAndName((int)PlayerDatas.Instance.baseData.LV, PlayerName);
|
| | | m_RoleInformation2.SetHeroHP(PlayerDatas.Instance.extersion.MaxHP, (int)PlayerDatas.Instance.baseData.HP);
|
| | | m_RoleInformation2.SetShieldNumber(PlayerDatas.Instance.extersion.MaxProDef, (int)PlayerDatas.Instance.baseData.ExAttr4);
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 597038447790b3d4396dfba7654513ef |
| | | folderAsset: yes |
| | | timeCreated: 1549965092 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Text.RegularExpressions; |
| | | using LitJson; |
| | | using System.Text; |
| | | |
| | | public class ClientCrossServerOneVsOne |
| | | { |
| | | public const int mapId = 1000; |
| | | public const uint OPPONENT_PLAYERID = 999999; |
| | | |
| | | public static bool isClientCrossServerOneVsOne { get; private set; } |
| | | public static FightResultSupplement resultSupplement; |
| | | public static int myPlace { get; private set; } //我的位置,1-左;2-右 |
| | | public static string opponentName { get; private set; } |
| | | |
| | | static FightObstacle[] m_Obstacles; |
| | | public static FightObstacle[] obstacles { |
| | | get { |
| | | if (m_Obstacles == null) |
| | | { |
| | | var configString = FuncConfigConfig.Get("CrossRealmPKFB").Numerical2; |
| | | var matches = Regex.Matches(configString, "\\[[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\\]"); |
| | | m_Obstacles = new FightObstacle[matches.Count]; |
| | | for (var i = 0; i < matches.Count; i++) |
| | | { |
| | | var subMatches = Regex.Matches(matches[i].Value, "[0-9]{1,3}"); |
| | | m_Obstacles[i] = new FightObstacle() |
| | | { |
| | | aPosX = subMatches.Count > 0 ? int.Parse(subMatches[0].Value) : 0, |
| | | aPosY = subMatches.Count > 1 ? int.Parse(subMatches[1].Value) : 0, |
| | | bPosX = subMatches.Count > 2 ? int.Parse(subMatches[2].Value) : 0, |
| | | bPosY = subMatches.Count > 3 ? int.Parse(subMatches[3].Value) : 0, |
| | | angle = subMatches.Count > 4 ? int.Parse(subMatches[4].Value) : 0, |
| | | }; |
| | | } |
| | | } |
| | | |
| | | return m_Obstacles; |
| | | } |
| | | } |
| | | |
| | | public static bool TryClientCrossServerOneVsOne(int myClass) |
| | | { |
| | | var config = CrossServerArenaConfig.Get(myClass); |
| | | if (config == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (config.robotProbability <= 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | var random = UnityEngine.Random.Range(0, 100); |
| | | return random < config.robotProbability; |
| | | } |
| | | |
| | | public static string GetRandomOpponentName(int job) |
| | | { |
| | | var serverName = string.Empty; |
| | | while (string.IsNullOrEmpty(serverName)) |
| | | { |
| | | try |
| | | { |
| | | var groupRandom = UnityEngine.Random.Range(0, ServerListCenter.Instance.serverInfoCommon.common.Length); |
| | | var serverRandom = UnityEngine.Random.Range(0, ServerListCenter.Instance.serverInfoCommon.common[groupRandom].group_list.Length); |
| | | var serverData = ServerListCenter.Instance.serverInfoCommon.common[groupRandom].group_list[serverRandom]; |
| | | |
| | | if (serverData.running_status == (int)ServerState.Normal |
| | | || serverData.running_status == (int)ServerState.Busy |
| | | || serverData.running_status == (int)ServerState.Hot) |
| | | { |
| | | serverName = serverData.name; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | var playerName = StringUtility.Contact(RandomNameConfig.GetFirstName(job), RandomNameConfig.GetSecondName(job)); |
| | | |
| | | return string.Concat("[", serverName, "]", playerName); |
| | | } |
| | | |
| | | public static GA_PlayerClient.PlayerInfo GetRandomOpponentPlayerInfo(int scoreClass, int job, string playerName, int level, int maxHp) |
| | | { |
| | | var config = CrossServerOneVsOneRobotConfig.GetRandomRobotConfig(scoreClass); |
| | | var jsonData = JsonMapper.ToObject(config.equips); |
| | | var equipItems = new List<int>(); |
| | | if (jsonData.Keys.Contains(job.ToString())) |
| | | { |
| | | var equipJson = jsonData[job.ToString()]; |
| | | for (var i = 0; i < equipJson.Count; i++) |
| | | { |
| | | equipItems.Add((int)equipJson[i]); |
| | | } |
| | | } |
| | | |
| | | var equipInfos = new GA_PlayerClient.CEquipInfo[equipItems.Count]; |
| | | for (int i = 0; i < equipInfos.Length; i++) |
| | | { |
| | | var equipInfo = new GA_PlayerClient.CEquipInfo(); |
| | | var itemConfig = ItemConfig.Get(equipItems[i]); |
| | | equipInfo.id = itemConfig.ID; |
| | | equipInfo.place = itemConfig.EquipPlace; |
| | | equipInfo.suitLevel = 0; |
| | | equipInfo.isSuit = 0; |
| | | equipInfos[i] = equipInfo; |
| | | } |
| | | |
| | | var playerInfo = new GA_PlayerClient.PlayerInfo() |
| | | { |
| | | maxHp = (uint)maxHp, |
| | | hp = (uint)maxHp, |
| | | level = (ushort)level, |
| | | job = (byte)job, |
| | | pos = Vector3.zero, |
| | | name = playerName, |
| | | itemDatas = equipInfos, |
| | | }; |
| | | |
| | | return playerInfo; |
| | | } |
| | | |
| | | public static void FakeMatchOk() |
| | | { |
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>(); |
| | | if (teamModel.isMatching) |
| | | { |
| | | teamModel.RequestCancelAutoMatchTeam(); |
| | | } |
| | | |
| | | var package = new HC001_tagGCCrossRealmPKMatchOK(); |
| | | package.RoomID = 1000; |
| | | var serverName = ServerListCenter.Instance.currentServer.name; |
| | | var playerName = PlayerDatas.Instance.baseData.PlayerName; |
| | | package.PlayerName = StringUtility.Contact("[", serverName, "]", playerName); |
| | | package.Number = (byte)UnityEngine.Random.Range(1, 3); |
| | | |
| | | var opponent = new HC001_tagGCCrossRealmPKMatchOK.tagGCCrossRealmPKMatchPlayer(); |
| | | opponent.Job = (byte)UnityEngine.Random.Range(1, 3); |
| | | opponent.PlayerName = GetRandomOpponentName(opponent.Job); |
| | | opponent.PlayerID = OPPONENT_PLAYERID; |
| | | |
| | | var exceptedLevel = PlayerDatas.Instance.baseData.LV - UnityEngine.Random.Range(1, 5); |
| | | opponent.LV = (ushort)(Mathf.Clamp(exceptedLevel, FuncOpenLVConfig.Get(157).LimitLV, 999)); |
| | | opponent.MaxProDef = 0; |
| | | opponent.MaxHP = (uint)(PlayerDatas.Instance.extersion.MaxHP * UnityEngine.Random.Range(0.7f, 0.95f)); |
| | | package.MatchPlayer = new HC001_tagGCCrossRealmPKMatchOK.tagGCCrossRealmPKMatchPlayer[] { opponent }; |
| | | |
| | | myPlace = package.Number; |
| | | opponentName = opponent.PlayerName; |
| | | CrossServerLogin.Instance.UpdateCrossServerOneVsOneData(package, true); |
| | | WindowCenter.Instance.Open<CrossServerOneVsOneEnterConfirmWin>(); |
| | | ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>().IsMatching = false; |
| | | } |
| | | |
| | | public static void StartClientCrossServerOneVsOne() |
| | | { |
| | | isClientCrossServerOneVsOne = true; |
| | | LoadingWin.isCrossServerOneVsOne = true; |
| | | WindowCenter.Instance.Open<LoadingWin>(); |
| | | ClientDungeonStageUtility.SetClientDungeon(true, mapId); |
| | | var sendInfo = new CA231_tagCMClientStartCustomScene(); |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | CrossServerLogin.Instance.SetWaitForLoginCrossServerState(false); |
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand() |
| | | { |
| | | toMapId = mapId, |
| | | toLineId = 0, |
| | | needEmpty = true, |
| | | needLoadResource = true, |
| | | serverType = ServerType.Main, |
| | | isClientLoadMap = true |
| | | }); |
| | | |
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID; |
| | | PlayerDatas.Instance.baseData.MapID = mapId; |
| | | var attackMode = new C030A_tagCChangeAttackMode(); |
| | | attackMode.Mode = (byte)E_AttackMode.Family; |
| | | GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main); |
| | | } |
| | | |
| | | public static void FakeWaitFight( int waitSeconds) |
| | | { |
| | | var fakeBarrier = new HA713_tagMCDynamicBarrierState(); |
| | | fakeBarrier.State = 1; |
| | | fakeBarrier.BarrierList = new HA713_tagMCDynamicBarrierState.tagMCDynamicBarrier[obstacles.Length]; |
| | | fakeBarrier.Count = (byte)obstacles.Length; |
| | | |
| | | for (var i = 0; i < fakeBarrier.BarrierList.Length; i++) |
| | | { |
| | | var obstacle = obstacles[i]; |
| | | fakeBarrier.BarrierList[i] = new HA713_tagMCDynamicBarrierState.tagMCDynamicBarrier() |
| | | { |
| | | APosX = (ushort)obstacle.aPosX, |
| | | APosY = (ushort)obstacle.aPosY, |
| | | BPosX = (ushort)obstacle.bPosX, |
| | | BPosY = (ushort)obstacle.bPosY, |
| | | Angle = (ushort)obstacle.angle, |
| | | }; |
| | | } |
| | | |
| | | GameNetSystem.Instance.PushPackage(fakeBarrier, ServerType.Main); |
| | | |
| | | var timeTick = new H0431_tagTimeTick(); |
| | | timeTick.Type = (int)DungeonCoolDownType.WaitStart; |
| | | timeTick.Tick = (uint)waitSeconds * 1000; |
| | | GameNetSystem.Instance.PushPackage(timeTick, ServerType.Main); |
| | | } |
| | | |
| | | public static void FakeFightBegin() |
| | | { |
| | | var fakeBarrier = new HA713_tagMCDynamicBarrierState(); |
| | | fakeBarrier.State = 0; |
| | | fakeBarrier.BarrierList = new HA713_tagMCDynamicBarrierState.tagMCDynamicBarrier[obstacles.Length]; |
| | | fakeBarrier.Count = (byte)obstacles.Length; |
| | | |
| | | for (var i = 0; i < fakeBarrier.BarrierList.Length; i++) |
| | | { |
| | | var obstacle = obstacles[i]; |
| | | fakeBarrier.BarrierList[i] = new HA713_tagMCDynamicBarrierState.tagMCDynamicBarrier() |
| | | { |
| | | APosX = (ushort)obstacle.aPosX, |
| | | APosY = (ushort)obstacle.aPosY, |
| | | BPosX = (ushort)obstacle.bPosX, |
| | | BPosY = (ushort)obstacle.bPosY, |
| | | Angle = (ushort)obstacle.angle, |
| | | }; |
| | | } |
| | | |
| | | GameNetSystem.Instance.PushPackage(fakeBarrier, ServerType.Main); |
| | | } |
| | | |
| | | public static void FakeRoundBegin(int round, uint[] winnerIds) |
| | | { |
| | | var waitStartTimeTick = new H0431_tagTimeTick(); |
| | | waitStartTimeTick.Type = (int)DungeonCoolDownType.FightStart; |
| | | waitStartTimeTick.Tick = 60 * 1000; |
| | | GameNetSystem.Instance.PushPackage(waitStartTimeTick, ServerType.Main); |
| | | |
| | | var roundWinnerIds = new int[winnerIds.Length]; |
| | | for (var i = 0; i < roundWinnerIds.Length; i++) |
| | | { |
| | | roundWinnerIds[i] = (int)winnerIds[i]; |
| | | } |
| | | var missionData = new DungeonMissionData() |
| | | { |
| | | roundNum = round, |
| | | roundWinerIDList = roundWinnerIds, |
| | | isStart = 1, |
| | | }; |
| | | |
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>(); |
| | | dungeonModel.UpdateFakeDungeonMission(mapId, missionData); |
| | | } |
| | | |
| | | public static void FakeRoundEnd(bool isOver, int round, uint[] winnerIds) |
| | | { |
| | | var roundWinnerIds = new int[winnerIds.Length]; |
| | | for (var i = 0; i < roundWinnerIds.Length; i++) |
| | | { |
| | | roundWinnerIds[i] = (int)winnerIds[i]; |
| | | } |
| | | var missionData = new DungeonMissionData() |
| | | { |
| | | roundNum = round, |
| | | roundWinerIDList = roundWinnerIds, |
| | | prepareTime = isOver ? 0 : 3000, |
| | | isStart = 0, |
| | | }; |
| | | |
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>(); |
| | | dungeonModel.UpdateFakeDungeonMission(mapId, missionData); |
| | | } |
| | | |
| | | public static void FakeDungeonExit(int seconds) |
| | | { |
| | | var exitDungeon = new H0431_tagTimeTick(); |
| | | exitDungeon.Type = (int)DungeonCoolDownType.LeaveMap; |
| | | exitDungeon.Tick = (uint)seconds * 1000; |
| | | GameNetSystem.Instance.PushPackage(exitDungeon, ServerType.Main); |
| | | } |
| | | |
| | | public static void ReportDungeonResult(FightResultSupplement resultSupplement) |
| | | { |
| | | ClientCrossServerOneVsOne.resultSupplement = resultSupplement; |
| | | var sendInfo = new CC108_tagCMCrossRealmPKRobotOver(); |
| | | sendInfo.IsWin = (byte)(resultSupplement.winPlayerId == PlayerDatas.Instance.baseData.PlayerID ? 1 : 0); |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | } |
| | | |
| | | public static void StopClientCrossServerOneVsOne() |
| | | { |
| | | isClientCrossServerOneVsOne = false; |
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0); |
| | | PlayerDatas.Instance.extersion.pkState = 0; |
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData(); |
| | | |
| | | PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord; |
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand() |
| | | { |
| | | toMapId = PlayerDatas.Instance.baseData.MapID, |
| | | toLineId = 0, |
| | | needEmpty = true, |
| | | needLoadResource = true, |
| | | serverType = ServerType.CrossSever, |
| | | isClientLoadMap = true |
| | | }); |
| | | } |
| | | |
| | | public struct FightResultSupplement |
| | | { |
| | | public DateTime endTime; |
| | | public int overType; |
| | | public int winPlayerId; |
| | | public int roundCount; |
| | | public uint[] roundWinnerId; |
| | | public string opponentName; |
| | | } |
| | | |
| | | public struct FightObstacle |
| | | { |
| | | public int aPosX; |
| | | public int aPosY; |
| | | public int bPosX; |
| | | public int bPosY; |
| | | public int angle; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0734992b8f1931b4bb6a003f03813224 |
| | | timeCreated: 1549965126 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using Snxxz.UI; |
| | | |
| | | public class ClientCrossServerOneVsOneStage : DungeonStage |
| | | { |
| | | |
| | | static readonly Vector3 leftBornPoint = new Vector3(4.9f, 0.2f, 3.5f); |
| | | static readonly Vector3 rightBornPoint = new Vector3(20f, 0.2f, 18.8f); |
| | | |
| | | static FightInfo fightInfo; |
| | | static PKStageType pkStageType; |
| | | static GA_PlayerClient.PlayerInfo playerInfo; |
| | | static GA_PVPClientPlayer opponentPlayer; |
| | | static uint roundWiner = 0; |
| | | |
| | | PKStage currentStage; |
| | | |
| | | public override void Initialize() |
| | | { |
| | | base.Initialize(); |
| | | fightInfo = default(FightInfo); |
| | | fightInfo.roundWinnerIds = new List<uint>(); |
| | | currentStage = null; |
| | | |
| | | GA_PVPClientPlayer.OnPVPResult += OnClientPVPResult; |
| | | DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent += OnReconnected; |
| | | } |
| | | |
| | | public override void UnInitialize() |
| | | { |
| | | fightInfo = default(FightInfo); |
| | | roundWiner = 0; |
| | | currentStage = null; |
| | | if (opponentPlayer != null) |
| | | { |
| | | opponentPlayer.Destroy(); |
| | | opponentPlayer = null; |
| | | } |
| | | |
| | | if (ClientCrossServerOneVsOne.isClientCrossServerOneVsOne) |
| | | { |
| | | ClientCrossServerOneVsOne.StopClientCrossServerOneVsOne(); |
| | | } |
| | | |
| | | DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent -= OnReconnected; |
| | | GA_PVPClientPlayer.OnPVPResult -= OnClientPVPResult; |
| | | base.UnInitialize(); |
| | | } |
| | | |
| | | protected override void OnStageLoadFinish() |
| | | { |
| | | base.OnStageLoadFinish(); |
| | | |
| | | if (PlayerDatas.Instance.hero != null) |
| | | { |
| | | CameraController.Instance.Apply(); |
| | | } |
| | | |
| | | if (opponentPlayer != null) |
| | | { |
| | | opponentPlayer.Destroy(); |
| | | opponentPlayer = null; |
| | | } |
| | | |
| | | var job = CrossServerLogin.Instance.oneVsOnePlayerData.opponentJob; |
| | | var playerName = CrossServerLogin.Instance.oneVsOnePlayerData.opponentName; |
| | | var level = CrossServerLogin.Instance.oneVsOnePlayerData.opponentLevel; |
| | | var maxHp = CrossServerLogin.Instance.oneVsOnePlayerData.opponentMaxHp; |
| | | playerInfo = ClientCrossServerOneVsOne.GetRandomOpponentPlayerInfo(1, job, playerName, level, maxHp); |
| | | opponentPlayer = GAMgr.Instance.ReqClntPlayer<GA_PVPClientPlayer>(playerInfo, E_ActorGroup.Enemy); |
| | | |
| | | opponentPlayer.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? rightBornPoint : leftBornPoint; |
| | | PlayerDatas.Instance.hero.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? leftBornPoint : rightBornPoint; |
| | | CameraController.Instance.Apply(); |
| | | |
| | | currentStage = new WaitStartStage(); |
| | | currentStage.Begin(); |
| | | } |
| | | |
| | | protected override void OnUpdate() |
| | | { |
| | | base.OnUpdate(); |
| | | |
| | | if (currentStage != null) |
| | | { |
| | | currentStage.Update(); |
| | | if (currentStage.completed) |
| | | { |
| | | currentStage.End(); |
| | | switch (pkStageType) |
| | | { |
| | | case PKStageType.WaitStart: |
| | | currentStage = new FightStage(); |
| | | break; |
| | | case PKStageType.Fight: |
| | | if (fightInfo.isOver) |
| | | { |
| | | currentStage = new FightOverStage(); |
| | | } |
| | | else |
| | | { |
| | | currentStage = new RoundPrepareState(); |
| | | } |
| | | break; |
| | | case PKStageType.RoundPrepare: |
| | | currentStage = new FightStage(); |
| | | break; |
| | | case PKStageType.FightOver: |
| | | currentStage = null; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | if (currentStage != null) |
| | | { |
| | | currentStage.Begin(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OnReconnected() |
| | | { |
| | | var sendInfo = new CA231_tagCMClientStartCustomScene(); |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | } |
| | | |
| | | private void OnClientPVPResult(bool win) |
| | | { |
| | | roundWiner = win ? PlayerDatas.Instance.baseData.PlayerID : ClientCrossServerOneVsOne.OPPONENT_PLAYERID; |
| | | } |
| | | |
| | | public abstract class PKStage |
| | | { |
| | | public float timer { get; protected set; } |
| | | public float duration { get; protected set; } |
| | | public bool completed { get; protected set; } |
| | | |
| | | public abstract void Begin(); |
| | | public abstract void Update(); |
| | | public abstract void End(); |
| | | } |
| | | |
| | | public class WaitStartStage : PKStage |
| | | { |
| | | public override void Begin() |
| | | { |
| | | pkStageType = PKStageType.WaitStart; |
| | | duration = 3f; |
| | | Debug.LogFormat("进入阶段:{0}", pkStageType); |
| | | opponentPlayer.ActorInfo.ResetHp((int)playerInfo.maxHp, -1, (int)playerInfo.maxHp, -1); |
| | | opponentPlayer.ActorInfo.serverDie = false; |
| | | opponentPlayer.IdleImmediate(); |
| | | GA_PVPClientPlayer.AutoAI(false); |
| | | |
| | | PlayerDatas.Instance.baseData.HP = (uint)PlayerDatas.Instance.extersion.MaxHP; |
| | | var maxHp = PlayerDatas.Instance.extersion.MaxHP; |
| | | PlayerDatas.Instance.hero.ActorInfo.ResetHp(maxHp, -1, maxHp, -1); |
| | | PlayerDatas.Instance.FightRefreshPlayerHp((uint)maxHp); |
| | | PlayerDatas.Instance.hero.IdleImmediate(); |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(true); |
| | | |
| | | opponentPlayer.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? rightBornPoint : leftBornPoint; |
| | | PlayerDatas.Instance.hero.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? leftBornPoint : rightBornPoint; |
| | | ClientCrossServerOneVsOne.FakeWaitFight((int)duration); |
| | | } |
| | | |
| | | public override void End() |
| | | { |
| | | fightInfo.roundCount++; |
| | | ClientCrossServerOneVsOne.FakeFightBegin(); |
| | | ClientCrossServerOneVsOne.FakeRoundBegin(fightInfo.roundCount, fightInfo.roundWinnerIds.ToArray()); |
| | | } |
| | | |
| | | public override void Update() |
| | | { |
| | | timer += Time.deltaTime; |
| | | completed = timer >= duration; |
| | | } |
| | | } |
| | | |
| | | public class FightStage : PKStage |
| | | { |
| | | bool figthCompleted = false; |
| | | float restTime = 2f; |
| | | float restTimeTimer = 0f; |
| | | |
| | | public override void Begin() |
| | | { |
| | | pkStageType = PKStageType.Fight; |
| | | duration = 60f; |
| | | roundWiner = 0; |
| | | figthCompleted = false; |
| | | restTimeTimer = 0f; |
| | | |
| | | PlayerDatas.Instance.hero.Behaviour.StartHandupAI(); |
| | | GA_PVPClientPlayer.AutoAI(true); |
| | | opponentPlayer.SelectTarget = PlayerDatas.Instance.hero; |
| | | PlayerDatas.Instance.hero.SelectTarget = opponentPlayer; |
| | | Debug.LogFormat("进入阶段:{0}", pkStageType); |
| | | } |
| | | |
| | | public override void End() |
| | | { |
| | | fightInfo.roundWinnerIds.Add(roundWiner);//记录获胜者的id |
| | | if (fightInfo.roundCount >= 2) |
| | | { |
| | | if (fightInfo.roundCount == 2) |
| | | { |
| | | if (fightInfo.roundWinnerIds[0] == fightInfo.roundWinnerIds[1]) |
| | | { |
| | | fightInfo.isOver = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | fightInfo.isOver = true; |
| | | } |
| | | } |
| | | |
| | | if (fightInfo.isOver) |
| | | { |
| | | opponentPlayer.Destroy(); |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | |
| | | ClientCrossServerOneVsOne.FakeRoundEnd(fightInfo.isOver, fightInfo.roundCount, fightInfo.roundWinnerIds.ToArray()); |
| | | } |
| | | |
| | | public override void Update() |
| | | { |
| | | timer += Time.deltaTime; |
| | | if (!figthCompleted) |
| | | { |
| | | if (roundWiner != 0) |
| | | { |
| | | figthCompleted = true; |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(true); |
| | | GA_PVPClientPlayer.AutoAI(false); |
| | | } |
| | | else if (timer >= duration) |
| | | { |
| | | figthCompleted = true; |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(true); |
| | | GA_PVPClientPlayer.AutoAI(false); |
| | | if (PlayerDatas.Instance.hero.ActorInfo.RealHp >= opponentPlayer.ActorInfo.RealHp) |
| | | { |
| | | roundWiner = PlayerDatas.Instance.baseData.PlayerID; |
| | | } |
| | | else |
| | | { |
| | | roundWiner = ClientCrossServerOneVsOne.OPPONENT_PLAYERID; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | figthCompleted = false; |
| | | } |
| | | } |
| | | |
| | | if (figthCompleted) |
| | | { |
| | | restTimeTimer += Time.deltaTime; |
| | | completed = restTimeTimer >= restTime; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public class RoundPrepareState : PKStage |
| | | { |
| | | public override void Begin() |
| | | { |
| | | pkStageType = PKStageType.RoundPrepare; |
| | | duration = 3f; |
| | | Debug.LogFormat("进入阶段:{0}", pkStageType); |
| | | |
| | | if (fightInfo.roundWinnerIds[fightInfo.roundWinnerIds.Count - 1] == PlayerDatas.Instance.baseData.PlayerID) |
| | | { |
| | | opponentPlayer.ActorInfo.ResetHp((int)playerInfo.maxHp, -1, (int)playerInfo.maxHp, -1); |
| | | opponentPlayer.ActorInfo.serverDie = false; |
| | | opponentPlayer.IdleImmediate(); |
| | | |
| | | if (PlayerDatas.Instance.hero.ActorInfo.RealHp <= 0) |
| | | { |
| | | PlayerDatas.Instance.baseData.HP = 1; |
| | | var maxHp = PlayerDatas.Instance.extersion.MaxHP; |
| | | PlayerDatas.Instance.hero.ActorInfo.ResetHp(1, -1, maxHp, -1); |
| | | PlayerDatas.Instance.FightRefreshPlayerHp(1); |
| | | PlayerDatas.Instance.hero.IdleImmediate(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | PlayerDatas.Instance.baseData.HP = (uint)PlayerDatas.Instance.extersion.MaxHP; |
| | | var maxHp = PlayerDatas.Instance.extersion.MaxHP; |
| | | PlayerDatas.Instance.hero.ActorInfo.ResetHp(maxHp, -1, maxHp, -1); |
| | | PlayerDatas.Instance.FightRefreshPlayerHp((uint)maxHp); |
| | | PlayerDatas.Instance.hero.IdleImmediate(); |
| | | |
| | | if (opponentPlayer.ActorInfo.RealHp <= 0) |
| | | { |
| | | opponentPlayer.ActorInfo.ResetHp(1, -1, (int)playerInfo.maxHp, -1); |
| | | opponentPlayer.ActorInfo.serverDie = false; |
| | | opponentPlayer.IdleImmediate(); |
| | | } |
| | | } |
| | | |
| | | PlayerDatas.Instance.hero.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? leftBornPoint : rightBornPoint; |
| | | opponentPlayer.Pos = ClientCrossServerOneVsOne.myPlace == 1 ? rightBornPoint : leftBornPoint; |
| | | } |
| | | |
| | | public override void End() |
| | | { |
| | | fightInfo.roundCount++; |
| | | ClientCrossServerOneVsOne.FakeRoundBegin(fightInfo.roundCount, fightInfo.roundWinnerIds.ToArray()); |
| | | } |
| | | |
| | | public override void Update() |
| | | { |
| | | timer += Time.deltaTime; |
| | | completed = timer >= duration; |
| | | } |
| | | } |
| | | |
| | | public class FightOverStage : PKStage |
| | | { |
| | | public override void Begin() |
| | | { |
| | | pkStageType = PKStageType.FightOver; |
| | | duration = 10f; |
| | | Debug.LogFormat("进入阶段:{0}", pkStageType); |
| | | ClientCrossServerOneVsOne.ReportDungeonResult(new ClientCrossServerOneVsOne.FightResultSupplement() |
| | | { |
| | | endTime = TimeUtility.ServerNow, |
| | | overType = 0, |
| | | winPlayerId = (int)fightInfo.roundWinnerIds[fightInfo.roundWinnerIds.Count - 1], |
| | | roundCount = fightInfo.roundCount, |
| | | roundWinnerId = fightInfo.roundWinnerIds.ToArray(), |
| | | opponentName = ClientCrossServerOneVsOne.opponentName, |
| | | }); |
| | | |
| | | ClientCrossServerOneVsOne.FakeDungeonExit((int)duration); |
| | | } |
| | | |
| | | public override void End() |
| | | { |
| | | if (ClientCrossServerOneVsOne.isClientCrossServerOneVsOne) |
| | | { |
| | | ClientCrossServerOneVsOne.StopClientCrossServerOneVsOne(); |
| | | } |
| | | } |
| | | |
| | | public override void Update() |
| | | { |
| | | timer += Time.deltaTime; |
| | | completed = timer >= duration; |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum PKStageType |
| | | { |
| | | WaitStart, |
| | | Fight, |
| | | RoundPrepare, |
| | | FightOver, |
| | | } |
| | | |
| | | public struct FightInfo |
| | | { |
| | | public int myBornPoint; |
| | | public bool isOver; |
| | | public int roundCount; |
| | | public List<uint> roundWinnerIds; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecde7a044221c14a828706f25058c82 |
| | | timeCreated: 1549965233 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | timer = 0f;
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.TowerTake);
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.FightStart);
|
| | | model.dungeonCoolDownEvent += OnEndTimeEvent;
|
| | |
|
| | | var surplusTime = (int)((endTime - TimeUtility.ServerNow).TotalSeconds);
|
| | |
| | |
|
| | | private void OnEndTimeEvent(DungeonCoolDownType _type)
|
| | | {
|
| | | if (_type != DungeonCoolDownType.TowerTake && _type != DungeonCoolDownType.PickUpTime)
|
| | | if (_type != DungeonCoolDownType.FightStart && _type != DungeonCoolDownType.PickUpTime)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.TowerTake);
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.FightStart);
|
| | | }
|
| | |
|
| | | var surplusTime = (int)((endTime - TimeUtility.ServerNow).TotalSeconds);
|
| | |
| | | var runeTowerStage = StageLoad.Instance.currentStage as RuneTowerDungeonStage;
|
| | | runeTowerStage.PerformChallengeNextLevel();
|
| | | model.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 0);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.TowerTake, 0);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.FightStart, 0);
|
| | | WindowCenter.Instance.Close<DungeonRuneTowerVictoryWin>();
|
| | | }
|
| | | else
|
| | |
| | | var runeTowerStage = StageLoad.Instance.currentStage as RuneTowerDungeonStage;
|
| | | runeTowerStage.PerformChallengeNextLevel();
|
| | | model.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 0);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.TowerTake, 0);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.FightStart, 0);
|
| | | WindowCenter.Instance.Close<DungeonRuneTowerVictoryWin>();
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | expContainer.SetActive(false);
|
| | |
|
| | | dungeonEndTime = model.GetCoolDownEndTime(DungeonCoolDownType.TowerTake);
|
| | | dungeonEndTime = model.GetCoolDownEndTime(DungeonCoolDownType.FightStart);
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.FlagTake);
|
| | | var exitTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
|
| | | exitDungeonStage = exitTime > TimeUtility.ServerNow;
|
| | |
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case DungeonCoolDownType.TowerTake:
|
| | | case DungeonCoolDownType.FightStart:
|
| | | dungeonEndTime = model.GetCoolDownEndTime(type);
|
| | | break;
|
| | | case DungeonCoolDownType.FlagTake:
|
| | |
| | | case DungeonCoolDownType.PlayerLeave:
|
| | | dungeonFightStage = DungeonFightStage.Prepare;
|
| | | break;
|
| | | case DungeonCoolDownType.TowerTake:
|
| | | case DungeonCoolDownType.FightStart:
|
| | | dungeonFightStage = DungeonFightStage.Normal;
|
| | | break;
|
| | | case DungeonCoolDownType.PickUpTime:
|
| | |
| | | var runeTowerStage = StageLoad.Instance.currentStage as RuneTowerDungeonStage;
|
| | | runeTowerStage.PerformChallengeNextLevel();
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.TowerTake, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, 0);
|
| | | CloseClick();
|
| | | }
|
| | | else
|
| | |
| | | var runeTowerStage = StageLoad.Instance.currentStage as RuneTowerDungeonStage;
|
| | | runeTowerStage.PerformChallengeNextLevel();
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.TowerTake, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, 0);
|
| | | CloseClick();
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.StageCoolDown);
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.NextRound);
|
| | | m_ContainerStageTime.gameObject.SetActive(false);
|
| | | model.dungeonCoolDownEvent += OnDungeonTimeChange;
|
| | | }
|
| | |
|
| | | private void OnDungeonTimeChange(DungeonCoolDownType type)
|
| | | {
|
| | | if (type != DungeonCoolDownType.StageCoolDown) return;
|
| | | if (type != DungeonCoolDownType.NextRound) return;
|
| | | endTime = model.GetCoolDownEndTime(type);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.StageCoolDown);
|
| | | endTime = model.GetCoolDownEndTime(DungeonCoolDownType.NextRound);
|
| | | m_Container.gameObject.SetActive(false);
|
| | | model.dungeonCoolDownEvent += OnDungeonTimeChange;
|
| | | }
|
| | |
|
| | | private void OnDungeonTimeChange(DungeonCoolDownType type)
|
| | | {
|
| | | if (type != DungeonCoolDownType.StageCoolDown)
|
| | | if (type != DungeonCoolDownType.NextRound)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | public static int UISpringDecorate { get; private set; }
|
| | | public static Dictionary<int, List<int>> skillAttrIDDict { get; private set; }
|
| | | public static int mixServerCustomDays { get; private set; }
|
| | | public static float ClientPvpAttributePer { get; private set; }
|
| | |
|
| | | public static void Init()
|
| | | {
|
| | |
| | | UISpringDecorate = GetInt("UISpringDecorate");
|
| | |
|
| | | mixServerCustomDays = GetInt("MixServer");
|
| | | ClientPvpAttributePer = GetInt("ClientPvPAttributePer") * Constants.F_DELTA;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | public class LoadingWin : Window
|
| | | {
|
| | | public static int targetMapResId = 0;
|
| | | public static bool isCrossServerOneVsOne = false;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerNormal;
|
| | | [SerializeField] Image m_BackGround;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (CrossServerLogin.Instance.oneVsOnePlayerData.waitForLoginCrossServer)
|
| | | if (isCrossServerOneVsOne)
|
| | | {
|
| | | loadingType = LoadingType.CrossServerOneOne;
|
| | | }
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | isCrossServerOneVsOne = false;
|
| | | if (!AssetSource.uiFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle("ui/sprite/loading", true, false);
|
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.Hotfix]
|
| | | [XLua.LuaCallCSharp]
|
| | | public class CrossServerLogin : Singleton<CrossServerLogin>
|
| | | {
|
| | | bool m_Busy = false;
|
| | |
| | | public string accountBuf { get; private set; }
|
| | | public string passwordBuf { get; private set; }
|
| | |
|
| | | public void UpdateCrossServerOneVsOneData(HC001_tagGCCrossRealmPKMatchOK matchOK)
|
| | | public void UpdateCrossServerOneVsOneData(HC001_tagGCCrossRealmPKMatchOK matchOK,bool isClient)
|
| | | {
|
| | | oneVsOnePlayerData = new CrossServerOneVsOne()
|
| | | {
|
| | | isClient=isClient,
|
| | | roomId = matchOK.RoomID,
|
| | | waitForLoginCrossServer = true,
|
| | | validTimeLimited = Time.time + 30f,
|
| | |
| | | {
|
| | | if (oneVsOnePlayerData.waitForLoginCrossServer)
|
| | | {
|
| | | if (oneVsOnePlayerData.isClient)
|
| | | {
|
| | | ClientCrossServerOneVsOne.StartClientCrossServerOneVsOne();
|
| | | }
|
| | | else
|
| | | {
|
| | | CrossServerOneVsOneLogin();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | var ip = GameNetSystem.Instance.crossServerData.ip;
|
| | | var port = GameNetSystem.Instance.crossServerData.port;
|
| | |
|
| | | LoadingWin.isCrossServerOneVsOne = true;
|
| | | WindowCenter.Instance.Open<LoadingWin>();
|
| | | oneVsOnePlayerData = oneVsOnePlayerData.SetWaitForLoginCrossServer(false);
|
| | | SetWaitForLoginCrossServerState(false);
|
| | |
|
| | | AccountLogin(account, ip, port, false);
|
| | | }
|
| | |
|
| | | public void SetWaitForLoginCrossServerState(bool state)
|
| | | {
|
| | | oneVsOnePlayerData = oneVsOnePlayerData.SetWaitForLoginCrossServer(false);
|
| | | }
|
| | |
|
| | | public bool IsEnterCrossServerPreparing()
|
| | | {
|
| | | return oneVsOnePlayerData.IsCrossServerOneVsOneEntering();
|
| | | }
|
| | |
|
| | |
|
| | | public void CrossServerBossLogin()
|
| | | {
|
| | |
| | |
|
| | | public struct CrossServerOneVsOne
|
| | | {
|
| | | public bool isClient;
|
| | | public int roomId;
|
| | | public bool waitForLoginCrossServer;
|
| | | public float autoEnsureTime;
|
| | |
| | | public int opponentLevel;
|
| | | public int opponentMaxHp;
|
| | | public int MaxProDef;// 最大护盾
|
| | |
|
| | |
|
| | | public CrossServerOneVsOne SetWaitForLoginCrossServer(bool waitForLoginCrossServer)
|
| | | {
|
| | |
| | | case NetworkReachability.NotReachable:
|
| | | GameNetSystem.Instance.LoginOut();
|
| | | ServerForceExitHintWin.reason = 111;
|
| | | WindowCenter.Instance.Open<ServerForceExitHintWin>();
|
| | | break;
|
| | | case NetworkReachability.ReachableViaCarrierDataNetwork:
|
| | | case NetworkReachability.ReachableViaLocalAreaNetwork:
|
| | |
| | | |
| | | private void ReturnToLogin() |
| | | { |
| | | reason = 0; |
| | | CloseClick(); |
| | | } |
| | | |
| | |
| | |
|
| | | private void MailCountChange()
|
| | | {
|
| | | if (CrossServerUtility.IsCrossServer())
|
| | | if (CrossServerUtility.IsCrossServer() || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
|
| | | {
|
| | | _MailBtn.gameObject.SetActive(false);
|
| | | return;
|
| | |
| | | {
|
| | | IsUpdateBool = true;
|
| | | }
|
| | |
|
| | | if (_tCDBPlayerRefresh == PlayerDataRefresh.ExAttr5)//判断是否再跨服
|
| | | {
|
| | | IsCrossServerOneVsOne();
|
| | |
| | | private void IsShowTaskPanel()//是否显示任务面板
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | if (inDungeon || fairyGrabBossModel.grabBossHintOpen || CrossServerUtility.IsCrossServer())
|
| | | if (inDungeon || fairyGrabBossModel.grabBossHintOpen |
| | | || CrossServerUtility.IsCrossServer() |
| | | || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
|
| | | {
|
| | | m_TaskAndTeamTip.SetActive(false);
|
| | | m_TaskSwithButton.gameObject.SetActive(false);
|
| | |
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.TowerTake, 0);
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, 0);
|
| | | WindowCenter.Instance.Close<DemonTreasureDungeonVictoryWin>();
|
| | |
|
| | | TreasureDungeon treasureDungeon;
|
| | |
| | | |
| | | public class Clock : MonoBehaviour |
| | | { |
| | | public bool stopped { get; private set; } |
| | | |
| | | public DateTime alarmTime { |
| | | get; set; |
| | |
| | | |
| | | public void Stop() |
| | | { |
| | | stopped = true; |
| | | GameObject.Destroy(this.gameObject); |
| | | } |
| | | |
| | |
| | | normalTasks.Add(new ConfigInitTask("DungeonMixServerStateTimeConfig", () => { DungeonMixServerStateTimeConfig.Init(); }, () => { return DungeonMixServerStateTimeConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("DailyQuestMixServerStateTimeConfig", () => { DailyQuestMixServerStateTimeConfig.Init(); }, () => { return DailyQuestMixServerStateTimeConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("CrossRealmPKDanAwardConfig", () => { CrossRealmPKDanAwardConfig.Init(); }, () => { return CrossRealmPKDanAwardConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("CrossServerOneVsOneRobotConfig", () => { CrossServerOneVsOneRobotConfig.Init(); }, () => { return CrossServerOneVsOneRobotConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | | ClientPlayer,
|
| | | PlayerZZ,
|
| | | PlayerSgzcRobot,
|
| | | PVPClientPlayer,
|
| | | }
|
| | |
|
| | | public enum E_ActorState
|
| | |
| | | {
|
| | | LeaveMap = 0,//退出倒计时
|
| | | WaitStart = 1,//开始倒计时
|
| | | TowerTake = 2,//战斗倒计时
|
| | | FightStart = 2,//战斗倒计时
|
| | | FlagTake = 3,
|
| | | StageCoolDown = 4,//下一波倒计时
|
| | | NextRound = 4,//下一波倒计时
|
| | | FBAddTime = 6,
|
| | | ElderGodAreaDeadTime = 7,//古神禁地倒计时
|
| | | PickUpTime = 8,//副本捡装备倒计时
|
| | |
| | | public class RuntimeLogUtility : MonoBehaviour
|
| | | {
|
| | | private static string LS_Key_ForceAutoFight = "LS_Key_ForceAutoFight";
|
| | |
|
| | | public static bool TEST_CLIENT_PVP = false;
|
| | | public static bool TEST_CLIENT_PVP_AI = false;
|
| | | public static bool s_BattleLog = false;
|
| | | public static bool s_MoveLog = false;
|
| | | public static bool s_ForceOneEnemy = false;
|
| | |
| | | RuntimeLogUtility.s_LogMoveDistance = EditorGUILayout.Toggle("位移距离Log输出", RuntimeLogUtility.s_LogMoveDistance);
|
| | | RuntimeLogUtility.s_ShowMapLine = EditorGUILayout.Toggle("显示地图网格", RuntimeLogUtility.s_ShowMapLine);
|
| | | RuntimeLogUtility.s_ShowZZAtkValue = EditorGUILayout.Toggle("显示助战伤害", RuntimeLogUtility.s_ShowZZAtkValue);
|
| | | RuntimeLogUtility.TEST_CLIENT_PVP = EditorGUILayout.Toggle("模拟客户端PVP状态", RuntimeLogUtility.TEST_CLIENT_PVP);
|
| | | RuntimeLogUtility.TEST_CLIENT_PVP_AI = EditorGUILayout.Toggle("模拟客户端PVP的AI状态", RuntimeLogUtility.TEST_CLIENT_PVP_AI);
|
| | |
|
| | | if (GUILayout.Button("创建PVP敌方"))
|
| | | {
|
| | | GActorPlayerBase.PlayerInfo _playerInfo = new GActorPlayerBase.PlayerInfo();
|
| | | _playerInfo.maxHp = (uint)PlayerDatas.Instance.extersion.MaxMP;
|
| | | _playerInfo.hp = _playerInfo.maxHp;
|
| | | _playerInfo.level = 200;
|
| | | _playerInfo.job = 1;
|
| | | _playerInfo.name = "机器人";
|
| | |
|
| | | _playerInfo.itemDatas = new GActorPlayerBase.CEquipInfo[4];
|
| | |
|
| | | // 10484, 10481, 10482, 3713
|
| | | _playerInfo.itemDatas[0] = new GActorPlayerBase.CEquipInfo
|
| | | {
|
| | | id = 10484,
|
| | | place = (int)RoleEquipType.retClothes
|
| | | };
|
| | | _playerInfo.itemDatas[1] = new GActorPlayerBase.CEquipInfo
|
| | | {
|
| | | id = 10481,
|
| | | place = (int)RoleEquipType.retWeapon
|
| | | };
|
| | | _playerInfo.itemDatas[2] = new GActorPlayerBase.CEquipInfo
|
| | | {
|
| | | id = 10482,
|
| | | place = (int)RoleEquipType.retWeapon2
|
| | | };
|
| | | _playerInfo.itemDatas[3] = new GActorPlayerBase.CEquipInfo
|
| | | {
|
| | | id = 3713,
|
| | | place = (int)RoleEquipType.retWing
|
| | | };
|
| | |
|
| | | GAMgr.Instance.ReqClntPlayer<GA_PVPClientPlayer>(_playerInfo, E_ActorGroup.Player);
|
| | | }
|
| | |
|
| | | if (GUILayout.Button("重置PVP敌方"))
|
| | | {
|
| | | GA_PVPClientPlayer.Reset();
|
| | | }
|
| | |
|
| | | _navChkPos = EditorGUILayout.Vector3Field("检测点", _navChkPos);
|
| | |
|