Boolean Reset Only Disconnect
I have an array g_canJoin[33]
So i reset the value after client disconnect: g_canJoin[id]= false; Do i need to reset it also on client_connect? I heard that sometimes when client crashes or looses internet connection there is a chance that player_disconnect event doesnt trigger after player disconnection. This means that after one player's disconnect without player_disconnect event then boolean will stay true on connection instead of false. Is this true? And is it safe to reset boolean value only on disconnect? |
Re: Boolean Reset Only Disconnect
Depends the situation, example in Ice Cube plugin, you must reset it on disconnect either if player is frozen and disconnects the ice cube will remain. It's not necessary to reset on both forwards, reset it just on client_disconnect or just client_connect , just put some logic into it.
|
Re: Boolean Reset Only Disconnect
For amxx < 183, there is a chance that client_disconnect won't be fired. A new forward was added in 1.8.3 to fix this problem. Depending on what amxx version you use, decide when to reset.
|
Re: Boolean Reset Only Disconnect
Quote:
For example I check users for inconsistent files (such as client side .dll files which can be fake cvar spoofer or different cheats) and if it doesn't find such file (incosistent file) it sets boolean allowed to true, else it sets boolean to false. After that i check in putinserver boolean and if it's false then i kick player. The problem is that I can't set allowed to false on connect because plugin_precache is triggered before client_connect. And imagine that case when client_disconnect is not triggered. It means that even if player has that file then boolean still remains true from previous disconnected player. |
Re: Boolean Reset Only Disconnect
Then, use both.
|
Re: Boolean Reset Only Disconnect
If client is between connect and putinserver then client_disconnect is not called. If client is after putinserver then client_disconnect must be called always.
What is the problem to use client_connect for resetting? |
Re: Boolean Reset Only Disconnect
Quote:
But precache is called before client_connect. |
Re: Boolean Reset Only Disconnect
Quote:
Just set g_canJoin[x] = true in client_connect and reset it if something goes wrong. |
Re: Boolean Reset Only Disconnect
In 183 isn't client_disconnected()?
|
Re: Boolean Reset Only Disconnect
Quote:
|
| All times are GMT -4. The time now is 20:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.