示例#1
0
        public List <EmulatorProfile> GetProfiles(Game game)
        {
            if (!game.ParentEmulator.IsPc())
            {
                return(GetProfiles(game.ParentEmulator));
            }

            List <EmulatorProfile> profiles = new List <EmulatorProfile>();
            SQLiteResultSet        result   = Execute("SELECT * FROM {0} WHERE emulator_id=-1 AND game_id={1} ORDER BY defaultprofile DESC", EmulatorProfile.TABLE_NAME, game.GameID);

            if (result.Rows.Count > 0)
            {
                foreach (SQLiteResultSet.Row row in result.Rows)
                {
                    profiles.Add(EmulatorProfile.CreateProfile(row));
                }
            }
            else
            {
                profiles.Add(new EmulatorProfile(true)
                {
                    EmulatorID = -1, GameId = game.GameID, Arguments = game.Arguments, SuspendMP = true, UseQuotes = false, StopEmulationOnKey = false
                });
            }

            return(profiles);
        }
示例#2
0
        public List <EmulatorProfile> GetProfiles(Emulator emu)
        {
            List <EmulatorProfile> profiles = new List <EmulatorProfile>();

            if (emu.UID == -1)
            {
                profiles.Add(new EmulatorProfile(true)
                {
                    EmulatorID = -1
                });
                return(profiles);
            }

            SQLiteResultSet result = Execute("SELECT * FROM {0} WHERE emulator_id={1} ORDER BY defaultprofile DESC", EmulatorProfile.TABLE_NAME, emu.UID);

            foreach (SQLiteResultSet.Row row in result.Rows)
            {
                profiles.Add(EmulatorProfile.CreateProfile(row));
            }
            return(profiles);
        }
示例#3
0
        public EmulatorProfile GetProfile(int id, Emulator parentEmu)
        {
            if (parentEmu.UID < 0)
            {
                return new EmulatorProfile(true)
                       {
                           EmulatorID = -1
                       }
            }
            ;
            SQLiteResultSet result;

            if (id > -1)
            {
                result = Execute("SELECT * FROM {0} WHERE uid={1} AND emulator_id={2}", EmulatorProfile.TABLE_NAME, id, parentEmu.UID);

                if (result.Rows.Count > 0)
                {
                    return(EmulatorProfile.CreateProfile(result.Rows[0]));
                }
            }
            else
            {
                result = Execute("SELECT * FROM {0} WHERE emulator_id={1} AND defaultprofile='True'", EmulatorProfile.TABLE_NAME, parentEmu.UID);
                if (result.Rows.Count > 0)
                {
                    return(EmulatorProfile.CreateProfile(result.Rows[0]));
                }
            }

            List <EmulatorProfile> profiles = GetProfiles(parentEmu);

            if (profiles.Count > 0)
            {
                return(profiles[0]);
            }

            Logger.LogError("No profiles found for {0}, database corrupt", parentEmu.Title);
            return(null);
        }
示例#4
0
        public EmulatorProfile GetProfile(Game game)
        {
            if (!game.ParentEmulator.IsPc())
            {
                return(GetProfile(game.SelectedProfileId, game.ParentEmulator));
            }

            SQLiteResultSet result = Execute("SELECT * FROM {0} WHERE uid={1} AND game_id={2}", EmulatorProfile.TABLE_NAME, game.SelectedProfileId, game.GameID);

            if (result.Rows.Count > 0)
            {
                return(EmulatorProfile.CreateProfile(result.Rows[0]));
            }

            List <EmulatorProfile> profiles = GetProfiles(game);

            if (profiles.Count > 0)
            {
                return(profiles[0]);
            }

            Logger.LogError("No profiles found for {0}, database corrupt", game.Title);
            return(null);
        }