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

Anti-Reconnect (1.1.5)


Post New Thread Reply   
 
Thread Tools Display Modes
abelp
Senior Member
Join Date: May 2008
Old 11-30-2008 , 01:24   Re: Anti-Reconnect v1.0.2
Reply With Quote #11

I really really need this plugin to work on TF2.
People cheat on zombie maps and they leave and rejoin only to play as survivors.
Can you make this plugin compatible for TF2 and add cvar that all new players join zombies ( in tf2 its blue team).
Your 2 cvars are anti connect timer. I want them to play just not as survivors.
so i would disable the timer and enable anyone reconnecting auto joins blue.
and admin immunity which is good. No need to change that.

If this is possible I would appreciate it so much. Im sure there might be other zombie servers in tf2 that have had this problem. The current zombie mod for tf2 has a glitch where you can either join spectators or reconnect to join survivors.
abelp is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 11-30-2008 , 09:11   Re: Anti-Reconnect v1.0.2
Reply With Quote #12

this is really nice plugin which I requested and trully hope that exvel will help ya

i run it on my servers and the people don't rejoin anymore or the stay for 30 sec out lol

Good luck
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 12-17-2008 , 19:04   Re: Anti-Reconnect v1.0.2
Reply With Quote #13

People from my server found a way bypassing you plugin:

Here is how :

I have bad name ban on my server --->>> the player changes his name to admin name in game and then reconects,the bad name ban plugin kicks him for a bad name because all admin names are protected by it and second time he succseed with his own name reconnected

can we fix it ?everyone now is bypassing it
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 12-19-2008 , 11:51   Re: Anti-Reconnect v1.0.2
Reply With Quote #14

It is not a bug. The plugin actualy checks if client disconnected by himself or was kicked, if client was kicked plugin will not do anything. The reason why plugin is working in such way because sometimes servers can lag and can kick all players for high ping and it will be worse if all clients also couldn't connect to the server again after such kind of lags.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 12-19-2008 , 17:42   Re: Anti-Reconnect v1.0.2
Reply With Quote #15

I don't think u got what i've said above
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
gH0sTy
SourceMod Donor
Join Date: Jul 2008
Location: DE
Old 12-20-2008 , 09:24   Re: Anti-Reconnect v1.0.2
Reply With Quote #16

I think he got what you said and I agree with his statement.
Anyway, you can fix it by modifying the source.
In line 38 you find.
Code:
if (StrEqual(reason, "Disconnect by user."))
add behind it
Code:
|| (StrEqual(reason, "Disconnect reason of your plugin"))
So it would look like this f.e.
Code:
if (StrEqual(reason, "Disconnect by user.")) || (StrEqual(reason, "Kicked for bad name"))
Compile it and you should be fine
gH0sTy is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 12-20-2008 , 16:16   Re: Anti-Reconnect v1.0.2
Reply With Quote #17

Quote:
Originally Posted by gH0sTy View Post
I think he got what you said and I agree with his statement.
Anyway, you can fix it by modifying the source.
In line 38 you find.
Code:
if (StrEqual(reason, "Disconnect by user."))
add behind it
Code:
|| (StrEqual(reason, "Disconnect reason of your plugin"))
So it would look like this f.e.
Code:
if (StrEqual(reason, "Disconnect by user.")) || (StrEqual(reason, "Kicked for bad name"))
Compile it and you should be fine
thank you gosty I'll try that
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 12-20-2008 , 16:20   Re: Anti-Reconnect v1.0.2
Reply With Quote #18

And i Got error :


Code:
//// antireconnect.sp
// antireconnect.sp(38) : error 029: invalid expression, assumed zero
// antireconnect.sp(38 -- 39) : error 028: invalid subscript (not an array or too many subscripts):
"StrEqual"
// antireconnect.sp(38 -- 40) : error 001: expected token: "}", but found "if"
// antireconnect.sp(38 -- 40) : fatal error 127: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-20-2008 , 16:27   Re: Anti-Reconnect v1.0.2
Reply With Quote #19

Attach the code you tried to use.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 12-20-2008 , 16:36   Re: Anti-Reconnect v1.0.2
Reply With Quote #20

Here is it :

Code:
#include <sourcemod>

#define PLUGIN_VERSION "1.0.2"

public Plugin:myinfo = 
{
    name = "Anti-Reconnect",
    author = "exvel",
    description = "Blocking people for time from reconnecting",
    version = PLUGIN_VERSION,
    url = "www.sourcemod.net"
}

new Handle:db = INVALID_HANDLE;
new Handle:cvar_ar_time = INVALID_HANDLE;
new Handle:cvar_ar_admin_immunity = INVALID_HANDLE;
new bool:isLAN = false;

public OnPluginStart()
{
    InitDB();
    ClearDB();
    HookEvent("player_disconnect", Event_PlayerDisconnect, EventHookMode_Post);
    isLAN = GetConVarBool(FindConVar("sv_lan"));
    
    CreateConVar("sm_anti_reconnect_version", PLUGIN_VERSION, "Anti-Reconnect Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    cvar_ar_time = CreateConVar("sm_anti_reconnect_time", "30", "Time in seconds players must to wait before connect to the server again after disconnecting, 0 = disabled", FCVAR_PLUGIN, true, 0.0);
    cvar_ar_admin_immunity = CreateConVar("sm_anti_reconnect_admin_immunity", "0", "0 = disabled, 1 = protect admins from Anti-Reconnect functionality", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    
    LoadTranslations("antireconnect.phrases.txt");
}

public Action:Event_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
    decl String:reason[128];
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    GetEventString(event, "reason", reason, 128);
    if (StrEqual(reason, "Disconnect by user.")) || (StrEqual(reason, "Kicked for bad name"))
    {
        if (isLAN || !GetConVarBool(cvar_ar_time) || client==0)
        {
            return;
        }
        
        if (IsFakeClient(client))
        {
            return;
        }
        
        if (GetUserFlagBits(client) && GetConVarBool(cvar_ar_admin_immunity))
        {
            return;
        }
        
        InsertClientInDB(client);
    }
}

//public OnClientPutInServer(client)
public OnClientAuthorized(client)
{
    if (isLAN || !GetConVarBool(cvar_ar_time) || client==0)
    {
        return;
    }
    
    if (IsFakeClient(client) || !IsClientConnected(client))
    {
        return;
    }

    decl String:query[200];
    decl String:steamId[30];
    
    GetClientAuthString(client, steamId, sizeof(steamId));    
    Format(query, sizeof(query), "SELECT * FROM    antireconnect WHERE steamId = '%s';", steamId);
    SQL_TQuery(db, CheckPlayer, query, client);
}

public CheckPlayer(Handle:owner, Handle:hndl, const String:error[], any:client)
{
    if(hndl == INVALID_HANDLE)
    {
        return;
    }
    
    if (SQL_GetRowCount(hndl) == 0)
    {
        return;
    }
    
    new time = GetTime() - SQL_FetchInt(hndl, 1) - GetConVarInt(cvar_ar_time);
    if (time >= 0)
    {
        RemoveScoreFromDB(client);
        return;
    }
    
    KickClient(client, "%t", "YOU ARE NOT ALLOWED TO RECONNECT FOR X SECONDS", -time);
}

public RemoveScoreFromDB(client)
{
    decl String:query[200];
    decl String:steamId[30];
    
    GetClientAuthString(client, steamId, sizeof(steamId));
    
    Format(query, sizeof(query), "DELETE FROM antireconnect WHERE steamId = '%s';", steamId);
    SQL_FastQuery(db, query);
}

public OnConfigsExecuted()
{
    isLAN = GetConVarBool(FindConVar("sv_lan"));
}

public InsertClientInDB(client)
{        
    decl String:steamId[30];
    decl String:query[200];
    GetClientAuthString(client, steamId, sizeof(steamId));
        
    SQL_LockDatabase(db);
    
    Format(query, sizeof(query), "DELETE FROM antireconnect WHERE steamid = '%s';", steamId);
    SQL_FastQuery(db, query);
        
    Format(query, sizeof(query), "INSERT INTO antireconnect VALUES ('%s', %d);", steamId, GetTime());
    SQL_FastQuery(db, query);
    
    SQL_UnlockDatabase(db);
}

public OnMapStart()
{
    ClearDB();
}

public InitDB()
{
    new String:error[255];
    db = SQL_ConnectEx(SQL_GetDriver("sqlite"), "", "", "", "antireconnect", error, sizeof(error), true, 0);
    if(db == INVALID_HANDLE)
    {
        SetFailState(error);
    }
    SQL_LockDatabase(db);
    SQL_FastQuery(db, "CREATE TABLE IF NOT EXISTS antireconnect (steamid TEXT, timestamp INTEGER);");
    SQL_UnlockDatabase(db);
}

public ClearDB()
{
    SQL_LockDatabase(db);
    SQL_FastQuery(db, "DELETE FROM antireconnect;");
    SQL_UnlockDatabase(db);
}
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
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 19:03.


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