Exemplo n.º 1
0
        public void SendChangeDoorRequest(bool open, long identityId)
        {
            var msg = new ChangeDoorMsg();

            msg.EntityId = m_block.EntityId;
            msg.PlayerId = identityId;
            msg.Open     = open;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Exemplo n.º 2
0
 static void ChangeDoorSuccess(ref ChangeDoorMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     MyDoor block = entity as MyDoor;
     if (block != null)
     {
         block.Open = msg.Open;
     }
 }
Exemplo n.º 3
0
        public void SendChangeDoorRequest(bool open, long identityId)
        {
            var msg = new ChangeDoorMsg();

            msg.EntityId = m_block.EntityId;
            msg.PlayerId = identityId;
            msg.Open     = open;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Exemplo n.º 4
0
        static void ChangeDoorSuccess(ref ChangeDoorMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            MyAdvancedDoor block = entity as MyAdvancedDoor;

            if (block != null)
            {
                block.Open = msg.Open;
            }
        }
Exemplo n.º 5
0
        static void ChangeDoorRequest(ref ChangeDoorMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;
            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            if (entity is MyDoor)
            {
                MyRelationsBetweenPlayerAndBlock relation = MyRelationsBetweenPlayerAndBlock.NoOwnership;
                var cubeBlock = entity as MyCubeBlock;
                if (cubeBlock != null)
                {
                    relation = cubeBlock.GetUserRelationToOwner(msg.PlayerId);
                }

                if (relation.IsFriendly())
                {
                    Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
Exemplo n.º 6
0
        static void ChangeDoorRequest(ref ChangeDoorMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            if (entity is MyAdvancedDoor)
            {
                MyRelationsBetweenPlayerAndBlock relation = MyRelationsBetweenPlayerAndBlock.FactionShare;
                var cubeBlock = entity as MyCubeBlock;
                if (cubeBlock != null)
                {
                    relation = cubeBlock.GetUserRelationToOwner(msg.PlayerId);
                }

                if (relation == MyRelationsBetweenPlayerAndBlock.FactionShare || relation == MyRelationsBetweenPlayerAndBlock.Owner)
                {
                    Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
Exemplo n.º 7
0
 static void ChangeDoorFailure(ref ChangeDoorMsg msg, MyNetworkClient sender)
 {
 }
Exemplo n.º 8
0
 static void ChangeDoorFailure(ref ChangeDoorMsg msg, MyNetworkClient sender)
 {
 }