Exemplo n.º 1
0
        /// <summary>
        /// Parses collection.db file.
        /// </summary>
        /// <param name="stream">Stream containing collection.db data.</param>
        /// <returns>A usable <see cref="CollectionDatabase"/>.</returns>
        public static CollectionDatabase DecodeCollection(Stream stream)
        {
            CollectionDatabase db = new CollectionDatabase();

            using (var r = new SerializationReader(stream))
            {
                db.OsuVersion = r.ReadInt32();
                int collectionsCount = r.ReadInt32();
                db.CollectionCount = collectionsCount;

                for (int i = 0; i < collectionsCount; i++)
                {
                    Collection collection = new Collection();

                    collection.Name = r.ReadString();
                    int count = r.ReadInt32();
                    collection.Count = count;

                    for (int j = 0; j < count; j++)
                    {
                        collection.MD5Hashes.Add(r.ReadString());
                    }

                    db.Collections.Add(collection);
                }
            }

            return(db);
        }
Exemplo n.º 2
0
 public CompassViewModel()
 {
     PlayerModels       = new ConcurrentDictionary <EntityId, UserEntity>();
     CollectionModels   = new ConcurrentDictionary <EntityId, CollectionEntity>();
     CurrentProcess     = Process.GetProcessesByName("tera").Single();
     CollectionDatabase = new CollectionDatabase();
     CameraScanner      = new CameraScanner(CurrentProcess);
     Task.Factory.StartNew(() => { CameraScanner.FindCameraAddress(); });
     PacketProcessor.Instance.EntityTracker.EntityUpdated  += EntityTracker_EntityUpdated;
     PacketProcessor.Instance.EntityTracker.EntityDeleted  += EntityTracker_EntityDeleted;
     PacketProcessor.Instance.EntityTracker.EntitysCleared += EntityTracker_EntitysCleared;
 }
 // Use this for initialization
 void Start()
 {
     speed  = 0.1f;
     radius = 0.3f;
     // characterController = GetComponent <CharacterController> ();
     animator = GetComponent <Animator> ();
     animator.SetBool("IsRoost", false);
     refObj = GameObject.Find("Database");
     effObj = GameObject.Find("Eff_Hit_1");
     effObj.gameObject.SetActive(false);
     database   = refObj.GetComponent <CollectionDatabase> ();
     collection = database.collection;
     if (collection == null)
     {
         Debug.Log("null");
     }
 }
Exemplo n.º 4
0
        public static void EncodeCollectionDatabase(string path, CollectionDatabase db)
        {
            using (SerializationWriter writer = new SerializationWriter(new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read)))
            {
                writer.Write(db.OsuVersion);
                writer.Write(db.CollectionCount);

                foreach (var collection in db.Collections)
                {
                    writer.Write(collection.Name);
                    writer.Write(collection.Count);

                    foreach (var hash in collection.MD5Hashes)
                    {
                        writer.Write(hash);
                    }
                }
            }
        }