You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.8 KiB
68 lines
2.8 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using UnityEngine; |
|
using AX.Serialization; |
|
using UnityEngine.SceneManagement; |
|
using AX.NetworkSystem; |
|
|
|
public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour |
|
{ |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
var info = message.Body.Deserialize<PoliceCallData>(); |
|
|
|
if (CurrentUserInfo.role == Role.总队指挥 || |
|
CurrentUserInfo.role == Role.大队指挥 || |
|
CurrentUserInfo.role == Role.支队指挥 |
|
) |
|
{ |
|
GameSettings.disasterSetting.policeCallData = info; |
|
foreach (UserData u in CurrentUserInfo.room.UserList) |
|
{ |
|
if (u.Org.Id == CurrentUserInfo.organization.Id && u.Role == Role.参谋) |
|
// 参谋随着对应总队、支队、大队跳转场景 |
|
{ |
|
//将通报指令转发给参谋同时添加参谋到场时间 |
|
int time = 0; |
|
foreach (var item in info.ArriveTimeList) |
|
{ |
|
if (item.Key == CurrentUserInfo.mySelf.Id) |
|
{ |
|
time = item.Value; |
|
} |
|
} |
|
info.ArriveTimeList.Add(new KeyValuePair<long, int>(u.UserInfo.Id, time)); |
|
NetworkManager.Default.SendAsync("COMMANDCENTER_FIRENOTIFY_SYNC", new KeyValuePair<long, PoliceCallData> |
|
(u.UserInfo.Id, info)); |
|
} |
|
} |
|
//SceneManager.LoadScene("Police"); |
|
transform.parent.Find("Police").gameObject.SetActive(true); |
|
UIManager.GetView<ChatPanel>().ShowPoliceSize(); |
|
} |
|
//else if (CurrentUserInfo.role == Role.中队指挥) |
|
//{ |
|
// GameSettings.disasterSetting.policeCallData = info; |
|
// foreach (UserData u in CurrentUserInfo.room.UserList) |
|
// { |
|
// if (u.Org.Id == CurrentUserInfo.organization.Id && u.Role == Role.战斗班长) |
|
// // 参谋随着对应战斗班跳转场景 |
|
// { |
|
// //将通报指令转发给战斗班 |
|
// NetworkManager.Default.SendAsync("COMMANDCENTER_FIRENOTIFY_SYNC", new KeyValuePair<long, PoliceCallData> |
|
// (u.UserInfo.Id, info)); |
|
// } |
|
// } |
|
// SceneManager.LoadScene("Police"); |
|
//} |
|
else |
|
{ |
|
GameSettings.disasterSetting.policeCallData = info; |
|
// SceneManager.LoadScene("Police"); |
|
transform.parent.Find("Police").gameObject.SetActive(true); |
|
UIManager.GetView<ChatPanel>().ShowPoliceSize(); |
|
} |
|
} |
|
}
|
|
|