#21

I've tested all of my codes, and they're working except if there are some bugs, I hope you can help me spotting them if so.
Reply
#22

Quote:
Originally Posted by TheToretto
View Post
I've tested all of my codes, and they're working except if there are some bugs, I hope you can help me spotting them if so.
I doubt you actually test and revise your code before publishing it.
Reply
#23

Quote:
Originally Posted by BigETI
View Post
I doubt you actually test and revise your code before publishing it.
I do. What's wrong with those two codes? Bascially if someone says "rcon" he'll get warned. But wait, just one word is sufficient, sorry. "rcon" is the same as "/rcon" so no need to add more words. So it'll give:

PHP Code:
public OnPlayerText(playeridtext[]) 
{
    if(
strfind(text"rcon"true) != -1)
    {
        
SendClientMessage(playerid, -1"Bad idea.");
        
// Ban him if you want to :)
        
return 0;
    }
    return 
1;

Then, this one's all right huh?

PHP Code:
public OnRconLoginAttempt(ip[], password[], success

    if(!
success
    { 
        new 
IPAddr[16], str[64]; 
        static 
r_Warnings[MAX_PLAYERS]; 
        for(new 
iMAX_PLAYERSi++) 
        { 
            if(!
IsPlayerConnected(i)) continue; 
            
GetPlayerIp(iIPAddrsizeof(IPAddr)); 
            if(!
strcmp(ipIPAddrfalse)) 
            { 
                if(
r_Warnings[i] < 2)  
                { 
                    
r_Warnings[i]++; 
                    
format(strsizeof(str), "Warnings: (%i / 3)"r_Warnings[i]); 
                    return 
SendClientMessage(i, -1str); 
                } 
                else 
                { 
                    
Kick/*Ex*/(i); // Delay the ban with a timer so the playerid receives the message before getting banned 
                    
return SendClientMessage(i, -1"You've been warned."); 
                } 
            } 
        } 
    } 
    return 
1

Reply
#24

Didn't know about it, I'm testing on localhost Ї\_(ツ)_/Ї
Reply
#25

Quote:
Originally Posted by v1k1nG
View Post
There are many ways you could do that, like

PHP Code:
new IsRconAuthorized[MAX_PLAYERS];
CMD:rconauthorize(playeridparams[]){
    
// password check, or whatever
    
IsRconAuthorized[playerid] = true// if player passes the checks
    
return 1;
}
public 
OnRconLoginAttempt(ip[], password[], success){
    if(
IsRconAuthorized[playerid] == false)return 1// return whatever you prefer
    // code
    
return 1;   

You cannot use playerid downside the OnRconLoginAttempt ....
OnRconLoginAttempt(ip[], password[], success)

Where can you see playerid here??
Reply
#26

Quote:
Originally Posted by OiLoL
View Post
You cannot use playerid downside the OnRconLoginAttempt ....
OnRconLoginAttempt(ip[], password[], success)

Where can you see playerid here??
Quote:
Originally Posted by v1k1nG
View Post
Yes there's no playerid there, I just fastly wrote an example without meaning to give a real fast solution.
My post was to tell to be creative in finding any solution, as there are many ways to face any matter.
Please read the thread before posting. In the end there are several ways to get the player id in there anyways.
Reply
#27

I actually don't realy get it but I'm interested.

The server sends a message to the player if he is trying to login but failed, if those guys still trying to login, they deserved to get trolled for their dumbness.

I send a message (and also log it) to the team if someone tried logging in (even on success). If he is not authorized a team member will talk to him. If there is more than one player using the logged IP, both names will be sent to the team.
Reply
#28

Woah. I really didn't expect so much answers (4 pages). I will review your codes and suggestions and will choose the most useful ones.

Thanks.
Reply
#29

All the RCON security is useless if you only expect connected players to login. There's also an actual remote Console from which you can login (and send commands) so just searching for a playerid doesn't help when someone wants to brute force the PW or already has it (in the latter case it may be too late anyway, but you can still protect against unwanted access by temp. banning the IP - that also prevents remote console access).
Reply
#30

Quote:
Originally Posted by NaS
View Post
All the RCON security is useless if you only expect connected players to login. There's also an actual remote Console from which you can login (and send commands) so just searching for a playerid doesn't help when someone wants to brute force the PW or already has it (in the latter case it may be too late anyway, but you can still protect against unwanted access by temp. banning the IP - that also prevents remote console access).
Looks good
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)