Raised This Month: $ Target: $400
 0% 

[Help] Plugin IP protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 06-13-2015 , 13:58   [Help] Plugin IP protection
Reply With Quote #1

Hello, i wondered if i can do protect a plugin only for 2 server IP's. I know that this can be bypassed, but there not all knows that.
if u know what i mean ?

how can i do this ? thank youu

PHP Code:
#define PROTECT_IP "123.123.123.123"

public plugin_init()
{

new 
SERVER_IP[20];
    
get_user_ip(0SERVER_IP211);

    if(
equal(SERVER_IPPROTECT_IP)) {
    
                  
server_print("Server IP, its Lecenced to use this plugin!")
    }
    else {
                
server_cmd("quit")
                  
    } 

Last edited by romi; 06-13-2015 at 14:09.
romi is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 06-13-2015 , 15:14   Re: [Help] Plugin IP protection
Reply With Quote #2

PHP Code:
#define License_1 "123.123.123.123"
#define License_2 "456.456.456.456"
  
 
public plugin_init()
{
    new 
SERVER_IP[20]
    
get_user_ip(0SERVER_IP211);

    if(
equal(SERVER_IPLicense_1) || equal(SERVER_IPLicense_2)) {
    
                  
server_print("This server is licenced to use this plugin!")
    }
    else {
                
server_cmd("quit")
                  
    } 


You sure that you wont get loopback if you use get_user_ip ?


Last edited by safetymoose; 06-13-2015 at 15:16.
safetymoose is offline
Decak
Senior Member
Join Date: Sep 2012
Old 06-13-2015 , 17:12   Re: [Help] Plugin IP protection
Reply With Quote #3

Or simpler, in plugin_init:

Code:
new ServerIP[20];
get_user_ip(0, ServerIP, charsmax(ServerIP))
if(!equal("Licensed server full IP", ServerIP))
     return PLUGIN_HANDLED;

Last edited by Decak; 06-13-2015 at 17:14.
Decak is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2015 , 23:46   Re: [Help] Plugin IP protection
Reply With Quote #4

You clearly know that it's pointless so don't do it. The only option is to only put the plugin on those two server and don't give it to anybody else.
__________________

Last edited by fysiks; 06-13-2015 at 23:47.
fysiks 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 20:48.


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