Raised This Month: $51 Target: $400
 12% 

[ANY] SourceComms (0.9.266 - 22/11/2014)


Post New Thread Reply   
 
Thread Tools Display Modes
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 02-21-2013 , 22:17   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #61

Global
  • Instead of doing something like
    Code:
    WHERE c.authid REGEXP '^STEAM_[0-9]:%s$'
    in your SQL queries to filter by steam id with cross-game support, it is recommended use Account IDs. You can find an implementation for a GetAccountIDFromAuthString method here (lines 66-76).

  • If you still don't want to use account ids, just remember to escape auth strings you're passing to your queries to prevent SQL Injection in case of Steam ID spoofing (for example: L338, L1919-1923 and L1927-L1931 in your code).

  • When calling IsFakeClient, you should probably check if the client is in-game first (for example: L302 in your code).
Code-specific

L134-138, L142-146:

Code:
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 3
Why are you supporting SM < 1.3 (when your thread clearly states SM version 1.4.1 or newer)? It probably doesn't work anymore anyways.

L198-199:

Code:
// This timer is what processes the SQLite queue when the database is unavailable
CreateTimer(float(ProcessQueueTime * 60), ProcessQueue);
Don't use a timer for that. Process the queue on the GotDatabase callback.

L207:

Code:
for (new i = 1; i <= GetMaxClients(); i++)
Just use the MaxClients dynamic variable.

L219:

Code:
g_hPlayerRecheck[i] = CreateTimer(RetryTime + i, ClientRecheck, GetClientUserId(i));
You might want to use GetClientSerial and GetClientFromSerial when passing clients to timers in case they disconnect. userids are fine

L1569:

Code:
AdmImmunity = GetAdminImmunityLevel(GetUserAdmin(admin));
You should probably make sure that GetUserAdmin(admin) != INVALID_ADMIN_ID.

L2297:

Code:
SQL_FastQuery(SQLiteDB, "CREATE TABLE IF NOT EXISTS queue (steam_id TEXT PRIMARY KEY ON CONFLICT REPLACE, time INTEGER, start_time INTEGER, reason TEXT, name TEXT, admin_id TEXT, admin_ip TEXT, type INTEGER);");
You should make this a threaded query to fast up the plugin load process.
__________________

Last edited by alongub; 02-21-2013 at 22:39.
alongub is offline
nomy
Senior Member
Join Date: Dec 2009
Location: United Kingdom
Old 02-23-2013 , 03:30   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #62

L2843:

Code:
    if (CheckCommandAccess(admin, "", UNBLOCK_FLAG|ADMFLAG_ROOT, true))
        return true;    // all allowed for admins with special flag
Should be:
Code:
    if (CheckCommandAccess(admin, "", UNBLOCK_FLAG || ADMFLAG_ROOT, true))
        return true;    // all allowed for admins with special flag
nomy is offline
ppalex
Senior Member
Join Date: Nov 2012
Location: Russia, near the Moscow
Old 02-23-2013 , 14:39   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #63

Quote:
Originally Posted by nomy View Post
L2843:

Code:
    if (CheckCommandAccess(admin, "", UNBLOCK_FLAG|ADMFLAG_ROOT, true))
        return true;    // all allowed for admins with special flag
Should be:
Code:
    if (CheckCommandAccess(admin, "", UNBLOCK_FLAG || ADMFLAG_ROOT, true))
        return true;    // all allowed for admins with special flag
You had given to me the very bad advice.
ADMFLAG_CUSTOM2 || ADMFLAG_ROOT equals ADMFLAG_RESERVATION

Last edited by ppalex; 02-23-2013 at 16:33.
ppalex is offline
nomy
Senior Member
Join Date: Dec 2009
Location: United Kingdom
Old 02-23-2013 , 16:04   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #64

Quote:
Originally Posted by ppalex View Post
You had given to me the very bad advice.
in binary:
Code:
ADMFLAG_CUSTOM2_is_10000000000000000
ADMFLAG_ROOT is______100000000000000
CUSTOM2||ROOT is___________________1
CUSTOM2|ROOT_______10100000000000000
Are you feel the difference?
ADMFLAG_CUSTOM2 || ADMFLAG_ROOT equals ADMFLAG_RESERVATION
Ok, maybe its bad advice.

UNBLOCK_FLAG|ADMFLAG_ROOT doesnt give admins with custom2 flag perm mute length. What's the problem?
nomy is offline
Blacksilver
Member
Join Date: Aug 2011
Location: G E R M A N Y
Old 02-23-2013 , 16:20   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #65

Please post the changelog on the first page with spoiler
Its easier to look after it
__________________
Come to the dark side, we have cookies *muhaha*
Visit us!

Blacksilver is offline
ppalex
Senior Member
Join Date: Nov 2012
Location: Russia, near the Moscow
Old 02-23-2013 , 16:23   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #66

Quote:
Originally Posted by Blacksilver View Post
Please post the changelog on the first page with spoiler
Its easier to look after it
Changelog posted under "spoiler" in second post of theme on first page. What's the problem?
ppalex is offline
ppalex
Senior Member
Join Date: Nov 2012
Location: Russia, near the Moscow
Old 02-23-2013 , 16:23   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #67

Quote:
Originally Posted by nomy View Post
Ok, maybe its bad advice.

UNBLOCK_FLAG|ADMFLAG_ROOT doesnt give admins with custom2 flag perm mute length. What's the problem?
bug confirmed
my fail....:/
will be fixed in next buid...

Last edited by ppalex; 02-23-2013 at 16:33.
ppalex is offline
nomy
Senior Member
Join Date: Dec 2009
Location: United Kingdom
Old 02-23-2013 , 19:44   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #68

Hi,

Is it possible to ignore session aka (muted through natives) blocks?
I don't want these mutes to be uploaded to mysql.

Last edited by nomy; 02-23-2013 at 19:49.
nomy is offline
ppalex
Senior Member
Join Date: Nov 2012
Location: Russia, near the Moscow
Old 02-24-2013 , 04:43   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #69

Quote:
Originally Posted by nomy View Post
Hi,

Is it possible to ignore session aka (muted through natives) blocks?
I don't want these mutes to be uploaded to mysql.
Idea `showing all punishments` in sb pages is due to ability any admin simply get count of player's punishments and take decision to permanently punishment player.
ppalex is offline
nomy
Senior Member
Join Date: Dec 2009
Location: United Kingdom
Old 02-24-2013 , 05:49   Re: [ANY] SourceComms (0.8.89 - 18/02/2013)
Reply With Quote #70

I have plugin that use BaseComm_SetClientMute to mute players for 1 second to allow admin to speak. Its automated and it just create spam entry on web and the count becomes invalid because its not mute for punishment... If you dont understand I can show you my sourcebans website so you can see what I mean.

Do you have any idea I can modify this plugin to use anything else than BaseComm_SetClientMute to mute? So it will not come on sourcebans?

Also, there are 2 entries for silence... can make it one? instead of 2?
So if I silence someone, it will show punishment as silence and just one entry... if I remove mute but still have gag... it will change the entry to show for gag? etc?

Last edited by nomy; 02-24-2013 at 05:56.
nomy 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:01.


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