public void CQStartup(object sender, CQStartupEventArgs e)
        {
            CQSave.cq_start     = e;
            CQSave.AppDirectory = e.CQApi.AppDirectory;
            if (!File.Exists($@"{e.CQApi.AppDirectory}装备卡\框\抽卡背景.png"))
            {
                e.CQLog.Warning("错误", "数据包未安装,插件无法运行,请仔细阅读论坛插件说明安装数据包,之后重启酷Q");
            }
            else
            {
                if (!File.Exists($@"{e.CQApi.AppDirectory}data.db"))
                {
                    Event_GroupMessage.CreateDB($@"{e.CQApi.AppDirectory}data.db");
                    e.CQLog.WriteLine(Native.Sdk.Cqp.Enum.CQLogLevel.Info, "已创建数据库");
                }
                else
                {
                    FileInfo info = new FileInfo($@"{e.CQApi.AppDirectory}data.db");
                    if (info.Length == 0)
                    {
                        File.Delete($@"{e.CQApi.AppDirectory}data.db");
                        Event_GroupMessage.CreateDB($@"{e.CQApi.AppDirectory}data.db");
                        e.CQLog.WriteLine(Native.Sdk.Cqp.Enum.CQLogLevel.Info, "已创建数据库");
                        goto jumpout;
                    }
                    Event_GroupMessage.CheckDB($@"{e.CQApi.AppDirectory}data.db", e);
                }
            }
jumpout:
            cq = e;
            CQSave.cq_start = e;
        }
Example #2
0
 public void CQStartup(object sender, CQStartupEventArgs e)
 {
     cq = e;
     CQSave.cq_start = e;
     if (!File.Exists($@"{e.CQApi.AppDirectory}data.db"))
     {
         Event_GroupMessage.CreateDB($@"{e.CQApi.AppDirectory}data.db");
         e.CQLog.WriteLine(Native.Csharp.Sdk.Cqp.Enum.CQLogLevel.Info, "已创建数据库");
     }
 }
Example #3
0
        public void CQStartup(object sender, CQStartupEventArgs e)
        {
            try
            {
                CQSave.cq_start       = e;
                CQSave.AppDirectory   = e.CQApi.AppDirectory;
                CQSave.ImageDirectory = GetAppImageDirectory();
                CQSave.CQLog          = e.CQLog;
                CQSave.CQApi          = e.CQApi;
                ini = new IniConfig(e.CQApi.AppDirectory + "Config.ini");
                ini.Load();
                string temp = ini.Object["OCR"]["app_id"].GetValueOrDefault("");
                if (temp == "")
                {
                    ini.Object["OCR"]["app_id"]  = new IValue("");
                    ini.Object["OCR"]["app_key"] = new IValue("");
                }
                ini.Save();

                if (!File.Exists($@"{e.CQApi.AppDirectory}装备卡\框\抽卡背景.png"))
                {
                    e.CQLog.Warning("错误", "数据包未安装,插件无法运行,请仔细阅读论坛插件说明安装数据包,之后重启酷Q");
                }
                else
                {
                    if (!File.Exists($@"{e.CQApi.AppDirectory}data.db"))
                    {
                        Event_GroupMessage.CreateDB($@"{e.CQApi.AppDirectory}data.db");
                        e.CQLog.WriteLine(Native.Sdk.Cqp.Enum.CQLogLevel.Info, "已创建数据库");
                    }
                    else
                    {
                        FileInfo info = new FileInfo($@"{e.CQApi.AppDirectory}data.db");
                        if (info.Length == 0)
                        {
                            File.Delete($@"{e.CQApi.AppDirectory}data.db");
                            Event_GroupMessage.CreateDB($@"{e.CQApi.AppDirectory}data.db");
                            e.CQLog.WriteLine(Native.Sdk.Cqp.Enum.CQLogLevel.Info, "已创建数据库");
                            return;
                        }
                        Event_GroupMessage.CheckDB($@"{e.CQApi.AppDirectory}data.db", e);
                    }
                }
                AbyssTimerHelper.Start();
            }
            catch (Exception exc)
            {
                e.CQLog.Info("Error", exc.Message, exc.StackTrace);
            }
        }