Beispiel #1
0
        public DbOpFilterDrops(FFRKMySqlInstance Database)
        {
            mDatabase = Database;

            mItemTypes = new SelectMultiParam<SchemaConstants.ItemType, uint>("item_type");
            mRarities = new SelectMultiParam<SchemaConstants.Rarity, uint>("item_rarity");
            mSynergies = new SelectMultiParam<RealmSynergy.SynergyValue, uint>("item_series", (x) => x.GameSeries);
            mDungeons = new SelectMultiParam<uint, uint>("dungeon_id");
            mBattles = new SelectMultiParam<uint, uint>("battleid");
            mName = new SelectSingleParam<string>("item_name", SelectSingleParam<string>.ParamOperator.Like);

            mOnlyRepeatable = false;

            mDropList = new List<BasicItemDropStats>();
        }
Beispiel #2
0
        public DbOpFilterDrops(FFRKMySqlInstance Database)
        {
            mDatabase = Database;

            mItemTypes = new SelectMultiParam <SchemaConstants.ItemType, uint>("item_type");
            mRarities  = new SelectMultiParam <SchemaConstants.Rarity, uint>("item_rarity");
            mSynergies = new SelectMultiParam <RealmSynergy.SynergyValue, uint>("item_series", (x) => x.GameSeries);
            mDungeons  = new SelectMultiParam <uint, uint>("dungeon_id");
            mBattles   = new SelectMultiParam <uint, uint>("battleid");
            mName      = new SelectSingleParam <string>("item_name", SelectSingleParam <string> .ParamOperator.Like);

            mOnlyRepeatable = false;

            mDropList = new List <BasicItemDropStats>();
        }
Beispiel #3
0
 void mDatabaseInstance_OnSchemaError(FFRKMySqlInstance.ConnectResult ConnectResult)
 {
     mTabPage.BeginInvoke((Action)(() =>
         MessageBox.Show("FFRK Inspector has been updated.  Please download the latest release " +
                         "from https://github.com/cppisking/ffrk-inspector/releases.  Database " +
                         "connectivity will be unavailable for the remainder of this session.")));
 }
Beispiel #4
0
 void mDatabaseInstance_OnConnectionInitialized(FFRKMySqlInstance.ConnectResult Result)
 {
     switch (Result)
     {
         case FFRKMySqlInstance.ConnectResult.Success:
             PopulateDataCache();
             break;
         case FFRKMySqlInstance.ConnectResult.SchemaTooOld:
             mTabPage.BeginInvoke((Action)(() =>
                 MessageBox.Show(
                     "The database you are connected to is for an older version of FFRK " +
                     "Inspector.  Please point to a newer database instance.  Database " +
                     "connectivity will not be available for this session.",
                     "Database version mismatch")));
             break;
         case FFRKMySqlInstance.ConnectResult.SchemaTooNew:
             mTabPage.BeginInvoke((Action)(() =>
                 MessageBox.Show(
                     "FFRK Inspector is outdated and needs to be updated.  Please update " +
                     "to the latest version.  Database connectivity will not be available " +
                     "for this session.",
                     "Database version mismatch")));
             break;
     }
 }
Beispiel #5
0
        public void OnLoad()
        {
            LoadAppSettings();

            mInstance = this;
            mResponseHandlers = new List<IResponseHandler>();
            mResponseHandlers.Add(new HandleAppInitData());
            mResponseHandlers.Add(new HandlePartyList());
            mResponseHandlers.Add(new HandleListBattles());
            mResponseHandlers.Add(new HandleListDungeons());
            mResponseHandlers.Add(new HandleLeaveDungeon());
            mResponseHandlers.Add(new HandleInitiateBattle());
            mResponseHandlers.Add(new HandleGachaSeriesList());
            mResponseHandlers.Add(new HandleGachaSeriesDetails());
            mResponseHandlers.Add(new HandleCompleteBattle());

            mHistory = new ResponseHistory();
            mGameState = new GameState();

            // Do this first, because some of the form's OnLoad events register event handlers with it.
            mDatabaseInstance = new FFRKMySqlInstance();
            mCache = new FFRKDataCache();

            // Do this before initializing the connection, because when it's done we need to update the
            // UI.
            mTabPage = new TabPage("FFRK Inspector");
            mInspectorView = new FFRKTabInspector();
            mInspectorView.Dock = DockStyle.Fill;
            mTabPage.Controls.Add(mInspectorView);
            FiddlerApplication.UI.tabsViews.TabPages.Add(mTabPage);

            // Do this last
            mDatabaseInstance.OnConnectionInitialized += mDatabaseInstance_OnConnectionInitialized;
            mDatabaseInstance.OnSchemaError += mDatabaseInstance_OnSchemaError;
            mDatabaseInstance.InitializeConnection(MinimumRequiredSchema);
        }
 void Database_OnConnectionStateChanged(FFRKMySqlInstance.ConnectionState NewState)
 {
     if (IsHandleCreated)
         BeginInvoke((Action)(() => { toolStripStatusLabelConnection.Text = NewState.ToString(); }));
 }