示例#1
0
        static public void StartupModule()
        {
            Check(Singleton == null);
            Check(VsModule.CreateVsConnectServerFunc != null);
            //Create VSConnectServer;
            Singleton = VsModule.CreateVsConnectServerFunc();

            Singleton.InitializeServer();
        }
示例#2
0
        /// <summary>
        /// Processing at the end
        /// </summary>
        public static void ShutdownModule()
        {
            Log(("VsModule shutting down..."));
            if (VsModule.EnableVsConnectServer)
            {
                VsConnectServer.ShutdownModule();

                BestMedia.VsDotnet.vs_connect_api_v3.vsc_Api_V3_t.DLLShutDown();
            }

            if (VsModule.EnableVsVehicle)
            {
                VsVehicleSolver.ShutdownModule();
            }
            ModuleStarted = false;
        }
示例#3
0
        /// <summary>
        /// Clean up references/etc. when a Contract is destroyed.
        /// </summary>
        /// <param name="contract"></param>
        void SPreDestroyContract_(VscContract contract)
        {
            VsConnectServer vsConnect = ToObject(vsc_Api_V3_t.Contract_GetAppData(contract)) as VsConnectServer;

            // Loop through all Fields and remove the corresponding UObject* from vsConnect->mVsVars.
            var schema    = vsc_Api_V3_t.Contract_GetSchema(contract);
            var numFields = vsc_Api_V3_t.Schema_GetNumFields(schema);

            for (int i = 0; i < numFields; ++i)
            {
                var field = vsc_Api_V3_t.Schema_GetField(schema, i);
                var vsvar = ToObject(vsc_Api_V3_t.Field_GetAppData(field)) as VSVarBase;
                if (vsvar != null)
                {
                    vsc_Api_V3_t.Field_SetAppData(field, IntPtr.Zero);
                }
            }
        }
示例#4
0
        /// <summary>
        /// Start up
        /// </summary>
        public static void StartupModule()
        {
            Log(("VsModule starting..."));

            Log($"VsPass dir: %{VsModule.VsPath}");
            Log($"User Output dir: %{VsModule.VsEngineUserDir}");

            //Only Windows 64bit platform
            Check(System.Environment.Is64BitProcess && System.Environment.OSVersion.Platform == PlatformID.Win32NT);

            //Check server and client same
            Check(!(EnableVsConnectServer && EnableVsConnectClient));

            if (ModuleStarted)
            {
                LogError(("Attempting to restart module not allowed."));
            }
            else
            {
                ModuleStarted = true;
                if (System.IO.Directory.Exists(VsModule.VsEngineUserDir) == false)
                {
                    System.IO.Directory.CreateDirectory(VsModule.VsEngineUserDir);
                }

                if (EnableVsConnectServer || EnableVsConnectClient)
                {
                    BestMedia.VsDotnet.vs_connect_api_v3.vsc_Api_V3_t.DllInit(VsModule.VsPath);
                    if (EnableVsConnectServer)
                    {
                        VsConnectServer.StartupModule();
                    }


                    if (EnableVsConnectClient)
                    {
                    }
                }
                if (EnableVsVehicle)
                {
                    VsVehicleSolver.StartupModule();
                }
            }
        }
示例#5
0
 public static void ShutdownModule()
 {
     Check(Singleton != null);
     Singleton.DestroyServer();
     Singleton = null;
 }