Beispiel #1
0
        public override void Run(string[] args)
        {
            // Log any unhandled exception.
            AppDomain.CurrentDomain.UnhandledException += (s, e) =>
            {
                var exception = e.ExceptionObject as Exception;
                InternalLog.Error(LogTag, $"Unhandled exception: {exception}");
            };

            // Parse engine arguments passed from the tool. This should be reworked.
            for (int i = args.Length - 1; i >= 0; i--)
            {
                var arg = args[i].Trim('\'');
                if (arg.StartsWith("FLUTTER_ENGINE_ARGS"))
                {
                    var engineArgs = arg.Substring(arg.IndexOf(' '));
                    InternalLog.Debug(LogTag, "Running with: " + engineArgs);

                    // A regex is used here to correctly parse "quoted" strings.
                    // TODO: Avoid using Linq to reduce the memory pressure.
                    EngineArgs.AddRange(Regex.Matches(engineArgs, @"[\""].+?[\""]|[^ ]+")
                                        .Cast <Match>()
                                        .Select(x => x.Value.Trim('"')));
                    break;
                }
            }

            base.Run(args);
        }
Beispiel #2
0
 void _objLinkManager_OnEngineDisConnected(object sender, EngineArgs e)
 {
     if (e.ENGINEIP == ConfigurationManager.AppSettings["stingserver"])
     {
         isInitialized = false;
     }
 }
Beispiel #3
0
 void objLinkManager_OnEngineDisConnected(object sender, EngineArgs e)
 {
     if (e.ENGINEIP == m_serverurl)
     {
         IsInitialized = false;
     }
 }
Beispiel #4
0
 void objplayercontainer_OnEngineConnected(object sender, EngineArgs e)
 {
     if (e.ENGINEIP == ConfigurationManager.AppSettings["stingserver"])
     {
         isInitialized = true;
         //LoadScene();
         LoadTemplate();
     }
 }
Beispiel #5
0
 void objLink_OnEngineConnected(object sender, EngineArgs e)
 {
     WriteTrace("objLink_OnEngineConnected");
     if (e.ENGINEIP == m_serverurl)
     {
         IsInitialized = true;
         LoadScene();
     }
 }
        public override void Run(string[] args)
        {
            for (int i = args.Length - 1; i >= 0; i--)
            {
                if (args[i].StartsWith("FLUTTER_ENGINE_ARGS"))
                {
                    args[i] = args[i].Substring(args[i].IndexOf(' ')).Trim();
                    Log.Debug(LogTag, "Run with: " + args[i]);

                    // A regex is used here to correctly parse "quoted" strings.
                    // TODO: Avoid using Linq to reduce the memory pressure.
                    EngineArgs.AddRange(Regex.Matches(args[i], @"[\""].+?[\""]|[^ ]+")
                                        .Cast <Match>()
                                        .Select(x => x.Value.Trim('"')));
                    break;
                }
            }

            base.Run(args);
        }
Beispiel #7
0
        private void ParseEngineArgs()
        {
            string packageId = Current.ApplicationInfo.PackageId;
            string tempPath  = $"/home/owner/share/tmp/sdk_tools/{packageId}.rpm";

            if (!File.Exists(tempPath))
            {
                return;
            }
            try
            {
                var lines = File.ReadAllText(tempPath).Trim().Split("\n");
                if (lines.Length > 0)
                {
                    EngineArgs.AddRange(lines);
                }
                File.Delete(tempPath);
            }
            catch (Exception ex)
            {
                InternalLog.Warn(LogTag, $"Error while processing a file:\n{ex}");
            }
        }
        private void ParseEngineArgs()
        {
            string appId    = Current.ApplicationInfo.ApplicationId;
            string tempPath = $"/home/owner/share/tmp/sdk_tools/{appId}.rpm";

            if (!File.Exists(tempPath))
            {
                return;
            }
            try
            {
                var lines = File.ReadAllText(tempPath).Trim().Split("\n");
                foreach (string line in lines)
                {
                    InternalLog.Info(LogTag, $"Enabled: {line}");
                    EngineArgs.Add(line);
                }
                File.Delete(tempPath);
            }
            catch (Exception ex)
            {
                InternalLog.Warn(LogTag, $"Error while processing a file: {ex}");
            }
        }
 /// <summary>
 /// fires when engine is connected
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void objLink_OnEngineConnected(object sender, EngineArgs e)
 {
     btnConnect.BackColor = Color.DarkGreen;
 }
Beispiel #10
0
 void objLink_OnEngineConnected(object sender, EngineArgs e)
 {
     if (e.ENGINEIP == m_serverurl)
     {
         IsInitialized = true;
         LoadScene();
     }
 }
Beispiel #11
0
 void objLinkManager_OnEngineDisConnected(object sender, EngineArgs e)
 {
     if (e.ENGINEIP == m_serverurl)
     {
         IsInitialized = false;
     }
 }
Beispiel #12
0
        }//end (frmOnline)

        #endregion


        #region events

        /// <summary>
        /// fires when engine is connected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void objLink_OnEngineConnected(object sender, EngineArgs e)
        {
            btnConnect.BackColor = Color.DarkGreen;
        }//end (objLink_OnEngineConnected)