This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Multilines kick reason


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Teyut
Junior Member
Join Date: Nov 2006
Location: Somewhere between Mars a
Old 02-28-2009 , 23:40   Re: Multilines kick reason
Reply With Quote #1

Quote:
Originally Posted by evilworm View Post
Quote:
FATAL ERROR (shutting down): MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
[...]
So the question is - how can I know if I can send message to the player with message_begin() if the player shows up as not connected?
From what I understand reading the AMXX/HLSDK source code, such crashes happen when the last parameter (player entity) of the MESSAGE_BEGIN macro is NULL. The AMXX core doesn't check for such a case before calling that macro (the result of INDEXENT should be checked before use in unicast messages)

I've fixed that bug in the kick_ML() method (see above) calling the is_valid_ent() method (engine module) before doing anything. If the kick can't work, the method will return 0. Note however that is_valid_ent() does almost the same things as is_user_connected(), so it may not really help you, but at least, it should fix that server crash (I haven't test the code actually).

If you really want to kick players that are connecting but are not yet connected, you'll need to find a way to retrieve the result of the HL engine method pfnPEntityOfEntIndex: if it's non-zero, then you may kick the player. But I haven't find an AMXX module which provides a direct access to that method.

Quote:
Originally Posted by VEN View Post
Correction: it's SVC_DISCONNECT, not SVC_KICK.
Fixed, thanks. I didn't know where to find the correct names.

Quote:
Originally Posted by Brad View Post
My testing indicates that you can not use color in the message.
Sorry about my lack of answer You were right: it's not possible (I guess it is with Source).

Last edited by Teyut; 03-01-2009 at 00:11.
Teyut is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-01-2009 , 03:14   Re: Multilines kick reason
Reply With Quote #2

Quote:
Originally Posted by Teyut View Post
Fixed, thanks. I didn't know where to find the correct names.
Quote:
Originally Posted by message_const.inc
/* Hardcoded message types for message_begin()
* Look in the actual HLSDK for details!
*/
#define SVC_NOP 1
#define SVC_DISCONNECT 2
#define SVC_EVENT 3
#define SVC_VERSION 4
#define SVC_SETVIEW 5
#define SVC_SOUND 6
#define SVC_TIME 7
#define SVC_PRINT 8
#define SVC_STUFFTEXT 9
#define SVC_SETANGLE 10
#define SVC_SERVERINFO 11
#define SVC_LIGHTSTYLE 12
#define SVC_UPDATEUSERINFO 13
#define SVC_DELTADESCRIPTION 14
#define SVC_CLIENTDATA 15
#define SVC_STOPSOUND 16
#define SVC_PINGS 17
#define SVC_PARTICLE 18
#define SVC_DAMAGE 19
#define SVC_SPAWNSTATIC 20
#define SVC_EVENT_RELIABLE 21
#define SVC_SPAWNBASELINE 22
#define SVC_TEMPENTITY 23
#define SVC_SETPAUSE 24
#define SVC_SIGNONNUM 25
#define SVC_CENTERPRINT 26
#define SVC_KILLEDMONSTER 27
#define SVC_FOUNDSECRET 28
#define SVC_SPAWNSTATICSOUND 29
#define SVC_INTERMISSION 30
#define SVC_FINALE 31
#define SVC_CDTRACK 32
#define SVC_RESTORE 33
#define SVC_CUTSCENE 34
#define SVC_WEAPONANIM 35
#define SVC_DECALNAME 36
#define SVC_ROOMTYPE 37
#define SVC_ADDANGLE 38
#define SVC_NEWUSERMSG 39
#define SVC_PACKETENTITIES 40
#define SVC_DELTAPACKETENTITIES 41
#define SVC_CHOKE 42
#define SVC_RESOURCELIST 43
#define SVC_NEWMOVEVARS 44
#define SVC_RESOURCEREQUEST 45
#define SVC_CUSTOMIZATION 46
#define SVC_CROSSHAIRANGLE 47
#define SVC_SOUNDFADE 48
#define SVC_FILETXFERFAILED 49
#define SVC_HLTV 50
#define SVC_DIRECTOR 51
#define SVC_VOICEINIT 52
#define SVC_VOICEDATA 53
#define SVC_SENDEXTRAINFO 54
#define SVC_TIMESCALE 55
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
evilworm
Junior Member
Join Date: Apr 2008
Old 03-01-2009 , 06:18   Re: Multilines kick reason
Reply With Quote #3

Player entity parameter is not NULL, I checked that with debug output to log, but I'm not sure abut INDEXENT output. The is_valid_ent() will not work, because it first checks if player is ingame and then checks INDEXENT. By the way, as I said, I'm doing the kick from the client_authorized() function, which sometimes fails. I guess it's too early to call message_begin() here. However client_putinserver() is not guaranteed to happen before client_authorized(), so I cannot call that one either. Just had a thought that I sould check which one of the functions is called last and execute kick from there (some kinda emulation of OnClientPreAdminCheck function from SourceMod).

Last edited by evilworm; 03-01-2009 at 06:35.
evilworm is offline
Teyut
Junior Member
Join Date: Nov 2006
Location: Somewhere between Mars a
Old 03-01-2009 , 15:36   Re: Multilines kick reason
Reply With Quote #4

Quote:
Originally Posted by evilworm View Post
Player entity parameter is not NULL, I checked that with debug output to log, but I'm not sure abut INDEXENT output.
The player entity is the result of INDEXENT (it's a pointer). The only reason why the MESSAGE_BEGIN macro (the HLSDK macro) throws that fatal error is when the player entity parameter is NULL with unicast messages.

Quote:
Originally Posted by evilworm View Post
Just had a thought that I sould check which one of the functions is called last and execute kick from there (some kinda emulation of OnClientPreAdminCheck function from SourceMod).
Don't forget to also implement the client_disconnect forward to handle clients that disconnect between the two events.

Quote:
Originally Posted by ConnorMcLeod View Post
Quote:
Originally Posted by Teyut View Post
Fixed, thanks. I didn't know where to find the correct names.
Quote:
Originally Posted by message_const.inc
/* Hardcoded message types for message_begin()
* Look in the actual HLSDK for details!
*/
Thanks, but as the preterit tense should have implied: I've already found them .
Teyut 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:22.


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