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

[ANY] SQL Whois


Post New Thread Reply   
 
Thread Tools Display Modes
Author
knoid
Junior Member
Join Date: Mar 2006
Plugin ID:
8374
Plugin Version:
0.3
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Track players across multiple servers using the same SQL db
    Old 01-17-2023 , 01:22   [ANY] SQL Whois
    Reply With Quote #1

    This is long overdue for posting - I wrote it 13 years ago when the joe.to community was running multiple TF2 and L4D/L4D2 servers. I tested it tonight on a freshly-installed server, and it still works, although I had to disable strict SQL mode which is now apparently A Thing.

    It's a port of Bugblatter's plugin_blatt_whois for Adminmod, the major difference (AM/SM aside) being that it stores in a central database rather than 5 zillion flatfiles.

    I had a look at the current crop of Sourcemod plugins and while there are a couple of whois plugins, neither approach the functionality of Bugblatter's original.

    It's not perfect, and there's a few things I wanted to add but never got to, but it is really rather good.

    Dependencies:

    SQL admins enabled and running off a MariaDB or MySQL database. Not tested with SQLite.

    Features:

    - records kicks and bans with reasons on a player's record
    - allows you to place/remove a watch on players even if they're not currently connected
    - notifies admins when watched players or players on LAN are on the server

    The notification timer is set for 2 minutes - you may want to adjust this or disable it altogether if it gets annoying. Editing the timer amount in line 26 (or commenting out with a //) and recompiling will solve that for you.

    Example output:



    Commands:

    sm_whois <steamID|name> - Show a player's activity
    sm_lan - Show players using the same IP address
    sm_note <steamID|name> <note> - Record note on player's record
    sm_watch <steamID|name> <reason> - Record watch against player (reason required)
    sm_unwatch <steamID|name> <reason> - Remove existing watch against player (reason required)

    Installation:

    Edit whois.sp and recompile the .smx if needed.
    Turn off Strict SQL mode by adding 'sql_mode=NO_ENGINE_SUBSTITUTION' to your MySQL/MariaDB my.cnf.
    Restart the DB.
    Stop your server.
    Drop the .smx into your plugins directory.
    Login to the SQL server you're using for sourcemod and run the contents of whois.sql.txt - this will setup all the tables needed.
    Start your server.
    Attached Files
    File Type: sp Get Plugin or Get Source (whois.sp - 156 views - 22.2 KB)
    File Type: txt whois.sql.txt (2.0 KB, 84 views)
    __________________
    knoid || Admin, joe.to gaming community
    tf2.joe.to - challenge maps
    tf4.joe.to - custom maps

    Last edited by knoid; 01-25-2023 at 04:04.
    knoid is offline
    noto3
    Member
    Join Date: Jan 2021
    Old 01-17-2023 , 11:52   Re: [ANY] SQL Whois
    Reply With Quote #2

    Quote:
    public OnClientPostAdminCheck(player)
    {
    if (!IsFakeClient(player))
    {
    StorePlayerName(player);
    }
    return true;
    }
    cannot return a value from a void function
    noto3 is offline
    noto3
    Member
    Join Date: Jan 2021
    Old 01-17-2023 , 12:53   Re: [ANY] SQL Whois
    Reply With Quote #3

    Stuck on [WhoIs] No DB connection! Despite having tables setup in the database
    noto3 is offline
    knoid
    Junior Member
    Join Date: Mar 2006
    Old 01-17-2023 , 17:28   Re: [ANY] SQL Whois
    Reply With Quote #4

    So much for my presumption! I'll dust off the test server and have a play over the next day or two. Thanks for the feedback, much appreciated.

    Quote:
    Originally Posted by noto3 View Post
    cannot return a value from a void function
    What game are you running?
    __________________
    knoid || Admin, joe.to gaming community
    tf2.joe.to - challenge maps
    tf4.joe.to - custom maps

    Last edited by knoid; 01-17-2023 at 19:50.
    knoid is offline
    knoid
    Junior Member
    Join Date: Mar 2006
    Old 01-18-2023 , 20:50   Re: [ANY] SQL Whois
    Reply With Quote #5

    I ended up setting up a fresh TF2 server from scratch, installing MM and SM, setting up MariaDB, and configuring SQL admins.

    I then installed my original whois.smx and a freshly compiled version downloaded from this post, and they launched and worked perfectly.

    The only thing I did find is that MySQL & MariaDB now use a Strict SQL mode by default, which borked one of my insert queries. I was able to fix this by adding 'sql_mode=NO_ENGINE_SUBSTITUTION' to my.cnf.

    Quote:
    Originally Posted by noto3 View Post
    cannot return a value from a void function
    Quote:
    Originally Posted by noto3 View Post
    Stuck on [WhoIs] No DB connection! Despite having tables setup in the database
    Do you have the SQL admin plugins enabled and connected to a MySQL/MariaDB instance? This plugin will not work with SQLite.
    __________________
    knoid || Admin, joe.to gaming community
    tf2.joe.to - challenge maps
    tf4.joe.to - custom maps
    knoid 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 03:32.


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