Пример #1
0
 private static void OnSetMainCockpit(MySyncShipController sync, ref SetMainCockpitMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.IsMainCockpit = msg.SetMainCockpit;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
Пример #2
0
 private static void OnSetControlWheels(MySyncShipController sync, ref ControlWheelsMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.ControlWheels = msg.ControlWheels;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
Пример #3
0
 static void UpdateDampenersSuccess(MySyncShipController sync, ref UpdateDampenersMsg msg, MyNetworkClient sender)
 {
     sync.RaiseDampenersUpdated(msg.DampenersEnabled);
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
        private static void OnAutopilotAttached(MySyncShipController syncObject, ref AttachAutopilotMsg message, MyNetworkClient sender)
        {
            var cockpit = syncObject.m_shipController as MyCockpit;

            Debug.Assert(cockpit != null, "Trying to assing autopilot to something else than cockpit!");
            if (cockpit != null)
            {
                (syncObject.m_shipController as MyCockpit).AttachAutopilot(MyAutopilotFactory.CreateAutopilot(message.Autopilot));
            }
        }
Пример #5
0
        private static void OnChangeHorizonIndicator(MySyncShipController sync, ref SetHorizonIndicatorMsg msg, MyNetworkClient sender)
        {
            if (sync.m_shipController == null)
            {
                return;
            }

            sync.m_shipController.HorizonIndicatorEnabled = msg.IndicatorState;

            if (Sync.IsServer)
            {
                MySession.Static.SyncLayer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
            }
        }
Пример #6
0
 protected override MySyncEntity OnCreateSync()
 {
     var sync = new MySyncShipController(this);
     OnInitSync(sync);
     return sync;
 }
Пример #7
0
 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);
 }
Пример #8
0
		private static void OnChangeHorizonIndicator(MySyncShipController sync, ref SetHorizonIndicatorMsg msg, MyNetworkClient sender)
		{
			if (sync.m_shipController == null)
				return;

			sync.m_shipController.HorizonIndicatorEnabled = msg.IndicatorState;

			if(Sync.IsServer)
				MySession.Static.SyncLayer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);

		}
Пример #9
0
 private static void OnSetMainCockpit(MySyncShipController sync, ref SetMainCockpitMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.IsMainCockpit = msg.SetMainCockpit;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 private static void OnSetMainCockpit(MySyncShipController sync, ref SetMainCockpitMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.IsMainCockpit = msg.SetMainCockpit;
 }
 private static void OnAutopilotAttached(MySyncShipController syncObject, ref AttachAutopilotMsg message, MyNetworkClient sender)
 {
     var cockpit = syncObject.m_shipController as MyCockpit;
     Debug.Assert(cockpit != null, "Trying to assing autopilot to something else than cockpit!");
     if (cockpit != null)
     {
         (syncObject.m_shipController as MyCockpit).AttachAutopilot(MyAutopilotFactory.CreateAutopilot(message.Autopilot));
     }
 }
 private static void OnSetControlWheels(MySyncShipController sync, ref ControlWheelsMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.ControlWheels = msg.ControlWheels;
 }
 static void UpdateDampenersSuccess(MySyncShipController sync, ref UpdateDampenersMsg msg, MyNetworkClient sender)
 {
     sync.RaiseDampenersUpdated(msg.DampenersEnabled);
 }
 static void UpdatePilotRelativeEntrySuccess(MySyncShipController sync, ref UpdatePilotRelativeEntryMsg msg, MyNetworkClient sender)
 {
     sync.RaisePilotRelativeEntryUpdated(msg.RelativeEntry);
 }
Пример #15
0
 protected virtual void OnInitSync(MySyncShipController sync)
 {
     sync.UseSuccess += sync_UseSuccess;
     sync.UseFailed += sync_UseFailed;
     sync.ControlledEntity_Used += sync_ControlledEntity_Used;
     sync.SwitchToWeaponSuccessHandler += SwitchToWeaponSuccess;
     sync.SwitchAmmoMagazineSuccessHandler += SwitchAmmoMagazineSuccess;
     sync.PilotRelativeEntryUpdated += sync_PilotRelativeEntryUpdated;
     sync.DampenersUpdated += sync_DampenersUpdated;
 }
 static void UpdateDampenersSuccess(MySyncShipController sync, ref UpdateDampenersMsg msg, MyNetworkClient sender)
 {
     sync.RaiseDampenersUpdated(msg.DampenersEnabled);
 }
 private static void OnSetMainCockpit(MySyncShipController sync, ref SetMainCockpitMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.IsMainCockpit = msg.SetMainCockpit;
 }
 private static void OnSetControlWheels(MySyncShipController sync, ref ControlWheelsMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.ControlWheels = msg.ControlWheels;
 }
Пример #19
0
 static void UpdateDampenersSuccess(MySyncShipController sync, ref UpdateDampenersMsg msg, MyNetworkClient sender)
 {
     sync.RaiseDampenersUpdated(msg.DampenersEnabled);
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 static void UpdatePilotRelativeEntrySuccess(MySyncShipController sync, ref UpdatePilotRelativeEntryMsg msg, MyNetworkClient sender)
 {
     sync.RaisePilotRelativeEntryUpdated(msg.RelativeEntry);
 }
Пример #21
0
 private static void OnSetControlWheels(MySyncShipController sync, ref ControlWheelsMsg msg, MyNetworkClient sender)
 {
     sync.m_shipController.ControlWheels = msg.ControlWheels;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }