Raised This Month: $ Target: $400
 0% 

client check if file exist (force consistency method) need C++ readers to read code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 02-28-2009 , 07:23   client check if file exist (force consistency method) need C++ readers to read code
Reply With Quote #1

hlguard checks .mdl files and if they are not standart hlguard kick player, my question is how to do such thing? and can it just check if file is there or not?
Owyn is offline
Send a message via ICQ to Owyn
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-28-2009 , 08:03   Re: client file check (file force consistency (like in hlguard for .mdl files)) how?
Reply With Quote #2

Use soundcheck (metamod plugin ) or that ( amxx plugin )
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 02-28-2009 , 08:27   Re: client file check (file force consistency (like in hlguard for .mdl files)) how?
Reply With Quote #3

thx, i found some amxx functions like force_unmodified(), but i was talking about simple check if file exist

i looked into amxx code and found function for forcing consistency


Code:
static cell AMX_NATIVE_CALL force_unmodified(AMX *amx, cell *params)
{
    int a;
    
    cell *cpVec1 = get_amxaddr(amx, params[2]);
    cell *cpVec2 = get_amxaddr(amx, params[3]);
    
    Vector vec1 = Vector((float)cpVec1[0], (float)cpVec1[1], (float)cpVec1[2]);
    Vector vec2 = Vector((float)cpVec2[0], (float)cpVec2[1], (float)cpVec2[2]);
    
    char* filename = get_amxstring(amx, params[4], 0, a);

    ForceObject* aaa = new ForceObject(filename, (FORCE_TYPE)((int)(params[1])), vec1, vec2, amx);

    if (aaa)
    {
        if (stristr(filename, ".wav"))
            g_forcesounds.put(aaa);
        else if (stristr(filename, ".mdl"))
            g_forcemodels.put(aaa);
        else
            g_forcegeneric.put(aaa);

        return 1;
    }

    return 0;
}


class ForceObject
{
    String filename;
    FORCE_TYPE type;
    Vector mins;
    Vector maxs;
    AMX* amx;
public:
    ForceObject(const char* n, FORCE_TYPE c, Vector& mi, Vector& ma, AMX* a) : filename(n), type(c), mins(mi), maxs(ma), amx(a) {}

    inline const char* getFilename() { return filename.c_str(); }
    inline AMX* getAMX() { return amx; }
    
    Vector& getMin() { return mins; }
    Vector& getMax() { return maxs; }
    
    inline FORCE_TYPE getForceType() { return type; }
};
*will appreciate any help
with force_unmodified() you can check any files and it works perfectly, so it gets crc32 from client file then it gets crc32 from server file and compares them, in my case i need to stop at getting crc32 for client file and know if file exist but amxx source looks so confusing =\

Last edited by Owyn; 03-02-2009 at 15:12.
Owyn is offline
Send a message via ICQ to Owyn
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 03-16-2009 , 22:01   Re: client check if file exist (force consistency method) need C++ readers to read co
Reply With Quote #4

Quote:
Originally Posted by .Owyn.
with force_unmodified() you can check any files and it works perfectly, so it gets crc32 from client file then it gets crc32 from server file and compares them, in my case i need to stop at getting crc32 for client file and know if file exist but amxx source looks so confusing =\
I believe the CRC checking part is entirely handled by the engine, so likely there is no way of finding out whether a player has a certain file or not via AMXX.
__________________
MeRcyLeZZ is offline
pike
Junior Member
Join Date: Jun 2009
Old 07-16-2009 , 23:10   Re: client check if file exist (force consistency method) need C++ readers to read co
Reply With Quote #5

Quote:
Originally Posted by MeRcyLeZZ View Post
I believe the CRC checking part is entirely handled by the engine, so likely there is no way of finding out whether a player has a certain file or not via AMXX.
but if do checking for presence exactly such file as on server ?
pike 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 17:01.


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