// constructor
        static RemoteTech()
        {
            foreach (var a in AssemblyLoader.loadedAssemblies)
            {
                if (a.name == "RemoteTech")
                {
                    API              = a.assembly.GetType("RemoteTech.API.API");
                    IsEnabled        = API.GetMethod("IsRemoteTechEnabled");
                    EnabledInSPC     = API.GetMethod("EnableInSPC");
                    IsConnected      = API.GetMethod("HasAnyConnection");
                    IsConnectedKSC   = API.GetMethod("HasConnectionToKSC");
                    IsTargetKSC      = API.GetMethod("HasDirectGroundStation");
                    NameTargetKSC    = API.GetMethod("GetClosestDirectGroundStation");
                    NameFirstHopKSC  = API.GetMethod("GetFirstHopToKSC");
                    SignalDelay      = API.GetMethod("GetSignalDelayToKSC");
                    SetRadioBlackout = API.GetMethod("SetRadioBlackoutGuid");
                    GetRadioBlackout = API.GetMethod("GetRadioBlackoutGuid");
                    SetPowerDown     = API.GetMethod("SetPowerDownGuid");
                    GetPowerDown     = API.GetMethod("GetPowerDownGuid");
                    GetControlPath   = API.GetMethod("GetControlPath");

                    // check version is above 1.8.12, warn users if they are using an old version of RemoteTech
#if !KSP13
                    if (!((a.versionMajor >= 1) && (a.versionMinor >= 8) && (a.versionRevision >= 13)))
#else
                    if (!((a.versionMajor >= 1) && (a.versionMinor >= 8)))
#endif
                    {
                        Lib.Log("**WARNING** RemoteTech version is below v1.8.13 - Kerbalism's signal system will not operate correctly with the version" +
                                " of RemoteTech currently installed." + Environment.NewLine + "Please update your installation of RemoteTech to the latest version.");
                    }
                    break;
                }
            }
        }
 static RemoteTech()
 {
     foreach (var a in AssemblyLoader.loadedAssemblies)
     {
         if (a.name == "RemoteTech")
         {
             API         = a.assembly.GetType("RemoteTech.API.API");
             IsEnabled   = API.GetMethod("IsRemoteTechEnabled");
             IsConnected = API.GetMethod("HasAnyConnection");
             break;
         }
     }
 }
Exemple #3
0
 static RemoteTech()
 {
     foreach (var a in AssemblyLoader.loadedAssemblies)
     {
         if (a.name == "RemoteTech")
         {
             API                 = a.assembly.GetType("RemoteTech.API.API");
             IsEnabled           = API.GetMethod("IsRemoteTechEnabled");
             IsConnected         = API.GetMethod("HasAnyConnection");
             IsConnectedKSC      = API.GetMethod("HasConnectionToKSC");
             ShortestSignalDelay = API.GetMethod("GetShortestSignalDelay");
             SetRadioBlackout    = API.GetMethod("SetRadioBlackoutGuid");
             GetRadioBlackout    = API.GetMethod("GetRadioBlackoutGuid");
             break;
         }
     }
 }