Exemple #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);
        }
Exemple #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;
     }
 }
Exemple #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);
        }
Exemple #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;
            }
        }
Exemple #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);
                }
            }
        }
Exemple #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);
                }
            }
        }
Exemple #7
0
 static void ChangeDoorFailure(ref ChangeDoorMsg msg, MyNetworkClient sender)
 {
 }
Exemple #8
0
 static void ChangeDoorFailure(ref ChangeDoorMsg msg, MyNetworkClient sender)
 {
 }