public override void UpdateOnceBeforeFrame()
 {
     base.UpdateOnceBeforeFrame();
     if (MySession.Static.EnableIngameScripts == false)
     {
         string response = MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Exception_NotAllowed);
         if (Sync.IsServer)
         {
             MyMultiplayer.RaiseEvent(this, x => x.WriteProgramResponse, response);
         }
         else
         {
             SyncObject.SendRunProgramRequest(string.Empty);
         }
         return;
     }
     if (m_programData != null)
     {
         // If there is an existing instance, make sure the storage data is updated before sending
         // an update request
         if (m_instance != null)
         {
             m_storageData = m_instance.Storage;
         }
         SyncObject.SendUpdateProgramRequest(m_programData, m_storageData);
     }
     UpdateEmissivity();
 }
예제 #2
0
 public override void UpdateOnceBeforeFrame()
 {
     base.UpdateOnceBeforeFrame();
     if (MySession.Static.EnableIngameScripts == false)
     {
         string response = MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Exception_NotAllowed);
         if (Sync.IsServer)
         {
             SyncObject.SendProgramResponseMessage(response);
             WriteProgramResponse(response);
         }
         else
         {
             SyncObject.SendRunProgramRequest(string.Empty);
         }
         return;
     }
     if (m_programData != null)
     {
         SyncObject.SendUpdateProgramRequest(m_programData, m_storageData);
     }
     UpdateEmissivity();
 }