Raised This Month: $ Target: $400
 0% 

[CS:S] Timer 1.0.7


Post New Thread Reply   
 
Thread Tools Display Modes
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-03-2013 , 09:25   Re: [CS:S] Timer 1.0.7
Reply With Quote #591

[CSS/CSGO] Anti Strafe Hack

I hope you enjoy this module
__________________
zipcore is offline
Himynamesaustin
Member
Join Date: Nov 2013
Old 12-08-2013 , 00:12   Re: [CS:S] Timer 1.0.7
Reply With Quote #592

Anyone having an issue that after 1000+ records the world records dont come up anymore?
Himynamesaustin is offline
Glite
Senior Member
Join Date: Sep 2011
Location: Ukraine
Old 12-08-2013 , 04:51   Re: [CS:S] Timer 1.0.7
Reply With Quote #593

There is a hardcoded maximum for record cache (1000).
Glite is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-08-2013 , 06:48   Re: [CS:S] Timer 1.0.7
Reply With Quote #594

Quote:
Originally Posted by Glite View Post
There is a hardcoded maximum for record cache (1000).
Just recompile and increase this limit. My timers cache is much bigger "new g_cache[MAX_MODES][MAX_BONUS][MAX_CACHE][RecordCache]"

CHANGE NEEDED: (timer-worldrecord.sp)
PHP Code:
new g_cache[1024][RecordCache];

to

new g_cache[5000][RecordCache];

AND

FormatEx(sQuerysizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name, MAX(m.flashbangs) flashbangs FROM round AS m INNER JOIN (SELECT MIN(n.time) time, n.auth FROM round n WHERE n.map = '%s' GROUP BY n.physicsdifficulty, n.auth) AS j ON (j.time = m.time AND j.auth = m.auth) WHERE m.map = '%s' GROUP BY m.physicsdifficulty, m.auth ORDER BY m.time ASC LIMIT 0, 1000"g_sCurrentMapg_sCurrentMap);   

to

FormatEx
(sQuerysizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name, MAX(m.flashbangs) flashbangs FROM round AS m INNER JOIN (SELECT MIN(n.time) time, n.auth FROM round n WHERE n.map = '%s' GROUP BY n.physicsdifficulty, n.auth) AS j ON (j.time = m.time AND j.auth = m.auth) WHERE m.map = '%s' GROUP BY m.physicsdifficulty, m.auth ORDER BY m.time ASC LIMIT 0, 5000"g_sCurrentMapg_sCurrentMap); 
__________________

Last edited by zipcore; 12-08-2013 at 06:51.
zipcore is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-08-2013 , 13:45   Re: [CS:S] Timer 1.0.7
Reply With Quote #595

I think that the record saving in this plugin should be updated and be threaded, or atleast fix that every map finish is being saved to database. I tried doing it by doing some checks with bOverwrite, but seems that if you don't get a better time in SW for example than your normal mode time, it will be counted as not overwrote and I can't get it to save SW/W only records because of that.

Edit: Fixed it.
Code:
FinishRound(client, const String:map[], Float:time, jumps, flashbangs, physicsDifficulty, fpsmax)
{
    if(!IsClientInGame(client) || !IsPlayerAlive(client) || IsFakeClient(client))
    {
        return;
    }
    
    new Float:fLastTime;
    new iLastJumps, iLastFlashbangs, iLastFps;
    decl String:sTimeDiff[32], String:sBuffer[32];
    new bool:bOverwrite = false;
    
    Timer_GetBestRecord(client, map, physicsDifficulty, fLastTime, iLastJumps, iLastFps, iLastFlashbangs);
    
    SQL_LockDatabase(g_hSQL);
    
    decl String:sAuthID[MAX_AUTHID_LENGTH];
    GetClientAuthString(client, sAuthID, sizeof(sAuthID));
    
    decl String:sTimeQuery[256];
    FormatEx(sTimeQuery, 256, "SELECT time FROM round WHERE auth = '%s' AND map = '%s' AND physicsdifficulty = '%d' ORDER BY time LIMIT 1", sAuthID, map, physicsDifficulty);
    
    new Handle:hTimeQuery = SQL_Query(g_hSQL, sTimeQuery);
    
    decl String:sError[255];
    
    if(hTimeQuery == INVALID_HANDLE)
    {
        SQL_GetError(g_hSQL, sError, sizeof(sError));
        Timer_LogError("SQL Error on FinishRound: %s", sError);
        SQL_UnlockDatabase(g_hSQL);
        
        return;
    }
    
    if(SQL_FetchRow(hTimeQuery))
    {
        fLastTime = SQL_FetchFloat(hTimeQuery, 0);
    }
    
    else
    {
        fLastTime = 0.0;
    }
    
    SQL_UnlockDatabase(g_hSQL); 
    
    CloseHandle(hTimeQuery);
    
    if(fLastTime == 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
    }
    fLastTime -= time;            
    if(fLastTime < 0.0)
    {
        fLastTime *= -1.0;
        Timer_SecondsToTimeWr(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "+%s", sBuffer);
    }
    else if(fLastTime > 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
        Timer_SecondsToTimeWr(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "-%s", sBuffer);
    }
    else if(fLastTime == 0.0)
    {
        Timer_SecondsToTimeWr(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "%s", sBuffer);
    }
    
    decl String:sName[MAX_NAME_LENGTH];
    GetClientName(client, sName, sizeof(sName));
    
    decl String:sSafeName[2 * strlen(sName) + 1];
    SQL_LockDatabase(g_hSQL);
    SQL_EscapeString(g_hSQL, sName, sSafeName, 2 * strlen(sName) + 1);
    SQL_UnlockDatabase(g_hSQL);
    
    if(bOverwrite)
    {
        decl String:sQuery[256];
        FormatEx(sQuery, sizeof(sQuery), "DELETE FROM round WHERE map = '%s' AND auth = '%s' AND physicsdifficulty = '%d';", map, sAuthID, physicsDifficulty);
        
        SQL_LockDatabase(g_hSQL);
        
        new Handle:hQuery = SQL_Query(g_hSQL, sQuery);
        
        if (hQuery == INVALID_HANDLE)
        {
            SQL_GetError(g_hSQL, sError, sizeof(sError));
            Timer_LogError("SQL Error on FinishRound: %s", sError);
            SQL_UnlockDatabase(g_hSQL);
            return;
        }
        
        CloseHandle(hQuery);
        
        SQL_UnlockDatabase(g_hSQL); 
        
        FormatEx(sQuery, sizeof(sQuery), "INSERT INTO round (map, auth, time, jumps, physicsdifficulty, name, fpsmax, flashbangs) VALUES ('%s', '%s', %f, %d, %d, '%s', %d, %d);", map, sAuthID, time, jumps, physicsDifficulty, sSafeName, fpsmax, flashbangs);
        
        SQL_LockDatabase(g_hSQL);
        
        new Handle:hQuery2 = SQL_Query(g_hSQL, sQuery);
        
        if(hQuery2 == INVALID_HANDLE)
        {
            SQL_GetError(g_hSQL, sError, sizeof(sError));
            Timer_LogError("SQL Error on FinishRound: %s", sError);
            SQL_UnlockDatabase(g_hSQL);
            return;
        }
        
        SQL_UnlockDatabase(g_hSQL); 
        
        CloseHandle(hQuery2);
        
        g_bestTimeCache[client][IsCached] = false;
        
        GetTotalRank(g_sCurrentMap);
        GetCurrentRank(client, g_sCurrentMap);
    }
    
    decl String:sTimeString[32];
    Timer_SecondsToTimeWr(time, sTimeString, sizeof(sTimeString), true);
    
    Call_StartForward(g_hFinishRoundForward);
    Call_PushCell(client);
    Call_PushString(map);
    Call_PushCell(jumps);
    Call_PushCell(flashbangs);
    Call_PushCell(physicsDifficulty);
    Call_PushCell(fpsmax);
    Call_PushString(sTimeString);
    Call_PushString(sTimeDiff);
    Call_PushCell(Timer_GetCurrentRank(client, false));
    Call_PushCell(Timer_GetTotalRank(false));
    Call_PushCell(bOverwrite);
    //Call_PushFloat(time);
    Call_Finish();
}
Sorry for the uglyness of that code.
__________________
retired

Last edited by shavit; 12-08-2013 at 14:29.
shavit is offline
Himynamesaustin
Member
Join Date: Nov 2013
Old 12-08-2013 , 21:21   Re: [CS:S] Timer 1.0.7
Reply With Quote #596

Quote:
Originally Posted by zipcore View Post
Just recompile and increase this limit. My timers cache is much bigger "new g_cache[MAX_MODES][MAX_BONUS][MAX_CACHE][RecordCache]"

CHANGE NEEDED: (timer-worldrecord.sp)
PHP Code:
new g_cache[1024][RecordCache];

to

new g_cache[5000][RecordCache];

AND

FormatEx(sQuerysizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name, MAX(m.flashbangs) flashbangs FROM round AS m INNER JOIN (SELECT MIN(n.time) time, n.auth FROM round n WHERE n.map = '%s' GROUP BY n.physicsdifficulty, n.auth) AS j ON (j.time = m.time AND j.auth = m.auth) WHERE m.map = '%s' GROUP BY m.physicsdifficulty, m.auth ORDER BY m.time ASC LIMIT 0, 1000"g_sCurrentMapg_sCurrentMap);   

to

FormatEx
(sQuerysizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name, MAX(m.flashbangs) flashbangs FROM round AS m INNER JOIN (SELECT MIN(n.time) time, n.auth FROM round n WHERE n.map = '%s' GROUP BY n.physicsdifficulty, n.auth) AS j ON (j.time = m.time AND j.auth = m.auth) WHERE m.map = '%s' GROUP BY m.physicsdifficulty, m.auth ORDER BY m.time ASC LIMIT 0, 5000"g_sCurrentMapg_sCurrentMap); 
I was told the limit for the array was 1000 and that change is impossible. can anyone confirm or deny?
Himynamesaustin is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-09-2013 , 01:02   Re: [CS:S] Timer 1.0.7
Reply With Quote #597

Quote:
Originally Posted by Himynamesaustin View Post
I was told the limit for the array was 1000 and that change is impossible. can anyone confirm or deny?
I confirm that you can change it.
__________________
retired
shavit is offline
Himynamesaustin
Member
Join Date: Nov 2013
Old 12-09-2013 , 03:46   Re: [CS:S] Timer 1.0.7
Reply With Quote #598

Quote:
Originally Posted by shavit View Post
I confirm that you can change it.
get on skype, i have something for you
Himynamesaustin is offline
goapsytrancer
New Member
Join Date: Jan 2014
Location: Germany
Old 01-10-2014 , 05:00   Re: [CS:S] Timer 1.0.7
Reply With Quote #599

thanks for the upload!

i try it online on gameserver
without mysql database can it be the problem
why i didnt see it like in the video on my admin menu ?




or need i command to activate this plugin



Last edited by goapsytrancer; 01-10-2014 at 05:13.
goapsytrancer is offline
extremeg
Senior Member
Join Date: Dec 2012
Old 01-24-2014 , 10:19   Re: [CS:S] Timer 1.0.7
Reply With Quote #600

Hei, when a player finish the map my server lags. I have over 5000 rounds tracked
extremeg 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 05:44.


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