Jump to content


Photo

Archiver: Threaded Compressor


  • Please log in to reply
17 replies to this topic

#1 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 22 April 2007 - 12:37 PM

The goal of this DLL is to combine multiple compressors into one DLL.

This is only the first version so it only supports .gz .bz and .zip for now.

The user is responsible to give credit and use the licenses of zlib (http://www.zlib.net/) and libbzip2 (http://www.bzip.org).

Example screen shot:
(link removed)

(link removed)

The functionality per format:

GZIP:
Threaded
Compress/Decompress
Get percentage completed
Get speed in bytes-per-second
Get size completed
Get elapsed time

BZIP:
Threaded
Compress/Decompress
Get percentage completed
Get speed in bytes-per-second
Get size completed
Get elapsed time

ZIP:
Threaded
Decompress
Get list of files in ZIP file
Get compressed/uncompressed size of found file
Get CRC32 of found file
Get comment of ZIP file
Get percentage completed
Get speed in bytes-per-second
Get size completed
Get elapsed time

Edited by h0bbel, 19 September 2013 - 06:54 PM.

  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#2 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 22 April 2007 - 01:11 PM

This is only the first version so it only supports .gz .bz and .zip for now.

The user is responsible to give credit and use the licenses of zlib (http://www.zlib.net/) and libbzip2 (http://www.bzip.org).

<{POST_SNAPBACK}>

.gz = http://www.zlib.net
.bz = http://www.bzip.org
.zip = don't have to credit

Is that correct understood?
  • 0

#3 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 22 April 2007 - 02:45 PM

This is only the first version so it only supports .gz .bz and .zip for now.

The user is responsible to give credit and use the licenses of zlib (http://www.zlib.net/) and libbzip2 (http://www.bzip.org).

<{POST_SNAPBACK}>

.gz = http://www.zlib.net
.bz = http://www.bzip.org
.zip = don't have to credit

Is that correct understood?

<{POST_SNAPBACK}>


When you use the DLL for no matter what you always have to credit both.
The libs are always used in the dll.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#4 Jax

Jax

    GMC Member

  • New Member
  • 232 posts

Posted 22 April 2007 - 03:03 PM

cool dll man B) but currently I don't have a use for this :)
  • 0

#5 ChIkEn AtE mY dOnUtS

ChIkEn AtE mY dOnUtS

    Pwner of barcodes

  • GMC Member
  • 2410 posts

Posted 22 April 2007 - 05:25 PM

Yay, my request was done! ^_^

Thanks man :P
  • 0
I've moved away from GM. If you want to contact me, feel free to email ryanwebdev@gmail.com.

Thanks,
Ryan.

#6 Meiun

Meiun

    GMC Member

  • New Member
  • 248 posts

Posted 22 April 2007 - 06:21 PM

Awesome work man! Your gonna be the best DLL producer on the GMC (in my mind atleast) if you keep this up. Finally a good compression DLL other than gm7zip ^^
  • 0

#7 ben_dover

ben_dover

    GMC Member

  • New Member
  • 174 posts

Posted 02 June 2007 - 04:22 PM

Hey, I've just swapped too your compression library and have found myself at a bit of a problem. I know how to check if something is finished de/compressing and continue, but I don't know how to wait until it's finished then do a specific action.

Could you help me out please?

Also with GZ_GetReady() it is a little confusing, just to clear my mind, are the following the same basically;
if (GZ_GetCompleted()=100){}
if (GZ_GetReady()=1){}

Thanks for reading.
  • 0

#8 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 02 June 2007 - 04:54 PM

Hey, I've just swapped too your compression library and have found myself at a bit of a problem. I know how to check if something is finished de/compressing and continue, but I don't know how to wait until it's finished then do a specific action.

Could you help me out please?

Also with GZ_GetReady() it is a little confusing, just to clear my mind, are the following the same basically;

if (GZ_GetCompleted()=100){}
if (GZ_GetReady()=1){}

Thanks for reading.

<{POST_SNAPBACK}>


When GZ_GetReady () returns 1 it's ready, that works the best.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#9 ben_dover

ben_dover

    GMC Member

  • New Member
  • 174 posts

Posted 03 June 2007 - 03:44 AM

Ok thanks for that. Could you help me a little further please? What I'm trying to do is zip a file that contains a hell of a lot of game data and send it from a server app to client's then have them decompress it and read. I just don't know how to write it properly.

clearbuffer()
writebyte(99);
GZ_Compress("save.f1", "farmsave", 9);
saveFile=fileopen("save.f1", 2);
fileSize=filesize(saveFile);
fileread(saveFile, fileSize);
with(obj_client)
{
if(id=player)
{
sendmessage(clientsocket);
}
}
fileclose(saveFile);
file_delete("farmsave");

But this does not work because the compression does not have enough time to finish. So how exactly do I program:
if compression is finsihed send file, if not then wait until it is finished then send file.

Thanks for your time mate.
  • 0

#10 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 03 June 2007 - 02:58 PM

in step event:
if GZ_GetReady()=1
{
// finished
}
  • 0

#11 ben_dover

ben_dover

    GMC Member

  • New Member
  • 174 posts

Posted 04 June 2007 - 12:00 PM

Ok thanks uuf6429, that took alot of work to implement in, I have to use a 2nd object now to handle the compression. (The original object was compressing in a step event (depending on the circumstances, it was a networking object).

h0bbel I got to the point where I almost went back to your older compression, where gzip and zlib were separate. But then I worked out my problem, I had forgot to initialise the DLL in my server program. :P It works great, 88kbytes of integers and |'s down to 4.57.

Cheers!
  • 0

#12 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 05 June 2007 - 11:23 AM

@ ben_dover - Glad it worked for you.
@ h0bbel - Glad this dll exists, I was trying my own from ground up. Yours is the best solution! Keep the good work.
  • 0

#13 dgm

dgm

    GMC Member

  • GMC Member
  • 80 posts

Posted 17 August 2007 - 11:59 AM

Any plans to add .zip compression?
  • 0

#14 acrog2

acrog2

    average user

  • GMC Member
  • 1118 posts

Posted 22 August 2007 - 06:59 PM

Is there functionality to make it compress a whole directory/folder? I could use some help.
  • 0

#15 shredded.carrot

shredded.carrot

    GMC Member

  • GMC Member
  • 77 posts

Posted 13 October 2007 - 01:05 AM

I am having trouble with it decompressing files. With the example I understand it probably only needs say one more line but what do I add?

Never mind I worked it out for myself

Edited by shredded.carrot, 13 October 2007 - 05:54 AM.

  • 0

#16 XD005

XD005

    Daxter (For PSP) Fan

  • GMC Member
  • 1285 posts

Posted 09 April 2009 - 06:03 AM

Decompressing is not working for me. I used WinRar to make the Zip but I don't think that should make a difference. Ok I've got this to load and extract the zip.

[codebox]UZ_Open (area);
UZ_ExtractFile("INFORMATION.di2",working_directory+string(global.gem_path)+"\INFORMATION.di2")
UZ_ExtractFile("AUDIO.mp3",working_directory+string(global.gem_path)+"\AUDIO.mp3")
UZ_ExtractFile("lighting.ls",working_directory+string(global.gem_path)+"\lighting.ls")
UZ_ExtractFile("GEMS.di2",working_directory+string(global.gem_path)+"\GEMS.di2")[/codebox]

Area is a variable that contains the path to the zip file btw. But when all that is executed, nothing happens. I've got this to let me know when it's done:

[codebox]draw_set_halign(fa_center)
draw_set_color(c_white)
draw_text(room_width/2,160,"Installing Song...")
draw_set_color(c_black)
draw_set_halign(fa_left)
draw_text(5,5,"Elapsed Time: " + string(time))
draw_healthbar(16,room_height/2,room_width-20,room_height/2+10,UZ_GetCompleted (),c_black,c_red,c_aqua,0,true,true)
[/codebox]

Absolutely nothing happens! I've included the DLL also. I've got no idea what else to do.
  • 0

#17 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 18 June 2009 - 11:02 AM

Wish you would fix the mass amount of bugs in your downloader =/.
Any chance this may gain support for 7z or arc?
  • 0

Posted Image


#18 Yamm

Yamm

    GMC Member

  • New Member
  • 4 posts

Posted 21 February 2011 - 05:33 PM

Hello!

I want to extract multiple files with the DLL, but have problems, as most files after unpacking 0 bytes. Can someone help me?

Create:
AC_Init();
global.meldung1 = "Download wird entpackt!";
UZ_Open(global.update);
File = UZ_FindFirstFile(); // First File
UZ_ExtractFile(File,File); // Extract first File

entpacken = true; // Exctract true

Step:

if entpacken = true {
if (File!=""){
        File = UZ_FindNextFile ();
        if (File!="")
        UZ_ExtractFile(File,File);
    }
}else{
    entpacken = false;
    alarm[1] = 30;
}

  • 0