Raised This Month: $32 Target: $400
 8% 

Make a plugin depend in MySQL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eDanny
Junior Member
Join Date: Jul 2018
Old 07-10-2018 , 23:04   Make a plugin depend in MySQL
Reply With Quote #1

Hi, is there a away to make any plugin need to connect to a specifc MySQL database to work? Something that i could put in any sp that would make that if the plugin is not connected to that database it dont work.
eDanny is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 07-11-2018 , 02:52   Re: Make a plugin depend in MySQL
Reply With Quote #2

You can use SetFailState to stop a plugin if something fails. Example:
PHP Code:
g_hDatabase SQL_Connect"Database-Name"trueerrorsizeof(error) );

if( 
g_hDatabase == null )
{
    
SetFailState"[SQL ERROR] %s"error );


Last edited by hmmmmm; 07-11-2018 at 02:53.
hmmmmm is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-11-2018 , 05:55   Re: Make a plugin depend in MySQL
Reply With Quote #3

Could also use keyvalues, add password etc.
PHP Code:
Handle hKv CreateKeyValues("SQLConnection");
    
KvSetString(hKv "driver""mysql");
KvSetString(hKv"database""yourdatabasename");

g_hDatabase SQL_ConnectCustom(hKvsErrorsizeof(sError), true);

if (
g_hDatabase == null)
{
    
SetFailState("%s"sError);

mug1wara is offline
eDanny
Junior Member
Join Date: Jul 2018
Old 07-12-2018 , 20:30   Re: Make a plugin depend in MySQL
Reply With Quote #4

Yes but is there a way to that plugin only that IP is allowed, for example in that sp if the cs:go server have this ip: 123.456.7890001 , it only works in that server with that port, something like that.
eDanny is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 07-12-2018 , 20:55   Re: Make a plugin depend in MySQL
Reply With Quote #5

We get these kind of posts every couple months. Prepare to have sourcemod ethics brought down on this post.
You MUST give the sourcecode with the compiled plugin.
Mitchell is offline
eDanny
Junior Member
Join Date: Jul 2018
Old 07-12-2018 , 20:58   Re: Make a plugin depend in MySQL
Reply With Quote #6

I have a cs:go server with another guy, just dont want him to copy my server
eDanny is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-12-2018 , 21:14   Re: Make a plugin depend in MySQL
Reply With Quote #7

Think no one is going to help you with this and Mitchell is right.
mug1wara is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-12-2018 , 21:45   Re: Make a plugin depend in MySQL
Reply With Quote #8

Quote:
Originally Posted by eDanny View Post
I have a cs:go server with another guy, just dont want him to copy my server
Then remove his ability to access your server's files.

Plugins can be decompiled, so even if you implement protection like this, and don't upload the .sp file, the plugin can STILL be edited.
__________________
ddhoward 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 23:42.


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