|
|
|
@ -6,6 +6,7 @@ using UnityEngine;
|
|
|
|
|
using AX.Serialization; |
|
|
|
|
using UnityEngine.SceneManagement; |
|
|
|
|
using AX.NetworkSystem; |
|
|
|
|
using System.Linq; |
|
|
|
|
|
|
|
|
|
public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour |
|
|
|
|
{ |
|
|
|
@ -38,9 +39,52 @@ public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour
|
|
|
|
|
(u.UserInfo.Id, info)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//SceneManager.LoadScene("Police"); |
|
|
|
|
transform.parent.Find("Police").gameObject.SetActive(true); |
|
|
|
|
UIManager.GetView<ChatPanel>().ShowPoliceSize(); |
|
|
|
|
//再再这里判断是不是有重复时间,有的话开携程等待 |
|
|
|
|
List<KeyValuePair<long, int>> zhiHArrivetimes = new List<KeyValuePair<long, int>>(); |
|
|
|
|
List<long> ZHID = new List<long>(); |
|
|
|
|
for (int i = 0; i < CurrentUserInfo.room.UserList.Count; i++) |
|
|
|
|
{//筛选房间里的总支大队ID |
|
|
|
|
if (CurrentUserInfo.room.UserList[i].Role==Role.总队指挥|| |
|
|
|
|
CurrentUserInfo.room.UserList[i].Role == Role.支队指挥 || |
|
|
|
|
CurrentUserInfo.room.UserList[i].Role == Role.大队指挥) |
|
|
|
|
{ |
|
|
|
|
ZHID.Add(CurrentUserInfo.room.UserList[i].UserInfo.Id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < info.ArriveTimeList.Count; i++) |
|
|
|
|
{//根据房间里的总支大id筛选到达时间里的总支大 |
|
|
|
|
if (ZHID.Contains(info.ArriveTimeList[i].Key)) |
|
|
|
|
{ |
|
|
|
|
zhiHArrivetimes.Add(info.ArriveTimeList[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//根据到达时间分组 |
|
|
|
|
var q = from p in zhiHArrivetimes group p by p.Value; |
|
|
|
|
var timelist= q.ToList(); |
|
|
|
|
for (int i = 0; i < timelist.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var pairlist = timelist[i].ToList(); |
|
|
|
|
if (pairlist.Count > 1) |
|
|
|
|
{//如果组里的个数大于一,也就是有两个及以上设置的时间是相同的 |
|
|
|
|
for (int j = 0; j < pairlist.Count; j++) |
|
|
|
|
{ |
|
|
|
|
if (CurrentUserInfo.mySelf.Id == pairlist[j].Key) |
|
|
|
|
{//加0.5是考虑第一组也就是i=0的情况,没有加整数是考虑计算出来的数可能设置时间相同最后导致进场时间还是一样 |
|
|
|
|
StartCoroutine(waitinto((i + 0.5f) * (j+0.5f))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (CurrentUserInfo.mySelf.Id == pairlist[0].Key) |
|
|
|
|
{ |
|
|
|
|
StartCoroutine(waitinto(0)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//else if (CurrentUserInfo.role == Role.中队指挥) |
|
|
|
|
//{ |
|
|
|
@ -65,4 +109,10 @@ public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour
|
|
|
|
|
UIManager.GetView<ChatPanel>().ShowPoliceSize(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
IEnumerator waitinto(float time) |
|
|
|
|
{ |
|
|
|
|
yield return new WaitForSeconds(time*0.2f); |
|
|
|
|
transform.parent.Find("Police").gameObject.SetActive(true); |
|
|
|
|
UIManager.GetView<ChatPanel>().ShowPoliceSize(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|