Esempio n. 1
0
        public OsuDb(string path)
        {
            OsuReader or = new OsuReader(new FileStream(path, FileMode.Open));

            ReadFromStream(or);
            or.Close();
        }
Esempio n. 2
0
 public void ReadFromStream(OsuReader o)
 {
     try
     {
         Version         = o.ReadInt32();
         FolderCount     = o.ReadInt32();
         AccountUnlocked = o.ReadBoolean();
         UnlockDate      = o.ReadDateTime();
         PlayerName      = o.ReadString();
         int numberOfBeatmaps = o.ReadInt32();
         Beatmaps = new List <Beatmap>();
         for (int i = 0; i < numberOfBeatmaps; i++)
         {
             Beatmaps.Add(new Beatmap(o, Version));
         }
         UserPermission = (UserPermission)o.ReadInt32();
     }
     catch (Exception e)
     {
         if (e.GetType() == typeof(InvalidDataException))
         {
             throw;
         }
         else
         {
             throw new InvalidDataException("Invalid data", e);
         }
     }
 }
Esempio n. 3
0
        public void ReadFromStream(OsuReader o)
        {
            Name = o.ReadString();
            int numberOfBeatmaps = o.ReadInt32();

            MD5s = new List <string>();
            for (int i = 0; i < numberOfBeatmaps; i++)
            {
                MD5s.Add(o.ReadString());
            }
        }
Esempio n. 4
0
 public void ReadFromStream(OsuReader o)
 {
     PlayerId = o.ReadInt32();
     Name     = o.ReadString();
     Country1 = o.ReadByte();
     Country2 = o.ReadByte();
     Unknown  = o.ReadByte();
     Unknown2 = o.ReadInt64();
     Rank     = o.ReadInt32();
     Unknown3 = o.ReadInt64();
 }
        public void ReadFromStream(OsuReader o)
        {
            MD5 = o.ReadString();
            int numberOfScores = o.ReadInt32();

            Scores = new List <Score>();
            for (int i = 0; i < numberOfScores; i++)
            {
                Scores.Add(new Score(o));
            }
        }
Esempio n. 6
0
 public void ReadFromStream(OsuReader o)
 {
     try
     {
         Version = o.ReadInt32();
         int numberOfBeatmaps = o.ReadInt32();
         Beatmaps = new List <BeatmapScores>();
         for (int i = 0; i < numberOfBeatmaps; i++)
         {
             Beatmaps.Add(new BeatmapScores(o));
         }
     }
     catch (Exception e)
     {
         if (e.GetType() == typeof(InvalidDataException))
         {
             throw;
         }
         else
         {
             throw new InvalidDataException("Invalid data", e);
         }
     }
 }
Esempio n. 7
0
 public void ReadFromStream(OsuReader o)
 {
     try
     {
         Version = o.ReadInt32();
         int amount = o.ReadInt32();
         People = new List <Person>();
         for (int i = 0; i < amount; i++)
         {
             People.Add(new Person(o));
         }
     }
     catch (Exception e)
     {
         if (e.GetType() == typeof(InvalidDataException))
         {
             throw;
         }
         else
         {
             throw new InvalidDataException("Invalid data", e);
         }
     }
 }
Esempio n. 8
0
 public void ReadFromStream(OsuReader o)
 {
     Mode              = (Mode)o.ReadByte();
     Version           = o.ReadInt32();
     BeatmapMD5        = o.ReadString();
     PlayerName        = o.ReadString();
     ReplayMD5         = o.ReadString();
     NumberOfHitValue1 = o.ReadInt16();
     NumberOfHitValue2 = o.ReadInt16();
     NumberOfHitValue3 = o.ReadInt16();
     NumberOfHitValue4 = o.ReadInt16();
     NumberOfHitValue5 = o.ReadInt16();
     NumberOfMisses    = o.ReadInt16();
     ReplayScore       = o.ReadInt32();
     MaxCombo          = o.ReadInt16();
     PerfectCombo      = o.ReadBoolean();
     Mods              = (Mods)o.ReadInt32();
     // string: should always be empty
     o.AssertStringIsNullOrEmpty("Score: String isn't null or empty");
     Timestamp = o.ReadInt64();
     // int Constant, should always be 0xffffffff (-1)
     o.AssertInt(-1, "Score: int is not -1");
     OnlineScoreID = o.ReadInt64();
 }
Esempio n. 9
0
 public void ReadFromStream(OsuReader o)
 {
     try
     {
         Version = o.ReadInt32();
         int numberOfCollections = o.ReadInt32();
         Collections = new List <Collection>();
         for (int i = 0; i < numberOfCollections; i++)
         {
             Collections.Add(new Collection(o));
         }
     }
     catch (Exception e)
     {
         if (e.GetType() == typeof(InvalidDataException))
         {
             throw;
         }
         else
         {
             throw new InvalidDataException("Invalid data", e);
         }
     }
 }
Esempio n. 10
0
 public CollectionDb(OsuReader o)
 {
     ReadFromStream(o);
 }
 public BeatmapScores(OsuReader o)
 {
     ReadFromStream(o);
 }
Esempio n. 12
0
 public Beatmap(OsuReader o, int version)
 {
     ReadFromStream(o, version);
 }
Esempio n. 13
0
        }                                          // TODO: 8 unknown bytes

        public Person(OsuReader o)
        {
            ReadFromStream(o);
        }
Esempio n. 14
0
        public void ReadFromStream(OsuReader o, int version)
        {
            Version = version;

            SizeInBytes        = o.ReadInt32();
            ArtistName         = o.ReadString();
            ArtistNameUnicode  = o.ReadString();
            SongTitle          = o.ReadString();
            SongTitleUnicode   = o.ReadString();
            CreatorName        = o.ReadString();
            Difficulty         = o.ReadString();
            AudioFileName      = o.ReadString();
            MD5Beatmap         = o.ReadString();
            NameDotOsuFile     = o.ReadString();
            RankedStatus       = (RankedStatus)o.ReadByte();
            NumberOfHitcircles = o.ReadInt16();
            NumberOfSliders    = o.ReadInt16();
            NumberOfSpinners   = o.ReadInt16();
            ModificationTime   = new DateTime(o.ReadInt64());

            // next 4 are bytes for versions smaller than 20140609
            if (version >= 20140609)
            {
                ApproacRate       = o.ReadSingle();
                CircleSize        = o.ReadSingle();
                HPDrain           = o.ReadSingle();
                OverallDifficulty = o.ReadSingle();
            }
            else
            {
                ApproacRateB       = o.ReadByte();
                CircleSizeB        = o.ReadByte();
                HPDrainB           = o.ReadByte();
                OverallDifficultyB = o.ReadByte();
            }

            SliderVelocity = o.ReadDouble();

            // next part only present if version greater or equal to 20140609
            if (version >= 20140609)
            {
                int amountOfPairsStandard = o.ReadInt32();
                PairsStandard = new List <ModsDoublePair>();
                for (int i = 0; i < amountOfPairsStandard; i++)
                {
                    PairsStandard.Add(o.ReadIntDoublePair());
                }
                int amountOfPairsTaiko = o.ReadInt32();
                PairsTaiko = new List <ModsDoublePair>();
                for (int i = 0; i < amountOfPairsTaiko; i++)
                {
                    PairsTaiko.Add(o.ReadIntDoublePair());
                }
                int amountOfPairsCTB = o.ReadInt32();
                PairsCTB = new List <ModsDoublePair>();
                for (int i = 0; i < amountOfPairsCTB; i++)
                {
                    PairsCTB.Add(o.ReadIntDoublePair());
                }
                int amountOfPairsMania = o.ReadInt32();
                PairsMania = new List <ModsDoublePair>();
                for (int i = 0; i < amountOfPairsMania; i++)
                {
                    PairsMania.Add(o.ReadIntDoublePair());
                }
            }

            DrainTime     = o.ReadInt32();
            TotalTime     = o.ReadInt32();
            TimeOfPreview = o.ReadInt32();
            int amountOfTimingPoints = o.ReadInt32();

            TimingPoints = new List <Timingpoint>();
            for (int i = 0; i < amountOfTimingPoints; i++)
            {
                TimingPoints.Add(o.ReadTimingpoint());
            }
            BeatmapID             = o.ReadInt32();
            BeatmapSetID          = o.ReadInt32();
            ThreadID              = o.ReadInt32();
            GradeAchievedStandard = (Grade)o.ReadByte();
            GradeAchievedTaiko    = (Grade)o.ReadByte();
            GradeAchievedCTB      = (Grade)o.ReadByte();
            GradeAchievedMania    = (Grade)o.ReadByte();
            LocalBeatmapOffset    = o.ReadInt16();
            StackLeniency         = o.ReadSingle();
            GameplayMode          = (Mode)o.ReadByte();
            SongSource            = o.ReadString();
            SongTags              = o.ReadString();
            OnlineOffset          = o.ReadInt16();
            Font               = o.ReadString();
            Unplayed           = o.ReadBoolean();
            LastTimePlayed     = o.ReadInt64();
            Osz2               = o.ReadBoolean();
            FolderName         = o.ReadString();
            LastTimeChecked    = o.ReadInt64();
            IgnoreBeatmapSound = o.ReadBoolean();
            IgnoreBeatmapSkin  = o.ReadBoolean();
            DisableStoryboard  = o.ReadBoolean();
            DisableVideo       = o.ReadBoolean();
            VisualOverride     = o.ReadBoolean();

            // unknown short, only present if version less than 20140609
            if (version < 20140609)
            {
                Unknown = o.ReadInt16();
            }

            LastModificationTime = o.ReadInt32();
            ManiaScrollSpeed     = o.ReadByte();

            if (BeatmapSetID == 101796)
            {
            }
        }
Esempio n. 15
0
 public ScoresDb(OsuReader o)
 {
     ReadFromStream(o);
 }
Esempio n. 16
0
 public OsuDb(OsuReader o)
 {
     ReadFromStream(o);
 }
Esempio n. 17
0
 public PresenceDb(OsuReader o)
 {
     ReadFromStream(o);
 }