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

[CS:GO] Weird problem with SayText(2) & simple-chatprocessor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 02-28-2016 , 15:29   [CS:GO] Weird problem with SayText(2) & simple-chatprocessor
Reply With Quote #1

Hello,

I am currently investigating an issue where messages sent by players in spectator get "eaten" by the server, aka. nobody apart from players in spec can actually see it.
This wouldn't be so much of a problem, if it wouldn't only affect certain maps/other weird combinations.

Code:
PHP Code:
public Action:OnChatMessage(&authorHandle:recipientsString:name[], String:message[])
{
    if(!
g_bSimpleChatProcessor)
        return 
Plugin_Continue;
    
    if(!
g_iEnabled || !g_bAuthed[author] || !g_iDisplayMethod)
        return 
Plugin_Continue;
    
    
LogMessage("CALLED - author team: %d"GetClientTeam(author));
    
LogMessage("author: %d, FLAG: %d, newmsg: %d, allchat: %d"authorGetMessageFlags() & CHATFLAGS_SPECg_bNewMsgg_bAllchat);
    
    if(
author && GetMessageFlags() & CHATFLAGS_SPEC && g_bNewMsg && g_bAllchat)
    {
        
g_bNewMsg false;
        new 
iSize GetArraySize(recipients);
        if(
g_iEnabled == 2)
        {
            
LogMessage("Debug: Spec chat %d recipients:"iSize);
            for(new 
i=0;i<iSize;i++)
                
LogMessage("Debug: client (%d) %N (team %d)"GetArrayCell(recipientsi), GetArrayCell(recipientsi), GetClientTeam(GetArrayCell(recipientsi)));
        }
        
        for (new 
1<= MaxClientsi++)
        {
            if (
Client_IsValid(i) && IsClientInGame(i) && GetClientTeam(i) > CS_TEAM_SPECTATOR)
            {
                if(
FindValueInArray(recipientsi) == -1)
                {
                    
PushArrayCell(recipientsi);
                }
            }
        }
        
        if(
g_iEnabled == 2)
        {
            
LogMessage("CALLED - author team: %d"GetClientTeam(author));
            
LogMessage("author: %d, FLAG: %d, newmsg: %d, allchat: %d"authorGetMessageFlags() & CHATFLAGS_SPECg_bNewMsgg_bAllchat);
    
            
iSize GetArraySize(recipients);
            
LogMessage("Debug: POST Spec chat %d recipients:"iSize);
            for(new 
i=0;i<iSize;i++)
                
LogMessage("Debug: POST client (%d) %N (team %d)"GetArrayCell(recipientsi), GetArrayCell(recipientsi), GetClientTeam(GetArrayCell(recipientsi)));
        }
    }
[...] 
Now, when looking in the logs for one of the affected maps (surf_happyhands2), I can see this when a spec writes (11 people on the server):
Code:
L 02/28/2016 - 21:13:58: [timer-rankings.smx] CALLED - author team: 1
L 02/28/2016 - 21:13:58: [timer-rankings.smx] author: 12, FLAG: 4, newmsg: 1, allchat: 1
While a "normale message" (CT/T), same map looks like this:
Code:
L 02/28/2016 - 21:14:01: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:01: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:01: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:01: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:01: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:01: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:01: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:01: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:01: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:01: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:04: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:04: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:04: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:04: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:04: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:04: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:04: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:04: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
L 02/28/2016 - 21:14:04: [timer-rankings.smx] CALLED - author team: 2
L 02/28/2016 - 21:14:04: [timer-rankings.smx] author: 11, FLAG: 0, newmsg: 1, allchat: 1
Now, if I go to a working map (surf_beginner), I can see this for specs:

Code:
L 02/28/2016 - 21:09:14: [timer-rankings.smx] CALLED - author team: 1
L 02/28/2016 - 21:09:14: [timer-rankings.smx] author: 2, FLAG: 4, newmsg: 1, allchat: 0
L 02/28/2016 - 21:09:14: [timer-rankings.smx] CALLED - author team: 1
L 02/28/2016 - 21:09:14: [timer-rankings.smx] author: 2, FLAG: 4, newmsg: 1, allchat: 0
You see, spec messages are also sent for each player on the server (at the time, there were two people), while in the not working case, only once.
Therefore, the hack you can see in the code is needed, which works. The only problem is, that on working maps (like surf_beginner), the messages are then printed twice (multiple sent + multiple recipients).

Does anyone know what could be causing that (maybe a CVar I am missing)?
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster 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 04:49.


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