AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Registered User Voice Enabler 1.1.2 (https://forums.alliedmods.net/showthread.php?t=254246)

Neuro Toxin 12-31-2014 19:14

[ANY] Registered User Voice Enabler 1.1.2
 
4 Attachment(s)
[ANY] Registered User Voice Enabler

This plugin will mute players who have not registered in your forum software.

When a player connects, their steamid is matched with a MySQL query to your forum software database. If the steamid is unable to match, the player will be muted.

This plugin will never lift a mute, it only applies mutes to unregistered users.

Features:

* The database coding is 100% threaded. There will be no server lag during query executions.
* Database failure recovery. The database code is 100% rocksolid including automatic recovery.
* Native and Forward for other plugins to listen for / check a clients registration status.

Installation:

Copy the contents of the attached .zip file into your main game directory.

Database Setup:

Add the following entry into Sourcemod's database.cfg

Configure the database entry to reach your forums mysql database.
Code:

    "reguservoiceenabler"
    {
        "driver"            "mysql"
        "host"                ""
        "database"            ""
        "user"                ""
        "pass"                ""
        "timeout"            "30"
        "port"                "3306"
    }

Config Setup:

You need to add and configure the following convars to you server's configs (eg. cfg/gamemode_casual_server.cfg).

Code:

reguservoiceenabler_enabled        1
reguservoiceenabler_query        ""
reguservoiceenabler_muteondbfailure    1
reguservoiceenabler_steamidformat    1
reguservoiceenabler_alwaysshowmessage      1

SteamID formats are:

1 - A SteamID64 (uint64) as a String, ex "76561197968573709"
2 - Steam2 rendered format, ex "STEAM_1:1:4153990"
3 - Steam3 rendered format, ex "[U:1:8307981]"

How do I set the query?

Each forum software is different. The second post contains a list of queries based on your forum software and setup.

API:

This plugin contains a native and forward as shown below. (#include <reguservoiceenabler>)
Code:

/**
 * Checks if the clients steamid is registered on your forums
 *
 * @param client            The client index to check
 * @return                    Returns true if the client has registered
 */
native bool IsClientRegisteredOnForums(int client);

/**
 * Called when the clients forum registration status has been retrieved.
 *
 * @param client            The client index
 * @param registered        The clients forum registration status
 */
forward void OnGotClientRegistrationStatus(int client, bool registered);

How do I change the message which is displayed to users?

Edit the translation file found at addons/sourcemod/translations/reguservoiceenabler.phrases.txt

Code:

"Phrases"
{
    "IsMutedChatText"
    {
        "en"        "[SM] You need to register on our forums before you can use your microphone."
    }
    "IsMutedCenterText"
    {
        "en"        "You have been muted."
    }
}

Plugin Updates

Version 1.1.1 [2015.08.18]
- Fixed newly joining players being able to hear previously muted players

Version 1.1.0 [2015.08.01]
- Moved to transitional syntax
- Mutes no longer log to Sourcecomms

Version 1.0.1 [2015.01.18]
- Fixed client index out of range errors
- Disabled bot processing

Version 1.1.2 [2016.10.26]
- Fixed "plugin not runnable" error (thanks 8guawong)

Neuro Toxin 12-31-2014 19:15

Re: [ANY] Registered User Voice Enabler
 
Queries based on forum software

http://console.aus-tg.com/index.php?page=ruv_dbsetup

vBulletin 4.x.x with SteamConnect
Spoiler


Xenforo with Steam Authentication & Integration addon
Spoiler


Sourcebans
Spoiler


IP Board & Sign in through Steam
Spoiler

Neuro Toxin 12-31-2014 20:14

Re: [ANY] Registered User Voice Enabler
 
If you use this plugin, and make a query for forum software not listed above. Please let me know what the query is and steamid format so I can update the above post.

nomy 01-01-2015 05:20

Re: [ANY] Registered User Voice Enabler
 
Xenforo with Steam Authentication & Integration addon - reguservoiceenabler_steamidformat 2

Code:

SELECT CONCAT('STEAM_0:', provider_key & 1, ':', (provider_key & 0xFFFFFFFF) >> 1) FROM xf_user_external_auth

Neuro Toxin 01-01-2015 05:53

Re: [ANY] Registered User Voice Enabler
 
Quote:

Originally Posted by nomy (Post 2243088)
Xenforo with Steam Authentication & Integration addon - reguservoiceenabler_steamidformat 2

Code:

SELECT CONCAT('STEAM_0:', provider_key & 1, ':', (provider_key & 0xFFFFFFFF) >> 1) FROM xf_user_external_auth

*Forum configuration data updated into second post*

Thanks.

Edit: Hold up, there is no {steamid} replacement in your query?

nomy 01-01-2015 08:42

Re: [ANY] Registered User Voice Enabler
 
Quote:

Originally Posted by Neuro Toxin (Post 2243095)
*Forum configuration data updated into second post*

Thanks.

Edit: Hold up, there is no {steamid} replacement in your query?

My bad I hadn't tested it yet. Will test this plugin later.

I had a quick look at your plugin and xenforo query would look like this:
Code:

SELECT * FROM 'xf_user_external_auth' WHERE provider_key = '{steamid}';
Also, this time: reguservoiceenabler_steamidformat 1

Neuro Toxin 01-01-2015 15:26

Re: [ANY] Registered User Voice Enabler
 
:)

Darkness_ 01-01-2015 17:38

Re: [ANY] Registered User Voice Enabler
 
Very nice.

Neuro Toxin 01-01-2015 17:48

Re: [ANY] Registered User Voice Enabler
 
I'm thinking of a few new features that have been raised with people.

1. only verify the players registration status if more then x players are connected.
-> This would include a cvar to re-process skipped clients once x players are reached

2. add cvars to control what messages are shown when.
-> Atm, the muted messages always show via PrintCenter and in the main chat
-> Atm, messages only display onroundstart, cvars to enable when (roundstart, playerspawn, playerselecteam) would be usefull.

3. add a function to auto register a user into your forums if your forums support steam signin. This would also give a temp password back into the main chat for that user.

I'm open to any other requests / feedback.

snelvuur 01-02-2015 20:15

Re: [ANY] Registered User Voice Enabler
 
I assume you already know this one, https://forums.alliedmods.net/showthread.php?p=1655283 but if you have that you can just say registered users have a certain flag and only allow those to talk. Other then that, ofcourse nice work :)


All times are GMT -4. The time now is 13:54.

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