public static void SendCharacterCreated(MyObjectBuilder_Character character, MyCockpit cockpit)
        {
            MySyncCreate.SendEntityCreated(character);

            AttachToCockpitMsg msg = new AttachToCockpitMsg();

            msg.CharacterEntityId = character.EntityId;
            msg.CockpitEntityId   = cockpit.EntityId;

            Sync.Layer.SendMessageToAll(msg);
        }
        static void OnAttachToCockpit(MySyncCharacter sync, ref AttachToCockpitMsg msg, MyNetworkClient sender)
        {
            MyCharacter character = sync.Entity;
            MyCockpit   cockpit   = MyEntities.GetEntityById(msg.CockpitEntityId) as MyCockpit;

            Debug.Assert(cockpit != null);
            if (cockpit == null)
            {
                return;
            }

            cockpit.AttachPilot(character, false);
        }
 static void OnAttachToCockpit(MySyncShipController sync, ref AttachToCockpitMsg msg, MyNetworkClient sender)
 {
     MyCockpit cockpit = (MyCockpit)sync.Entity;
     var character = MyEntities.GetEntityById(msg.CharacterEntityId) as MyCharacter;
     cockpit.AttachPilot(character, false);
 }
 public static void SendCharacterAttachToCockpit(long character, MyCockpit cockpit)
 {
     AttachToCockpitMsg msg = new AttachToCockpitMsg();
     msg.CharacterEntityId = character;
     msg.CockpitEntityId = cockpit.EntityId;
     Sync.Layer.SendMessageToAll(ref msg);
 }
        public static void SendCharacterCreated(MyObjectBuilder_Character character, MyCockpit cockpit)
        {
            MySyncCreate.SendEntityCreated(character);

            AttachToCockpitMsg msg = new AttachToCockpitMsg();
            msg.CharacterEntityId = character.EntityId;
            msg.CockpitEntityId = cockpit.EntityId;

            Sync.Layer.SendMessageToAll(ref msg);
        }
        static void OnAttachToCockpit(MySyncCharacter sync, ref AttachToCockpitMsg msg, MyNetworkClient sender)
        {
            MyCharacter character = sync.Entity;
            MyCockpit cockpit = MyEntities.GetEntityById(msg.CockpitEntityId) as MyCockpit;
            Debug.Assert(cockpit != null);
            if (cockpit == null) return;

            cockpit.AttachPilot(character, false);
        }