Raised This Month: $32 Target: $400
 8% 

Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 04-22-2010 , 23:26   Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #1

First, Hi, I make this, But I don't test. I have to Sleep Now, So I Upload if someone want to test.

I Fix some errors an I add an example.

PHP Code:
/*
 * (C) Copyright 2010 Ramón 'Reymon' Berrutti <[email protected]>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * See LICENSE.TXT file for more information.
 *
 */
 #if defined _AmxxZip_included
    #endinput
#endif
#define _AmxxZip_included
 
 
#if AMXX_VERSION_NUM >= 175
    #pragma reqlib AmxxZip
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib AmxxZip
    #endif
#else
    #pragma library AmxxZip
#endif

enum ZipItemInfo
{
    
ZipItem_Index 0,
    
ZipItem_Attr,
    
ZipItem_Atime,
    
ZipItem_Ctime,
    
ZipItem_Mtime,
    
ZipItem_CompSize,
    
ZipItem_UncompSize
};


native AmxxZip:RB_CreateZip( const filename[], const password[] = "" );
native RB_ZipAddAmxxZip:Handle, const filename[], const zipfile[] );

native AmxxZip:RB_OpenZip( const filename[], const password[] = "" );
native RB_GetZipItemAmxxZip:HandleindexZipItemInfo:var, &ret );
native RB_GetZipItemNameAmxxZip:Handleindexoutputname[], len );
native RB_FindZipItemAmxxZip:Handle, const name[], bool:sensitive, &ret );
native RB_UnzipItemAmxxZip:Handleindex, const pathfilename[] );
native RB_SetUnzipBaseDirAmxxZip:Handle, const path );

native RB_CloseZipAmxxZip:Handle ); 
Credits: http://www.wischik.com/lu/programmer/zip_utils.html
Attached Files
File Type: dll AmxxZip_amxx.dll (137.5 KB, 210 views)
File Type: so AmxxZip_amxx_i386.so (116.6 KB, 185 views)
File Type: zip AmxxZip_Source.zip (124.8 KB, 287 views)
__________________

Last edited by AntiBots; 04-23-2010 at 15:38.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 04-24-2010 , 07:47   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [Fixed]
Reply With Quote #2

wtf is this explain man "description" !
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 04-24-2010 , 09:08   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [Fixed]
Reply With Quote #3

Quote:
Originally Posted by DIREKTOR View Post
wtf is this explain man "description" !
I think it's pretty obvious. It exports archiving capabilities to AMXx....
Use this to compress/decompress ZIP files in your server.
Seta00 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 04-24-2010 , 13:58   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [Fixed]
Reply With Quote #4

I found more bugs. I will fix today. I am having problem with:
RB_SetUnzipBaseDir

Wait plis.
I also fix some other error but I don't have time to upload the new version. So, Wait an not use this bug version.
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-24-2010 , 18:09   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #5

I don't see how this would be practical in any situation in HL games.
__________________
fysiks is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 04-25-2010 , 02:54   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
I don't see how this would be practical in any situation in HL games.
My server logs constantly, every 100 I zip them all up to save on space.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 04-25-2010 , 09:23   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #7

Quote:
Originally Posted by Drak View Post
My server logs constantly, every 100 I zip them all up to save on space.
But if the zip creation is not made using threads it will block other calls when using over big files.

In that case, it should be done at map load, intermission, etc.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-25-2010 , 13:14   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #8

Quote:
Originally Posted by Drak View Post
My server logs constantly, every 100 I zip them all up to save on space.
I never thought of that. But the question is, is the compression ratio large enough to make a dent in the HD usage when you have many log files?
__________________
fysiks is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 04-25-2010 , 15:11   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
I never thought of that. But the question is, is the compression ratio large enough to make a dent in the HD usage when you have many log files?
No, it's just more convenient. Since it will label them by date. Instead of searching through many log files.
But joropito has a point. Without it being called in a thread, if I were to zip any bigger files, it will interrupt gameplay.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
stupok
Veteran Member
Join Date: Feb 2006
Old 04-25-2010 , 15:16   Re: Module: AmxxZip ( Compress & UnCompress .Zip ) [UnFixed]
Reply With Quote #10

@fysiks
It depends on the algorithm and how much time you want to spend compressing.

You can expect something like 2:1 or 3:1 compression.

Some links here: http://answers.google.com/answers/th...id/749492.html
__________________
stupok is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode