Esempio n. 1
0
        public async static Task addCorePlatform(NKScriptContext context, Dictionary <string, object> options)
        {
            entryType = (System.Type)options["NKS.Entry"];


            // PROCESS SHOULD BE FIRST CORE PLATFORM PLUGIN
            await NKC_Process.attachToContext(context, options);

            // LOAD REMAINING CORE PLATFORM PLUGINS
            await NKC_FileSystem.attachToContext(context, options);

            //      await NKC_Console.attachToContext(context, options);
            await NKC_Crypto.attachToContext(context, options);

            await NKC_SocketTCP.attachToContext(context, options);

            await NKC_SocketUDP.attachToContext(context, options);

            await NKC_Timer.attachToContext(context, options);
        }
Esempio n. 2
0
        private static string rewriteGeneratedStub(string stub, string forKey)
        {
            switch (forKey)
            {
            case ".global":
                var appjs = NKStorage.getResource(typeof(NKC_Process), "process.js", "lib/platform");

                // UNIQUE SCRIPT FOR PROCESS
                return("function loadplugin(){\n" + "this.process = this.process || Object.create(null);\n" + NKC_Process.syncProcessDictionary() + "\n" + appjs + "\n}\n" + stub + "\n" + "loadplugin();" + "\n");

            //              return "function loadplugin(){\n" + appjs + "\n}\n" + stub + "\n" + "loadplugin();" + "\n";
            default:
                return(stub);
            }
        }