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

Plugin Protect.


Post New Thread Reply   
 
Thread Tools Display Modes
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-16-2015 , 21:46   Re: Plugin Protect.
Reply With Quote #51

Quote:
Originally Posted by Brrdy View Post
Or do what I did although it got trashed check the hostip or w/e cvar
... which was using net_public_adr; which isn't as reliable and multi-mod as SteamWorks (i.e. net_public_adr doesn't exist in CSS). Plus even though the CVar exist in CSGO, as I test I see that it may not have the public server IP, as opposed to what I suggest.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 03-16-2015 , 21:58   Re: Plugin Protect.
Reply With Quote #52

If it an IP of some source or w.e. that you want to protect or even a password, you have to store it externally and make the plugin call that external value to use it except that the external storage have to white list the server IP.

For example, plugin -> web server -> is game server ip whitelisted? -> send value

Here a snippet to get public IP with steamwork to help you to your journey of "we have no idea of what are your real intentions"

PHP Code:
char g_sIp[32];
int g_iPort;

public 
Action Timer_CallSingleFunction(Handle timerDataPack data)
{
    
data.Reset();
    
Call_StartFunction(INVALID_HANDLEdata.ReadFunction());
    
Call_Finish();
    
delete data;
}

void GetIp()
{
    
PrintToServer("Attempt to get public IP...");
    
int ipaddress[4];
    
SteamWorks_GetPublicIP(ipaddress);
    if (!
ipaddress[0] && !ipaddress[1] && !ipaddress[2] && !ipaddress[3])
    {
        
DataPack data = new DataPack(); data.WriteFunction(GetIp);
        
CreateTimer(1.0Timer_CallSingleFunctiondata);
        return;
    }

    
Format(g_sIp32"%d.%d.%d.%d"ipaddress[0], ipaddress[1], ipaddress[2], ipaddress[3]);
    
g_iPort GetConVarInt(FindConVar("hostport"));    
    
PrintToServer("Debug -> Hey what up! I found the public IP %s:d!"g_sIpg_iPort);


Last edited by Mathias.; 03-16-2015 at 22:08.
Mathias. 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:49.


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