Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts: # Assets/Scripts/Scenes/MainController.cs
This commit is contained in:
commit
4b3dad0b84
@ -176,6 +176,7 @@ public class MainController : BaseScene
|
|||||||
}
|
}
|
||||||
void FinishMessageLeft()
|
void FinishMessageLeft()
|
||||||
{
|
{
|
||||||
|
#if UNITY_STANDALONE_WIN
|
||||||
msgIndex = 0;
|
msgIndex = 0;
|
||||||
if (msgs != null)
|
if (msgs != null)
|
||||||
{
|
{
|
||||||
@ -184,6 +185,7 @@ public class MainController : BaseScene
|
|||||||
item.DOFade(0, 0.3f);
|
item.DOFade(0, 0.3f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinishMessageRight()
|
void FinishMessageRight()
|
||||||
@ -313,7 +315,8 @@ public class MainController : BaseScene
|
|||||||
MapUDPService.Send(0, App.CurrentUser.Id, new double[]{ 0d,0d}, competitionId: 0);
|
MapUDPService.Send(0, App.CurrentUser.Id, new double[]{ 0d,0d}, competitionId: 0);
|
||||||
//发送消息
|
//发送消息
|
||||||
|
|
||||||
foreach (var item in MapUDPService.GetOnlineUserList())
|
var list = MapUDPService.GetAllOnlineUserList();
|
||||||
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
if (item.RouteId > 0)
|
if (item.RouteId > 0)
|
||||||
{
|
{
|
||||||
@ -344,6 +347,11 @@ public class MainController : BaseScene
|
|||||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name), $"{item.RouteId}{item.Name}");
|
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name), $"{item.RouteId}{item.Name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (item.Point[0] == -1d)
|
||||||
|
{
|
||||||
|
var message = $"{item.Name}上线了";
|
||||||
|
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name), $"{item.Id}{item.LastActiveTime}{item.Point}");
|
||||||
|
}
|
||||||
//距离
|
//距离
|
||||||
if (item.EndDistance > 50)
|
if (item.EndDistance > 50)
|
||||||
{
|
{
|
||||||
@ -417,6 +425,7 @@ public class MainController : BaseScene
|
|||||||
}
|
}
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
|
EventQueueSystem.RemoveListener<LinkedMessageEvent>(LinkedMessageHandler);
|
||||||
App.isHomeChanged -= OnIsHomeChanged;
|
App.isHomeChanged -= OnIsHomeChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -303,7 +303,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<OnlineUser> GetOnlineUserList()
|
public static List<OnlineUser> GetAllOnlineUserList()
|
||||||
{
|
{
|
||||||
var result = onlineUserHelper.OnlineUsers.Where(c => !c.IsSelf).ToList();
|
var result = onlineUserHelper.OnlineUsers.Where(c => !c.IsSelf).ToList();
|
||||||
return result;
|
return result;
|
||||||
@ -325,6 +325,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int GetNearRiderCount()
|
public static int GetNearRiderCount()
|
||||||
|
{
|
||||||
|
return onlineUserHelper.OnlineUsers.Where(c=> (c.Point[0] != 0 && c.Point[1] != 0)|| (c.Point[0] != -1 && c.Point[1] != -1)).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetAllOnlineUserCount()
|
||||||
{
|
{
|
||||||
return onlineUserHelper.OnlineUsers.Count();
|
return onlineUserHelper.OnlineUsers.Count();
|
||||||
}
|
}
|
||||||
@ -484,7 +489,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
var list = mes.ToList();
|
var list = mes.ToList();
|
||||||
//去除自己的数据和命令包
|
//去除自己的数据和命令包
|
||||||
//mes.RemoveAll(item => item.MemberId == App.CurrentUser.Id || item.Point[0] == 0);
|
//mes.RemoveAll(item => item.MemberId == App.CurrentUser.Id || item.Point[0] == 0);
|
||||||
list.RemoveAll(item => item.Point[0] == 0 && item.Point[1] == 0);
|
//list.RemoveAll(item => item.Point[0] == 0 && item.Point[1] == 0);
|
||||||
//去除重复数据
|
//去除重复数据
|
||||||
list = list.Distinct(new OlineUserComparer()).ToList();
|
list = list.Distinct(new OlineUserComparer()).ToList();
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
Instance.delegates[typeof(T)] = temp;
|
Instance.delegates[typeof(T)] = temp;
|
||||||
}
|
}
|
||||||
Instance.delegateLookup.Remove(del);
|
Instance.delegateLookup.Remove(del);
|
||||||
|
keyList.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,16 +121,15 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
return;
|
return;
|
||||||
Instance.eventQueue.Enqueue(e);
|
Instance.eventQueue.Enqueue(e);
|
||||||
}
|
}
|
||||||
static List<string> keyList = new List<string>();
|
private static Dictionary<string,GameEvent> keyList = new Dictionary<string, GameEvent>();
|
||||||
|
|
||||||
public static void QueueEventOnce(GameEvent e,string key)
|
public static void QueueEventOnce(GameEvent e,string key)
|
||||||
{
|
{
|
||||||
if (!Instance.delegates.ContainsKey(e.GetType()))
|
if (!Instance.delegates.ContainsKey(e.GetType()))
|
||||||
return;
|
return;
|
||||||
if (keyList.Contains(key))
|
if (keyList.ContainsKey(key))
|
||||||
return;
|
return;
|
||||||
keyList.Add(key);
|
keyList.Add(key,e);
|
||||||
Debug.Log(126);
|
|
||||||
Instance.eventQueue.Enqueue(e);
|
Instance.eventQueue.Enqueue(e);
|
||||||
}
|
}
|
||||||
float timer = 0.0f;
|
float timer = 0.0f;
|
||||||
|
|||||||
@ -46,8 +46,8 @@ public class Loom : MonoBehaviour
|
|||||||
DontDestroyOnLoad(g);
|
DontDestroyOnLoad(g);
|
||||||
_current = g.AddComponent<Loom>();
|
_current = g.AddComponent<Loom>();
|
||||||
MapUDPService.Init();
|
MapUDPService.Init();
|
||||||
|
MapUDPService.Send(0, App.CurrentUser.Id, new double[] { -1d, -1d }, competitionId: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Action> _actions = new List<Action>();
|
private List<Action> _actions = new List<Action>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user