Browse Source

本客户端获得作战部署控制权限后发送控制权的指令,防止其他客户端没有修改导致多个客户端都有控制权限

develop
曹衍涛 4 years ago
parent
commit
b49d266412
  1. 8
      Assets/Scripts/Common/Police/CommandingCtrl.cs
  2. 20
      Assets/Scripts/Common/Police/PoliceInfoMsgBind.cs

8
Assets/Scripts/Common/Police/CommandingCtrl.cs

@ -116,6 +116,14 @@ public class CommandingCtrl : MonoBehaviour {
|| CurrentUserInfo.role == Role.)
{
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
}
else

20
Assets/Scripts/Common/Police/PoliceInfoMsgBind.cs

@ -191,7 +191,15 @@ public class PoliceInfoMsgBind : MonoBehaviour
if (Uids.Count == 0)
{
CurrentUserInfo.generalCommanding = true;
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
else
{
@ -251,7 +259,15 @@ public class PoliceInfoMsgBind : MonoBehaviour
if (Uids.Count == 0)
{
CurrentUserInfo.generalCommanding = true;
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
else
{

Loading…
Cancel
Save