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

[L4D & L4D2] Kick Load Stuckers


Post New Thread Reply   
 
Thread Tools Display Modes
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2009 , 07:06   Re: [L4D] Kick Load Stuckers
Reply With Quote #21

Quote:
Originally Posted by olj View Post
EDIT: You use TIMER_FLAG_NO_MAPCHANGE, why you trying to kill them on map end??
An attempt to make Sourcemod recognize the Timers as INVALID_HANDLE after a mapchange.


@D1maxa
Try it in a game. Youll get the same errors.


The one thing i could do is remove the OnMapEnd() function entirely, which should work since the Timers have the nomapchange flag..

Last edited by AtomicStryker; 09-21-2009 at 07:09.
AtomicStryker is offline
D1maxa
Member
Join Date: Dec 2008
Old 09-21-2009 , 07:15   Re: [L4D] Kick Load Stuckers
Reply With Quote #22

i have no errors anymore with my edited version ;)
Only correct work in programming with handles - and u don't have any problems. The problem wasn't in sourcemod
D1maxa is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2009 , 08:09   Re: [L4D] Kick Load Stuckers
Reply With Quote #23

What you posted is how version 1.0.0 looked. You'll get handle errors, trust me
AtomicStryker is offline
D1maxa
Member
Join Date: Dec 2008
Old 09-21-2009 , 08:17   Re: [L4D] Kick Load Stuckers
Reply With Quote #24

Quote:
Originally Posted by AtomicStryker View Post
What you posted is how version 1.0.0 looked. You'll get handle errors, trust me
give me your version 1.0.0
with your version 1.0.2 server got errors every 10 minutes, 500 kb error log for one day

Last edited by D1maxa; 09-21-2009 at 08:24.
D1maxa is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2009 , 09:08   Re: [L4D] Kick Load Stuckers
Reply With Quote #25

I dont have version 1.0.0 anymore but be assured it used KillTimer just as your recode does. It would be a lot easier if ... does setting a Handle invalid kill its timer already?
AtomicStryker is offline
D1maxa
Member
Join Date: Dec 2008
Old 09-21-2009 , 10:37   Re: [L4D] Kick Load Stuckers
Reply With Quote #26

Quote:
Originally Posted by AtomicStryker View Post
I dont have version 1.0.0 anymore but be assured it used KillTimer just as your recode does. It would be a lot easier if ... does setting a Handle invalid kill its timer already?
no, you have nothing in sourcemod. There is task_exists(id) in amx mod x, but not in sourcemod. So u must set INVALID_HANDLE to your timer's handle when u kill timer or timer function executed
D1maxa is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2009 , 10:43   Re: [L4D] Kick Load Stuckers
Reply With Quote #27

There, i scrapped using KillTimer or CloseHandle altogether. I just ran an entire Campaign with lots of Ragequitting (about 40) and not a single Sourcemod error. The Plugin worked fine.

Have 1.0.4
AtomicStryker is offline
D1maxa
Member
Join Date: Dec 2008
Old 09-21-2009 , 14:17   Re: [L4D] Kick Load Stuckers
Reply With Quote #28

there are no errors of course because u removed all of CloseHandle and KillTimer. But u don't control when your timer's function executes.
Look on next example:
l4d_kickloadstuckers_duration is 45, i connected in 40 sec before map ends, map is ending, server is changing map and CheckClientIngame is executing: i'm loading new map so i'm not in game and server is kicking me. Is this normal?
If u want save your code, u must use next check:
Code:
public Action:CheckClientIngame(Handle:timer, any:client)
{
    if (!IsClientConnected(client)) return; //onclientdisconnect should handle this, but you never know
    if(LoadingTimer[client] == INVALID_HANDLE) return;
    if (!IsClientInGame(client))
        {
            decl String:name[256];
            GetClientName(client, name, sizeof(name));
            PrintToChatAll("%s was kicked for being stuck in connecting state for %i seconds", name, RoundToNearest(GetConVarFloat(CvarDuration)));
            
            KickClient(client, "You were stuck Connecting for too long"); //he is connected but not ingame after an entire minute? SMITE HIM!!!
        }
}
my previous code with KillTimers workes without any problem on real public game server during whole day (there are hundreds of connects/disconnects on it), so it's not like your version 1.0.0, you were wrong.
And final: u don't need OnMapEnd function because
Quote:
Are clients disconnected on mapchange?

All clients are fully disconnected before the map changes. They are all reconnected after the next map starts.
so OnClientDisconnect(client) does all job when map ends

Last edited by D1maxa; 09-21-2009 at 14:21.
D1maxa is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2009 , 16:42   Re: [L4D] Kick Load Stuckers
Reply With Quote #29

That is why i make use of OnMapEnd(). Why don't you playtest it before saying it doesnt work

It invalidates all running Timers, including the one you claim would kick you.

My approach works and doesn't generate errors anymore, im happy with it.

Last edited by AtomicStryker; 09-21-2009 at 16:45.
AtomicStryker is offline
D1maxa
Member
Join Date: Dec 2008
Old 09-22-2009 , 02:56   Re: [L4D] Kick Load Stuckers
Reply With Quote #30

Omg! don't u see that OnMapEnd and OnClientDisconnect does same work when map ends? If there are no errors, this doesn't mean what code is correct. Your code has logical errors. I have said about possible situation already.

LoadingTimer[client] = INVALID_HANDLE <- u think that this kills timer? do u really think that?

I can not understand how your plugin approved. Perhaps version 1.0.0 was more clear

Last edited by D1maxa; 09-22-2009 at 03:37.
D1maxa is offline
Reply


Thread Tools
Display Modes

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 15:50.


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