예제 #1
0
        public static MPQFile FromHandle(IntPtr handle)
        {
            if (handle == IntPtr.Zero)
            {
                return(null);
            }

            MPQFile ret = new MPQFile();

            ret.Load(handle);
            ret.FileName = "";
            return(ret);
        }
예제 #2
0
        public string[] GetFiles()
        {
            IntPtr lf  = IntPtr.Zero;
            bool   ret = MPQArchiveLoader.SFileOpenFileEx(mHandle, "(listfile)", 0, ref lf);

            if (ret == false)
            {
                return new string[] { }
            }
            ;

            MPQFile file = new MPQFile();

            file.Load(lf);
            var    bytes   = file.Read(file.FileSize);
            string fullStr = Encoding.UTF8.GetString(bytes);

            return(fullStr.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries));
        }