Ejemplo n.º 1
0
 public void Start()
 {
     if (this.ListFile.Count > 0)
     {
         if (this.Type == TypeServiceX.FTP)
         {
             foreach (var f_run in ListFile)
             {
                 if (f_run.Name.Contains("autorun"))
                 {
                     LOG.Log(Parrent.Addr + "=> Autorun start...");
                     if (f_run is FileScriptX)
                     {
                         if (f_run.Body[0] == Parrent.Addr)
                         {
                             ResponseData data = (f_run as FileScriptX).Run(this);
                             if ((bool)data.Data[0])
                             {
                                 if (data.Data[2].ToString() == Parrent.Addr)
                                 {
                                     ServiceX nServ = data.Data[1] as ServiceX;
                                     if (Autorun != null)
                                     {
                                         Autorun(nServ, data.Data[2].ToString());
                                         this.ListFile.Remove(f_run);
                                         LOG.Log(Parrent.Addr + "=> File is deleted");
                                     }
                                 }
                                 else
                                 {
                                     LOG.Log(Parrent.Addr + "=> File is not Data to Computer");
                                 }
                             }
                         }
                         else
                         {
                             LOG.Log(Parrent.Addr + "=> File is not Data to Computer");
                         }
                     }
                     break;
                 }
             }
         }
     }
     isRun = true;
     Change?.Invoke();
     Parrent.Label.ServiceisOn();
 }
Ejemplo n.º 2
0
        public static GameScript LoadScenario(byte level)
        {
            Level = level;
            RePoint    point  = new RePoint();
            Lua        lua    = new Lua();
            GameScript result = new GameScript();

            try
            {
                lua["Point"] = point;
                lua.DoString(LoadLua.LoadScrpt("scen.d"));
                result = lua["game"] as GameScript;
                LOG.Log(string.Format("Load level: {0} - version: {1}", lua["name"], lua["version"]));
            }
            catch (LuaException ex) { LOG.Error(ex.Message); }
            catch (Exception ex) { LOG.Error(ex.Message); }
            return(result);
        }