Raised This Month: $ Target: $400
 0% 

[CS:S] Timer 1.0.7


Post New Thread Reply   
 
Thread Tools Display Modes
Glite
Senior Member
Join Date: Sep 2011
Location: Ukraine
Old 09-25-2013 , 10:17   Re: [CS:S] Timer 1.0.7
Reply With Quote #561

This doesn't help. Insertion query doesn't require alot of time. The ones which do are: GetTotalRank and GetCurrentRank.
Glite is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-25-2013 , 12:11   Re: [CS:S] Timer 1.0.7
Reply With Quote #562

Quote:
Originally Posted by Glite View Post
This doesn't help. Insertion query doesn't require alot of time. The ones which do are: GetTotalRank and GetCurrentRank.
My round table has almost 9,000 rows and it really helps me.
Threaded queries are better in this case.

About those, both can be threaded.

Code:
GetTotalRank(const String:map[])
{
    decl String:sQuery[448];
    FormatEx(sQuery, sizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name 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", map, map);
    
    SQL_TQuery(g_hSQL, GetTotalRankCallback, sQuery, 0);
}

public GetTotalRankCallback(Handle:owner, Handle:hndl, const String:error[], any:client)
{
    if(hndl == INVALID_HANDLE)
    {
        LogError("SQL Error on GetTotalRank: %s", error);
        
        return;
    }
    
    g_iTotalRankCache = SQL_FetchRow(hndl)? SQL_GetRowCount(hndl):0;
    
    CloseHandle(hndl);
}

GetCurrentRank(client, const String:map[])
{
    decl String:sQuery[512];
    FormatEx(sQuery, sizeof(sQuery), "SELECT m.id, m.auth, m.time, MAX(m.jumps) jumps, m.physicsdifficulty, m.name FROM round AS m INNER JOIN (SELECT MIN(n.time) time, n.auth FROM round n WHERE n.map = '%s' AND n.time <= %f GROUP BY n.physicsdifficulty, n.auth) AS j ON (j.time = m.time AND j.auth = m.auth) WHERE m.map = '%s' AND m.time <= %f GROUP BY m.physicsdifficulty, m.auth", map, g_bestTimeCache[client][Time] + 0.0001, map, g_bestTimeCache[client][Time] + 0.0001);

    SQL_TQuery(g_hSQL, GetCurrentRankCallback, sQuery, 0);
}

public GetCurrentRankCallback(Handle:owner, Handle:hndl, const String:error[], any:client)
{
    if(hndl == INVALID_HANDLE)
    {
        LogError("SQL Error on GetCurrentRank: %s", error);
        
        return;
    }
    
    g_iCurrentRankCache[client] = SQL_GetRowCount(hndl);
    
    CloseHandle(hndl);
}
__________________
retired

Last edited by shavit; 09-25-2013 at 12:20.
shavit is offline
Glite
Senior Member
Join Date: Sep 2011
Location: Ukraine
Old 09-25-2013 , 16:58   Re: [CS:S] Timer 1.0.7
Reply With Quote #563

You can't. You broke everything with this. FinishRound function requires immediate result from those queries.

Last edited by Glite; 09-25-2013 at 17:11.
Glite is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 09-26-2013 , 05:00   Re: [CS:S] Timer 1.0.7
Reply With Quote #564

Quote:
Originally Posted by Glite View Post
You can't. You broke everything with this. FinishRound function requires immediate result from those queries.
Use yu recrd buffer.
__________________

Last edited by zipcore; 09-26-2013 at 17:04.
zipcore is offline
Glite
Senior Member
Join Date: Sep 2011
Location: Ukraine
Old 09-27-2013 , 11:22   Re: [CS:S] Timer 1.0.7
Reply With Quote #565

Quote:
Originally Posted by zipcore View Post
Use yu recrd buffer.
I have in mind this idea, but i don't have time to do this...
Glite is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-27-2013 , 16:00   Re: [CS:S] Timer 1.0.7
Reply With Quote #566

Quote:
Originally Posted by Glite View Post
You can't. You broke everything with this. FinishRound function requires immediate result from those queries.
Then wait for both results from queries and after that do everything else in FinishRound.
__________________
retired
shavit is offline
nikedu45
Senior Member
Join Date: May 2011
Old 09-28-2013 , 09:11   Re: [CS:S] Timer 1.0.7
Reply With Quote #567

Quote:
Originally Posted by shavit View Post
timer-core.sp
error 017: undefined symbol "SQL_LockDatabse"
error 017: undefined symbol "SQL_UnlockDatabse"
__________________
Bl4ck-And-White.fr
I'm French !!
nikedu45 is offline
Glite
Senior Member
Join Date: Sep 2011
Location: Ukraine
Old 09-28-2013 , 17:34   Re: [CS:S] Timer 1.0.7
Reply With Quote #568

Quote:
Originally Posted by nikedu45 View Post
error 017: undefined symbol "SQL_LockDatabse"
error 017: undefined symbol "SQL_UnlockDatabse"
Don't use it. It brokes correct position definition after finishing the map.
Glite is offline
takaharrue
New Member
Join Date: Sep 2013
Old 09-29-2013 , 05:07   Re: [CS:S] Timer 1.0.7
Reply With Quote #569

THe timer-hud is not showing up for me, and in my admin menu, I have no timer commands. I'm pretty sure I configured everything correctly.
takaharrue is offline
nikedu45
Senior Member
Join Date: May 2011
Old 09-29-2013 , 11:08   Re: [CS:S] Timer 1.0.7
Reply With Quote #570

You really need to make a correction, the plugin is broken it causes huge lag on the server
__________________
Bl4ck-And-White.fr
I'm French !!
nikedu45 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:26.


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