Esempio n. 1
0
        /// <summary>
        /// Performs a reboot of the system
        /// </summary>
        /// <param name="bootFlag"></param>
        public static void Reboot(BootFlag bootFlag)
        {
            switch (bootFlag)
            {
            case BootFlag.cold:
                xboxDebug.Reboot(YeloDebug.BootFlag.Cold);
                break;

            case BootFlag.warm:
                xboxDebug.Reboot(YeloDebug.BootFlag.Warm);
                break;
            }
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Active"></param>
 /// <param name="Begin"></param>
 /// <param name="Type"></param>
 /// <param name="End"></param>
 /// <param name="Start"></param>
 /// <param name="Length"></param>
 public Partition(BootFlag Active, CHS Begin, PartitionType Type, CHS End, LBA4 Start, LBA4 Length)
 => (this.Active, this.Begin, this.Type, this.End, this.Start, this.Length)
Esempio n. 3
0
 /// <summary>
 /// Reboots the xbox with the specified BootFlag.
 /// </summary>
 /// <param name="flag"></param>
 public void Reboot(BootFlag flag)
 {
     switch (flag)
     {
         case BootFlag.Cold:		SendCommand("reboot");			break;
         case BootFlag.Warm:		SendCommand("reboot warm");		break;
         case BootFlag.NoDebug:	SendCommand("reboot nodebug");	break;
         case BootFlag.Wait:		SendCommand("reboot wait");		break;
         case BootFlag.Stop:		SendCommand("reboot stop");		break;
         case BootFlag.Current:
             FlushSocketBuffer();
             connection.Client.Send(ASCIIEncoding.ASCII.GetBytes("magicboot title=\"" + XbeInfo.LaunchPath + "\" debug" + Environment.NewLine));
             if (connection.Available > 0)
                 connection.Client.Receive(new byte[connection.Available]);
             break;
     }
     Reconnect(15000);
 }
Esempio n. 4
0
 /// <summary>
 /// Performs a reboot of the system
 /// </summary>
 /// <param name="bootFlag"></param>
 public static void Reboot(BootFlag bootFlag)
 {
     switch (bootFlag)
     {
         case BootFlag.cold:
             xboxDebug.Reboot(YeloDebug.BootFlag.Cold);
             break;
         case BootFlag.warm:
             xboxDebug.Reboot(YeloDebug.BootFlag.Warm);
             break;
     }
 }
Esempio n. 5
0
		public void DmReboot(BootFlag flags, string xbe)
		{
			string wait = "";
			if ((flags & BootFlag.Stop) != 0) wait = " Stop";
			else if ((flags & BootFlag.Wait) != 0) wait = " Wait";

			string warm = (flags & BootFlag.Warm) != 0 ? " Warm" : "";
			string nodebug = (flags & BootFlag.NoDebug) != 0 ? " NoDebug" : "";

			if (string.IsNullOrEmpty(xbe))
				SendCommand("reboot{0}{1}{2}", wait, warm, nodebug);
			else
				SendCommand("magicboot title={0}{1}", xbe, nodebug != "" ? nodebug : " Debug");

			Thread.Sleep(25);

			if ((flags & BootFlag.NoDebug) == 0)
				Reconnect(15000);
			else
			{
				Disconnect();
				throw new ApiException("Xbox has been shut down with NoDebug");
			}
		}
Esempio n. 6
0
        /// <summary>
        /// 设置应用程序,如在过程中发生异常则重启并提醒!
        /// </summary>
        public static void Init(BootFlag flag, String confPath)
        {
            BeforeInit();
            if (!IsInstalled())
            {
                return;
            }
            //初始化目录
            ChkCreate(CmsVariables.TEMP_PATH);
            // 加载配置
            Configuration.LoadCmsConfig(confPath);
            //设置数据库
            CmsDataBase.Initialize(String.Format("{0}://{1}", Settings.DB_TYPE.ToString(),
                                                 Settings.DB_CONN.ToString()), Settings.DB_PREFIX, Settings.SQL_PROFILE_TRACE);
            //清空临时文件
            //resetTempFiles();
            // 初始化键值存储
            InitKvDb();
            // 加载其他配置
            LoadOtherConfig();
            //获取静态服务器
            //UpdateServerInfo();

            // 正常模式启动
            if ((flag & BootFlag.Normal) != 0)
            {
                _buildSet = new CustomBuildSet();

                //
                //TODO:
                //
                //检查网站激活状态
                //SoftwareActivator.VerifyActivation();
                //如果不存在模板文件夹,则创建目录
                if (!Directory.Exists(Cms.PyhicPath + "templates/"))
                {
                    Directory.CreateDirectory(Cms.PyhicPath + "templates/").Create();
                    //暂时网络安装默认模板(后可使用资源代替)
                    Updater.InstallTemplate("default", "tpl_default.zip");
                }
                _templateManager = new TemplateManager(Cms.PyhicPath + CmsVariables.TEMPLATE_PATH);

                // 注册模板
                Template.Register("/" + CmsVariables.TEMPLATE_PATH, true);
                // 注册插件
                //PluginConfig.PLUGIN_FILE_PARTTERN = "*.dll,*.so";
                PluginConfig.PLUGIN_DIRECTORY         = CmsVariables.PLUGIN_PATH;
                PluginConfig.PLUGIN_TMP_DIRECTORY     = CmsVariables.TEMP_PATH + "plugin/";
                PluginConfig.PLUGIN_LOG_OPENED        = true;
                PluginConfig.PLUGIN_LOG_EXCEPT_FORMAT = "** {time} **:{message}\r\nSource:{source}\r\nAddress:{addr}\r\nStack:{stack}\r\n\r\n";
                string pluginPhysicPath = Cms.PyhicPath + PluginConfig.PLUGIN_TMP_DIRECTORY;
                if (!Directory.Exists(pluginPhysicPath))
                {
                    Directory.CreateDirectory(pluginPhysicPath).Create();
                }
                // 连接插件
                CmsPluginContext.Connect();

                // 设置验证码字体
                VerifyCodeGenerator.SetFontFamily(Cms.PyhicPath + CmsVariables.FRAMEWORK_ASSETS_PATH + "fonts/comic.ttf");
            }
            if (OnInit != null)
            {
                Cms.OnInit();
            }

            IsInitFinish = true;
        }