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

[CSS] NetChannel error (console spam, kick client) - hud hint


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
slava123
Junior Member
Join Date: Apr 2022
Location: zm_crazycity
Old 09-12-2022 , 08:19   [CSS] NetChannel error (console spam, kick client) - hud hint
Reply With Quote #1

Hi I made a simple plugin yesterday to show a message for each client every 0.5s using this function in smlib <Client_PrintKeyHintText> and I made an option in !settings so the client can disable it, it was working just fine later these problems come up:

spam in console: Netchannel: failed reading message svc_usermessage <serverip>
and the server starts kicking the players

PHP Code:
    for (int i 1<= MaxClientsi++)
    {
        if(
IsClientConnected(i) && IsClientInGame(i) && g_bClientPrefDisplay[i])
        {
            
Client_PrintKeyHintText(i"%t""Servers");
        }
    } 
in smlib include
PHP Code:
/**
 * Prints white text to the right-center side of the screen
 * for one client. Does not work in all games.
 * Line Breaks can be done with "\n".
 * 
 * @param client        Client Index.
 * @param format        Formatting rules.
 * @param ...            Variable number of format parameters.
 * @return                True on success, false if this usermessage doesn't exist.
 */
stock bool:Client_PrintKeyHintText(client, const String:format[], any:...)
{
    new 
Handle:userMessage StartMessageOne("KeyHintText"client);
    
    if (
userMessage == INVALID_HANDLE) {
        return 
false;
    }

    
decl String:buffer[254];

    
SetGlobalTransTarget(client);
    
VFormat(buffersizeof(buffer), format3);

    if (
GetFeatureStatus(FeatureType_Native"GetUserMessageType") == FeatureStatus_Available
        
&& GetUserMessageType() == UM_Protobuf) {

        
PbSetString(userMessage"hints"buffer);
    }
    else {
        
BfWriteByte(userMessage1); 
        
BfWriteString(userMessagebuffer); 
    }

    
EndMessage();
    
    return 
true;

any idea how to make this work? I can't use Client_PrintKeyHintTextToAll because of client specific requirements.

Last edited by slava123; 09-12-2022 at 08:26.
slava123 is offline
LinLinLin
Senior Member
Join Date: Sep 2021
Old 09-12-2022 , 13:24   Re: [CSS] NetChannel error (console spam, kick client) - hud hint
Reply With Quote #2

maybe not a pluging error ?
"Client_PrintKeyHintText" only create a hinttext usermessage for player , which you can do the same work in your plugins , and there is no code about kick client .

check server setting maybe helpful .
LinLinLin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-12-2022 , 14:54   Re: [CSS] NetChannel error (console spam, kick client) - hud hint
Reply With Quote #3

...you are flooding client with those messages. That is why they get kicked.
__________________
Do not Private Message @me
Bacardi is offline
slava123
Junior Member
Join Date: Apr 2022
Location: zm_crazycity
Old 09-12-2022 , 16:10   Re: [CSS] NetChannel error (console spam, kick client) - hud hint
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
...you are flooding clients with those messages. That is why they get kicked.
I set the timer to 0.5 is that the reason? I mean if I set it to 2 or 3 seconds, that should fix the problem?

PHP Code:
public OnClientPutInServer(client)
{
    
CreateTimer(0.5PrintToHintHudclientTIMER_REPEAT);

slava123 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-12-2022 , 19:55   Re: [CSS] NetChannel error (console spam, kick client) - hud hint
Reply With Quote #5

Try it
__________________
Do not Private Message @me
Bacardi 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 18:41.


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