AkiraPixelWind/Assets/Scripts/Main/CustomsComponent/UserMgrComponent.cs

860 lines
30 KiB
C#
Raw Normal View History

2023-01-05 00:28:20 +08:00
//using Axibug;
//using Axibug.Event;
//using Axibug.Resources;
//using Axibug.Runtime;
//using Game.Config;
//using System;
//using System.Collections;
//using System.Collections.Generic;
//using System.Linq;
//using UnityEngine;
//namespace Game
//{
// public class UserMgrComponent : GameComponent
// {
// private Queue<S_ROLE_BASE> temp_RemoveUser = new Queue<S_ROLE_BASE>();//<2F><>Ҫ<EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
// private Queue<Int32> temp_RemoveRequest = new Queue<Int32>();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
// //key:ְҵ+<2B>Ա<EFBFBD> <20><><EFBFBD>磺ss_w
// private Dictionary<string, Queue<GameObject>> userPool = new Dictionary<string, Queue<GameObject>>();
// private float temp_CheckTime = 0;
// private float temp_RequestTime = 0;
// private S_ROLE_SELF myrole { get { return UserData.role; } }
// private void Start()
// {
// //AppEntry.Event.Subscribe(UserMoveEventArgs.EventId, OnUserMoveEvent);
// //AppEntry.Event.Subscribe(UserPlayerSkillEventArgs.EventId, OnUserPlayerSkill);
// //AppEntry.Event.Subscribe(RoleDeadEventArgs.EventId, OnRoleDead);
// //AppEntry.Event.Subscribe(RoleReviveEventArgs.EventId, OnRoleRevive);
// //AppEntry.Event.Subscribe(RoleLevelupEventArgs.EventId, OnRoleLevelUp);
// //AppEntry.Event.Subscribe(AddRoleBufferEvent.EventId, AddBuffer);
// //AppEntry.Event.Subscribe(RemoveRoleBufferEvent.EventId, RemoveBuffer);
// }
// public GameObject Accquire(string myKey, S_ROLE_BASE role)
// {
// if (!userPool.ContainsKey(myKey))
// return null;
// Queue<GameObject> gos = userPool[myKey];
// if (gos.Count == 0)
// return null;
// GameObject go = gos.Dequeue();
// go.SetActive(true);
// //role.userview.go = go;
// role.userview.rolePrefabGo = go;
// return go;
// }
// public void Release(S_ROLE_BASE role)
// {
// string strJob = Common.GetStrJob((byte)role.innate.job);
// string strSex = Common.GetStrSex(role.innate.sex);
// string myKey = $"{strJob}_{strSex}";
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
// BattleEntitysInfoCtrl.Instance.DisposeUserInfo(role.mem.userindex);
// Queue<GameObject> gos = null;
// if (userPool.ContainsKey(myKey))
// gos = userPool[myKey];
// else
// {
// gos = new Queue<GameObject>();
// userPool.Add(myKey, gos);
// }
// if(role.userview.go != null)
// {
// /*
// gos.Enqueue(role.userview.go);
// role.userview.go.SetActive(false);
// role.userview.go = null;
// */
// gos.Enqueue(role.userview.rolePrefabGo);
// role.userview.go.SetActive(false);
// }
// role.userview.Release();
// AppEntry.Event.FireNow(null, CharReleaseEventArgs.Create(role.dataSet.GetCharIndex(), E_NODE_TYPE.N_ROLE));
// }
// public void CreateMainPlayer(S_ROLE_SELF myrole)
// {
// if (myrole == null)
// return;
// //<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// MainPlayerDataSet mainDataSet = new MainPlayerDataSet();
// mainDataSet.Init(myrole);
// myrole.dataSet = mainDataSet;
// CreateRole((byte)myrole.innate.job, myrole, true);
// }
// public void CreateRole(byte job, S_ROLE_BASE role, bool isMainPlayer=false)
// {
// if (!isMainPlayer)
// {
// //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>
// HotfixEntry.Map.SetRoleCell(role.mem.userindex, (int)role.status.pos.x, (int)role.status.pos.z, E_NODE_TYPE.N_ROLE);
// }
// //RoleTop.transform.localRotation = Quaternion.EulerRotation(60, 0, 0);
// string strJob = Common.GetStrJob(job);
// string strSex = Common.GetStrSex(role.innate.sex);
// string myKey = $"{strJob}_{strSex}";
// //@Test <20><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>
// string path = Utility.Path.GetPlayerPath(myKey, myKey+"_Test");
// //<2F><>ûд<C3BB><D0B4>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// GameObject go = Accquire(myKey, role);
// if(go == null)
// {
// //ch
// GameObject RoleTop = new GameObject();
// if (isMainPlayer)
// {
// RoleTop.transform.parent = HotfixEntry.MainPlayer.transform;
// RoleTop.transform.localPosition = Vector3.zero;
// }
// else
// RoleTop.transform.parent = HotfixEntry.UserMgr.transform;
// HotfixEntry.Resources.Clone(path, CreateCallback, RoleTop.transform, role, myKey.ToLower());
// return;
// }
// role.userview.go = go;
// role.userview.ResetGameObject(go);
// }
// protected void CreateCallback(UnityEngine.Object obj, CallbackType err, object userData)
// {
// if (err != CallbackType.Success)
// {
// Log.Error("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫʧ<C9AB><CAA7>");
// return;
// }
// if (userData == null)
// return;
// S_ROLE_BASE role = (S_ROLE_BASE)userData;
// if (role as S_ROLE_SELF != null)
// HotfixEntry.MainPlayer.myView.InitGameObject(obj as GameObject);
// else
// {
// role.userview.InitGameObject(obj as GameObject);
// }
// }
// /// <summary>
// /// <20><><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>װ
// /// </summary>
// /// <param name="roleView"></param>
// /// <param name="job"></param>
// /// <param name="SubJob"><3E><><EFBFBD><EFBFBD>ְҵ,<2C><>DZ_M_DD<44><44><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>У<EFBFBD>ĩβ<C4A9><CEB2>"DD"</param>
// public void MainPlayerChangeEquipment(byte job,string SubJob)
// {
// MyView myview = HotfixEntry.MainPlayer.myView;
// ChangeEquipment(myview, myview.myrole,job,SubJob);
// }
// protected void ChangeEquipmentCallback(UnityEngine.Object obj, CallbackType err, object userData)
// {
// if (err != CallbackType.Success)
// {
// Log.Error("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫʧ<C9AB><CAA7>");
// return;
// }
// if (userData == null)
// return;
// S_ROLE_BASE role = (S_ROLE_BASE)userData;
// GameObject Oldobj = role.characterview.rolePrefabGo.gameObject;
// GameObject Newobj = (obj as GameObject);
// role.characterview.rolePrefabGo = Newobj;
// //<2F><><EFBFBD><EFBFBD>Movement<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>
// if (role as S_ROLE_SELF != null)
// {
// HotfixEntry.MainPlayer.myView.InitMovement(obj as GameObject);
// }
// else
// role.userview.InitMovement(obj as GameObject);
// Newobj.transform.localPosition = Oldobj.transform.localPosition;
// Newobj.transform.localRotation = Oldobj.transform.localRotation;
// //<2F><>ȫ<EFBFBD><EFBFBD><E6BBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>֤ʱ<D6A4>򿿺<EFBFBD>
// Destroy(Oldobj);
// }
// //<2F><>ɫ<EFBFBD>ƶ<EFBFBD>
// private void OnUserMoveEvent(object sender, LogicEventArgs e)
// {
// UserMoveEventArgs move = (UserMoveEventArgs)e;
// if (move == null)
// throw new GameException("UserMoveEventArgs is null");
// var role = UserData.findRoleData(move.userIndex);
// if(role == null)
// throw new GameException("the role is null");
// role.userview.StartMove(move.speed, role.status.face);
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵĴ<D2B5><C4B4><EFBFBD><EFBFBD><EFBFBD>
// HotfixEntry.Map.UpdateUserBC(role);
// }
// //<2F><>ɫ<EFBFBD><C9AB><EFBFBD>ż<EFBFBD><C5BC><EFBFBD>
// private void OnUserPlayerSkill(object sender, LogicEventArgs e)
// {
// UserPlayerSkillEventArgs skill = (UserPlayerSkillEventArgs)e;
// if (skill == null)
// throw new GameException("UserPlayerSkillEventArgs is null");
// int clientId = ConstClass.GetClientSkillID(skill.skillid, skill.skilllevel);
// SkillData script = HotfixEntry.Luban.GetSkill(clientId);
// if (script == null)
// throw new GameException($"the skillid:[{clientId}] is null");
// Transform source = null;
// Transform target = null;
// Vector3 targetPos = Vector3.zero;
// CellNode cell = null;
// switch (skill.lock_type)
// {
// case (byte)Lock_Type.LOCK_PLAYER:
// {
// var role = UserData.findRoleData(skill.lockIndex);
// if (role == null || role.userview == null)
// throw new GameException($"the lockIndex:{skill.lockIndex} is null");
// cell = role.userview.CurCell;
// target = role.userview.rolePrefabGo.transform;
// targetPos = role.userview.rolePrefabGo.transform.position;
// }
// break;
// case (byte)Lock_Type.LOCK_MONSTER:
// {
// var robot = RobotData.findRobotData(skill.lockIndex);
// if (robot == null || robot.data == null)
// throw new GameException($"the lockIndex:{skill.lockIndex} is null");
// cell = robot.view.CurCell;
// target = robot.view.rolePrefabGo.transform;
// targetPos = robot.view.rolePrefabGo.transform.position;
// }
// break;
// }
// if (cell == null)
// return;
// //<2F>޸<EFBFBD><DEB8><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>source<63><65>taget<65><74>λ<EFBFBD><CEBB>
// if (skill.userIndex == myrole.mem.userindex)
// {
// HotfixEntry.MainPlayer.myView.Attack(cell, script.Motion);
// myrole.move.state = 1;
// source = HotfixEntry.MainPlayer.myView.rolePrefabGo.transform;
// }
// else
// {
// S_ROLE_BASE role = UserData.findRoleData(skill.userIndex);
// if (role == null)
// throw new GameException("the role is null");
// role.userview.Attack(role.userview.CurCell, script.Motion, false);
// source = role.userview.rolePrefabGo.transform;
// }
// //<2F><><EFBFBD>ż<EFBFBD><C5BC><EFBFBD><EFBFBD><EFBFBD>Ч
// string path = string.Empty;
// //<2F><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ܶ<EFBFBD><DCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򲥷<EFBFBD>
// if (!string.IsNullOrEmpty(script.BindEffect) && script.BindEffect != "0")
// {
// path = Utility.Path.GetPrefabPath("Effects", script.BindEffect);
// HotfixEntry.EffectMgr.PlayAttackEffect(path, source);
// }
// if (!string.IsNullOrEmpty(script.WorldEffect) && script.WorldEffect != "0")
// {
// path = Utility.Path.GetPrefabPath("Effects", script.WorldEffect);
// HotfixEntry.EffectMgr.PlayWorldEffect(path, targetPos);
// }
// if (!string.IsNullOrEmpty(script.BallisticEffect) && script.BallisticEffect != "0")
// {
// path = Utility.Path.GetPrefabPath("Effects", script.BallisticEffect);
// StartCoroutine(DelayPlayerEffect(script.EffectDelayTime, path, source, target));
// }
// Log.Debug($"<22><><EFBFBD>ż<EFBFBD><C5BC>ܣ<EFBFBD>ID={clientId}<7D><> <20><><EFBFBD><EFBFBD>={script.Motion}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч={script.BindEffect}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч={script.WorldEffect}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч={script.BallisticEffect}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч={script.HitEffect}");
// }
// IEnumerator DelayPlayerEffect(int delay, string path, Transform source, Transform target)
// {
// yield return new WaitForSeconds(delay / 1000.0f);
// HotfixEntry.EffectMgr.PlayBallisticEffect(path, source, target);
// }
// //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
// public void OnRoleDead(object sender, LogicEventArgs e)
// {
// RoleDeadEventArgs dead = (RoleDeadEventArgs)e;
// if (dead == null)
// throw new GameException("RoleDeadEventArgs is null");
// S_ROLE_BASE role = null;
// if (dead.roleIndex == myrole.mem.userindex)
// {
// role = myrole;
// //HotfixEntry.MainPlayer.myView.SetAnimation("Dead", true);
// myrole.myView.movement.characterAnimator.PlayDead();
// HotfixEntry.UI.OpenUI<DeathPanelUI>();
// }
// else
// {
// role = UserData.findRoleData(dead.roleIndex);
// if (role == null)
// throw new GameException("the role is null");
// //role.userview.SetAnimation("Dead", true);
// role.userview.movement.characterAnimator.PlayDead();
// HotfixEntry.Map.ClearRoleCellData(dead.roleIndex, E_NODE_TYPE.N_ROLE);
// }
// switch ((Lock_Type)role.tmp.lockData.lock_type)
// {
// case Lock_Type.LOCK_PLAYER://<2F><><EFBFBD><EFBFBD>
// {
// var lockRole = UserData.findRoleData(role.tmp.lockData.lock_index);
// if (lockRole == null || lockRole.userview == null || lockRole.userview.go == null)
// return;
// lockRole.userview.SetSublightOff();
// }
// break;
// case Lock_Type.LOCK_MONSTER://<2F><><EFBFBD><EFBFBD>
// {
// var lockRobot = RobotData.findRobotData(role.tmp.lockData.lock_index);
// if (lockRobot == null || lockRobot.view == null || lockRobot.view.go == null)
// return;
// lockRobot.view.SetSublightOff();
// }
// break;
// }
// role.tmp.lockData.lock_state = 0;
// role.tmp.lockData.lock_index = -1;
// }
// //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
// public void OnRoleRevive(object sender, LogicEventArgs e)
// {
// RoleReviveEventArgs revive = (RoleReviveEventArgs)e;
// if (revive == null)
// throw new GameException("RoleReviveEventArgs is null");
// //<2F><><EFBFBD><EFBFBD>
// if (revive.userIndex == myrole.mem.userindex)
// {
// myrole.myView.movement.characterAnimator.DeadToIdle();
// AppEntry.Event.Fire(null, BattleRoleMovingEventArgs.Create(myrole.myDataSet.GetCharIndex(),E_NODE_TYPE.N_MAINPLAYER));
// HotfixEntry.MainPlayer.myView.TeleportingToPos(revive.pos);
// myrole.status.state = (int)CharacterState.Living;
// return;
// }
// S_ROLE_BASE role = UserData.findRoleData(revive.userIndex);
// if (role == null)
// throw new GameException("the role is null");
// role.userview.movement.characterAnimator.DeadToIdle();
// role.userview.TeleportingToPos(revive.pos);
// role.status.state = (int)CharacterState.Living;
// }
// //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
// public void OnRoleLevelUp(object sender, LogicEventArgs e)
// {
// RoleLevelupEventArgs msg = (RoleLevelupEventArgs)e;
// if (msg == null)
// throw new GameException("RoleLevelupEventArgs is null");
// S_ROLE_BASE role = null;
// if (msg.roleIndex == myrole.mem.userindex)
// {
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>
// role = myrole;
// }
// else
// {
// role = UserData.findRoleData(msg.roleIndex);
// if (role == null)
// throw new GameException("the role is null");
// }
// role.exp.level = msg.currentLevel;
// Log.Warning($"<22><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>{role.exp.level}<7D><>");
// }
// //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>buff
// public void AddBuffer(object sender, LogicEventArgs e)
// {
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
// AddRoleBufferEvent msg = (AddRoleBufferEvent)e;
// if (msg == null)
// throw new GameException("AddRoleBufferEvent is null");
// if (msg.roleIndex != myrole.mem.userindex)
// return;
// AppEntry.Event.Fire(this, AddBufferIconEvent.Create(msg.buffId));
// }
// //<2F><>ɫɾ<C9AB><C9BE>buff
// public void RemoveBuffer(object sender, LogicEventArgs e)
// {
// //ɾ<><C9BE><EFBFBD><EFBFBD>Ч
// RemoveRoleBufferEvent msg = (RemoveRoleBufferEvent)e;
// if (msg == null)
// throw new GameException("AddRoleBufferEvent is null");
// if (msg.roleIndex != myrole.mem.userindex)
// return;
// AppEntry.Event.Fire(this, RemoveBufferIconEvent.Create(msg.buffId));
// }
// // Update is called once per frame
// void Update()
// {
// #region
// if (Input.GetKeyDown(KeyCode.O))
// {
// CaoCaoLog.Debug("<22><><EFBFBD>Ի<EFBFBD>װ<EFBFBD><D7B0>,DD");
// MainPlayerChangeEquipment((byte)eJob.Warrior, "DD");
// }
// if (Input.GetKeyDown(KeyCode.P))
// {
// CaoCaoLog.Debug("<22><><EFBFBD>Ի<EFBFBD>װ<EFBFBD><D7B0>,KD");
// MainPlayerChangeEquipment((byte)eJob.Warrior, "KD");
// }
// if (Input.GetKeyDown(KeyCode.U))
// {
// CaoCaoLog.Debug("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
// UIMgr.Instance.OpenUI<TipShowLevelUpUI>();
// }
// if (Input.GetKeyDown(KeyCode.Y))
// {
// HotfixEntry.UI.OpenUI<AttrPointTipsUI>();
// }
// if (Input.GetKeyDown(KeyCode.T))
// {
// HotfixEntry.UI.OpenUI<TaskMainUI>();
// }
// //if (Input.GetKeyDown(KeyCode.M))
// //{
// // if (!HotfixEntry.UI.IsOpen<FullMapUI>())
// // HotfixEntry.UI.OpenUI<FullMapUI>();
// //}
// #endregion
// if (HotfixEntry.MainPlayer.myView == null)
// return;
// if (!UserData.role.isEntryWorld)
// return;
// //1<><31>ͬ<EFBFBD><CDAC><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>ƶ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
// SyncMove();
// UserBuffManager.renderBuff();
// UpdateUserCell();
// //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ 200<30><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
// float ftime = Time.time - temp_CheckTime;
// if (ftime > 0.2f)
// {
// temp_CheckTime = Time.time;
// UpdateUserRect();
// return;
// }
// //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
// foreach (var r in UserData.onlines)
// {
// var role = r.Value;
// if (role.userview == null)
// continue;
// if (role.userview.go == null)
// continue;
// if (role.status.state == (int)CharacterState.Dead)
// continue;
// role.userview.Update();
// }
// //4<><34><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ͹<D2BA><CDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ѷ<EFBFBD>ֵƽ̯<C6BD><CCAF><EFBFBD><EFBFBD>֡
// float ftime2 = Time.time - temp_RequestTime;
// if (ftime2 > 0.05f)
// {
// temp_RequestTime = Time.time;
// UpdateRequestRoleData();
// UpdateRequestRobotData();
// }
// }
// private void UpdateUserCell()
// {
// int[] keys = UserData.onlines.Keys.ToArray();
// for (int i = 0; i < keys.Length; i++)
// {
// S_ROLE_BASE user = UserData.onlines[keys[i]];
// if (user.mem.userindex != HotfixEntry.MainPlayer.myDataSet.GetCharIndex() && user.status.state < (byte)CharacterState.Dead && user.life.curHP > 0)
// {
// //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>
// HotfixEntry.Map.SetRoleCell(keys[i], user.userview.go.transform.position, E_NODE_TYPE.N_ROLE);
// }
// }
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
// private void UpdateRequestRoleData()
// {
// if (UserData.requestRoleDatas.Count == 0)
// return;
// Int32 count = 0;
// foreach (var r in UserData.requestRoleDatas)
// {
// int index = r.Value;
// temp_RemoveRequest.Enqueue(index);
// ++count;
// if (count >= UserData.MAX_REQUEST_ROLE_COUNT)
// break;
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// while (temp_RemoveRequest.Count > 0)
// {
// Int32 userindex = temp_RemoveRequest.Dequeue();
// //<2F>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// UserData.removeRequestRoledata(userindex);
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>
// AppEntryWorld.send_700(userindex);
// //var entryWorld = HotfixEntry.Resources.m_Assembly.GetType("Game.HotFix.AppEntryWorld");
// //var start = entryWorld.GetMethod("send_700");
// //start?.Invoke(null, new object[] { userindex });
// //AppEntryWorld.send_700(userindex);
// }
// temp_RemoveRequest.Clear();
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
// private void UpdateRequestRobotData()
// {
// if (UserData.requestRobotDatas.Count == 0)
// return;
// Int32 count = 0;
// foreach (var r in UserData.requestRobotDatas)
// {
// int index = r.Value;
// temp_RemoveRequest.Enqueue(index);
// ++count;
// if (count >= UserData.MAX_REQUEST_ROBOT_COUNT)
// break;
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// while (temp_RemoveRequest.Count > 0)
// {
// Int32 robotindex = temp_RemoveRequest.Dequeue();
// //<2F>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// UserData.removeRequestRobotdata(robotindex);
// //var app = HotfixEntry.Resources.m_Assembly.GetType("Game.HotFix.AppRobot");
// //var method = app.GetMethod("send_8000");
// //method?.Invoke(null, new object[] { robotindex });
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>
// AppRobot.send_8000(robotindex);
// }
// temp_RemoveRequest.Clear();
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBFAA><EFBFBD><EFBFBD>
// public void LeaveWorld(S_ROLE_BASE role)
// {
// if (role == null)
// return;
// //<2F>ͷŽ<CDB7>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// HotfixEntry.Map.ClearRoleCellData(role.mem.userindex, E_NODE_TYPE.N_ROLE);
// //0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// ClearLock(role, null);
// //1<><31><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ʾ<EFBFBD><CABE>Դ
// if (role.userview != null)
// {
// //role.userview.Release();
// Release(role);
// UserData.pushUserView(role.userview);
// role.userview = null;
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// UserData.pushRoleDataSet(role.dataSet);
// role.dataSet = null;
// }
// //2<><32><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>
// UserData.removeRoleData(role.mem.userindex);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>
// UserData.pushRoleData(role);//<2F>Żض<C5BB><D8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ճ<EFBFBD> <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>
// }
// public void ClearLock(S_ROLE_BASE role, S_ROBOT_BASE robot)
// {
// bool islock = false;
// if (role == null && robot == null)
// {
// islock = true;
// }
// else
// {
// switch ((Lock_Type)UserData.role.tmp.lockData.lock_type)
// {
// case Lock_Type.LOCK_PLAYER:
// if (role != null)
// if (role.mem.userindex == UserData.role.tmp.lockData.lock_index)
// islock = true;
// break;
// case Lock_Type.LOCK_MONSTER:
// if (robot != null)
// if (robot.data.robotindex == UserData.role.tmp.lockData.lock_index)
// islock = true;
// break;
// }
// }
// if (!islock)
// return;
// if (UserData.role.tmp.lockData.lock_type > 0)
// {
// //FGUIManager.GetFUI(FGUIType.BattlePanel).GetComponent<UIBattleComponent>().HideSelectObjInfo();
// //GameObject.Destroy(MyUserData.lockeffect);
// }
// UserData.role.tmp.lockData.Init();
// }
// //ͬ<><CDAC><EFBFBD>ƶ<EFBFBD> ״̬ͬ<CCAC><CDAC>
// //<2F><><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD> 1<><31>״̬<D7B4><CCAC><EFBFBD>ͱ仯 2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˱仯 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB7A2><EFBFBD>˱仯
// public void SyncMove()
// {
// float face = HotfixEntry.MainPlayer.myView.movement.CurRotate;
// //1<><31>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>
// if (myrole.move.state != myrole.move.oldstate)
// {
// myrole.move.oldstate = myrole.move.state;
// SendMove();
// return;
// }
// if (myrole.move.state == 0)
// return;
// //2<><32><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>
// float ftime = Time.time - myrole.move.syncTime;
// if (ftime > 0.2f)
// {
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>0.2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Vector3 centerPos = HotfixEntry.Map.GetPosByCell(HotfixEntry.MainPlayer.myView.movement.CurCell.X, HotfixEntry.MainPlayer.myView.movement.CurCell.Y);
// float centerDis = Vector3.Distance(HotfixEntry.MainPlayer.myView.Pos, centerPos);
// if (centerDis >= 0.2f)
// return;
// Vector3 tPos = new Vector3(HotfixEntry.MainPlayer.myView.movement.CurCell.X, 0, HotfixEntry.MainPlayer.myView.movement.CurCell.Y);
// float distance = Vector3.Distance(myrole.move.pos, tPos);
// if (distance >= 0.8f)
// {
// SendMove();
// return;
// }
// }
// else if (ftime > 0.1f)
// {
// //3<><33><EFBFBD>Ƕȷ<C7B6><C8B7><EFBFBD><EFBFBD>˱仯
// float angle = Math.Abs(myrole.move.face - face);
// if (angle >= 5)
// {
// SendMove();
// return;
// }
// }
// }
// public void SendMove()
// {
// float face = HotfixEntry.MainPlayer.myView.movement.CurRotate;
// myrole.move.syncTime = Time.time;
// myrole.move.face = face;
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// if (myrole.move.state == 0)
// AppMove.send_1000(face, 0, myrole.status.pos, myrole.status.pos);
// else
// {
// myrole.move.pos = new Vector3(HotfixEntry.MainPlayer.myView.movement.CurCell.X, 0, HotfixEntry.MainPlayer.myView.movement.CurCell.Y);
// //Log.Debug($"<22><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>㣺[{myrole.status.pos}], <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:[{myrole.move.pos}]");
// AppMove.send_1000(face, HotfixEntry.MainPlayer.myView.movement.speed, myrole.status.pos, myrole.move.pos);
// myrole.status.pos = new Vector3(HotfixEntry.MainPlayer.myView.movement.CurCell.X, 0, HotfixEntry.MainPlayer.myView.movement.CurCell.Y);
// }
// HotfixEntry.Map.UpdateUserBC(myrole);
// }
// //<2F><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<><31><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBFAA>Ϣɾ<CFA2><C9BE>ok 2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҾŹ<D2BE><C5B9><EFBFBD><EFBFBD><EFBFBD>Χɾ<CEA7><C9BE> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䳬ʱɾ<CAB1><C9BE>
// private void UpdateUserRect()
// {
// foreach (var r in UserData.onlines)
// {
// var role = r.Value;
// if (role.userview == null)
// continue;
// if (role.userview.go == null)
// continue;
// role.userview.Update();
// //1<><31><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҾŹ<D2BE><C5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// if (!myrole.bc.edge.IsRect(role.bc.grid_big.row, role.bc.grid_big.col))
// {
// //<2F><>Ҫɾ<D2AA><C9BE>
// temp_RemoveUser.Enqueue(role);
// Debug.Log("<22><><EFBFBD>Ҳ<EFBFBD><D2B2>ھŹ<DABE><C5B9><EFBFBD><EFBFBD><EFBFBD>Χ..." + role.mem.userId);
// continue;
// }
// //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>֤ <20><><EFBFBD><EFBFBD>60<36><30> <20><>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ɾ<><C9BE>
// float ftime = Time.time - role.tmp.heartTime;
// if (ftime > 60)
// {
// //<2F><>Ҫɾ<D2AA><C9BE>
// temp_RemoveUser.Enqueue(role);
// Debug.Log("<22><><EFBFBD><EFBFBD>hearttime...ɾ<><C9BE>" + role.mem.userId);
// continue;
// }
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// while (temp_RemoveUser.Count > 0)
// {
// var role = temp_RemoveUser.Dequeue();
// //<2F>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// if (UserData.onlines.ContainsKey(role.mem.userindex))
// {
// UserData.onlines.Remove(role.mem.userindex);
// }
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBFAA><EFBFBD><EFBFBD>
// LeaveWorld(role);
// }
// temp_RemoveUser.Clear();
// }
// public List<S_ROLE_BASE> GetRoleListInRadius(int cellNum, int curRobotIndex = -1)
// {
// CellNode cur = HotfixEntry.MainPlayer.myView.CurCell;
// List<S_ROLE_BASE> roles = new List<S_ROLE_BASE>();
// foreach (var r in UserData.onlines)
// {
// var role = r.Value;
// if (role.userview == null)
// continue;
// var roleCell = role.userview.CurCell;
// float count = Vector2Int.Distance(new Vector2Int(cur.X, cur.Y), new Vector2Int(roleCell.X, roleCell.Y));
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3AC><EFBFBD><EFBFBD>
// if (count > cellNum)
// continue;
// //<2F><>ǰ<EFBFBD><C7B0>ѡ<EFBFBD>й֣<D0B9><D6A3><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ѡ<EFBFBD><D1A1>״̬
// if (role.mem.userindex == curRobotIndex)
// continue;
// roles.Add(role);
// }
// return roles;
// }
// public void SetAllSublightOff()
// {
// foreach (var r in UserData.onlines)
// {
// var role = r.Value;
// if (role.userview == null)
// continue;
// role.userview.SetSublightOff();
// }
// }
// }
//}