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

[Any] Chat-Processor (Replacement for Simple Chat Processor)


Post New Thread Reply   
 
Thread Tools Display Modes
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-02-2016 , 03:01   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #31

Quote:
Originally Posted by abrandnewday View Post
Can you show me a code snippet of how you're printing the messages because with the method I'm using (for longer multicolored chat tags) in TF2 just results in this weirdness (weirdness in the first image is from a private chat tag plugin I had commissioned from redwerewolf, second image is from chat-processor-tags, the plugin I'm working on and trying to fix this bug in so I can release it publicly)



The entirely red line is visible to everyone on the server. The multiple copies where my name is green (that's a weird "teamcolor" bug where \x03 in TF2 is apparently green and not teamcolored) are only visible to me.

The same thing happens for everyone on the server. They see one copy of the message they sent with the green name for every player on the server (so if there's 5 people on, 5 copies are sent) plus one final copy where the coloring is flatout broken and the entire message is teamcolored.

The same thing happens with the Chat-Processor Tags plugin I'm working on:



As you can see, multicolored tags that don't cut half your name off are working just fine in the plugin, but the message gets sent once for every client on the server.

Here's the code I'm using in Chat-Processor Tags:
Spoiler

I simply Format(): name, message and additionally if I want the message to be shown to everyone: recipients.Clear(); and loop through all clients
__________________
retired
shavit is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 09-02-2016 , 03:41   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #32

Quote:
Originally Posted by shavit View Post
I simply Format(): name, message and additionally if I want the message to be shown to everyone: recipients.Clear(); and loop through all clients
I'd like to do that but I can't be limited by the name limitation of 64 characters. That's why my code is the way it is, it bypasses the name length limitation entirely.
404UserNotFound is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 09-02-2016 , 13:59   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #33

Quote:
Originally Posted by abrandnewday View Post
I'd like to do that but I can't be limited by the name limitation of 64 characters. That's why my code is the way it is, it bypasses the name length limitation entirely.
tldr; He wants to take away space from the message field and put it into the name field for bigger tags with more colors.
Drixevel is offline
You9
Member
Join Date: Mar 2016
Old 09-02-2016 , 18:15   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #34

PHP Code:
public Action OnChatMessage(intauthorArrayList recipientseChatFlagsflagchar[] namechar[] messageboolbProcessColorsboolbRemoveColors)
{
    
// If Cookie_ChatTag true and IsSuperAdmin 2, then it should hide tag
    
if(Cookie_ChatTag[author] && IsSuperAdmin(author)){
        
Format(nameMAXLENGTH_NAME"{teamcolor}%s"name);
    }else{
        if(
IsOwner(author))
            
Format(nameMAXLENGTH_NAME"{red}[Owner] {teamcolor}%s"name);
        else if(
IsHeadAdmin(author))
            
Format(nameMAXLENGTH_NAME"{lightred}[Head admin] {teamcolor}%s"name);
        else if(
IsSuperAdmin(author))
            
Format(nameMAXLENGTH_NAME"{lime}[Super Admin] {teamcolor}%s"NimeTagname);
        else if(
IsVIP(author))
            
Format(nameMAXLENGTH_NAME"{green}[VIP] {teamcolor}%s"name);
        else
            
Format(nameMAXLENGTH_NAME"{teamcolor}%s"name);
    }
    
Format(messageMAX_MESSAGE_LENGTH"%s"message);
    return 
Plugin_Changed;

That code spamming the sh*t out of the chat, old chat processor redux version that was all alright
You9 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 09-05-2016 , 02:47   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #35

Quote:
Originally Posted by You9 View Post
PHP Code:
public Action OnChatMessage(intauthorArrayList recipientseChatFlagsflagchar[] namechar[] messageboolbProcessColorsboolbRemoveColors)
{
    
// If Cookie_ChatTag true and IsSuperAdmin 2, then it should hide tag
    
if(Cookie_ChatTag[author] && IsSuperAdmin(author)){
        
Format(nameMAXLENGTH_NAME"{teamcolor}%s"name);
    }else{
        if(
IsOwner(author))
            
Format(nameMAXLENGTH_NAME"{red}[Owner] {teamcolor}%s"name);
        else if(
IsHeadAdmin(author))
            
Format(nameMAXLENGTH_NAME"{lightred}[Head admin] {teamcolor}%s"name);
        else if(
IsSuperAdmin(author))
            
Format(nameMAXLENGTH_NAME"{lime}[Super Admin] {teamcolor}%s"NimeTagname);
        else if(
IsVIP(author))
            
Format(nameMAXLENGTH_NAME"{green}[VIP] {teamcolor}%s"name);
        else
            
Format(nameMAXLENGTH_NAME"{teamcolor}%s"name);
    }
    
Format(messageMAX_MESSAGE_LENGTH"%s"message);
    return 
Plugin_Changed;

That code spamming the sh*t out of the chat, old chat processor redux version that was all alright
Tested your code against the latest version and it seems to run fine. If you're running an old version of Chat-Processor or you're running Simple Chat Processor, I'd suggest you delete those and make sure you have the latest copy of Chat-Processor. (Latest version should be 1.0.9)
Drixevel is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-05-2016 , 10:58   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #36

How do I use eChatFlags &flag without causing tag mismatch errors? (unless I'm missing something)
__________________
retired
shavit is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 09-05-2016 , 11:33   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #37

Quote:
Originally Posted by shavit View Post
How do I use eChatFlags &flag without causing tag mismatch errors? (unless I'm missing something)
https://github.com/Drixevel/Chat-Pro...cessor.inc#L11

PHP Code:
enum eChatFlags
{
    
ChatFlag_Invalid,
    
ChatFlag_All,
    
ChatFlag_Team,
    
ChatFlag_Spec,
    
ChatFlag_Dead

Addicted. is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-05-2016 , 11:47   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #38

Quote:
Originally Posted by oaaron99 View Post
https://github.com/Drixevel/Chat-Pro...cessor.inc#L11

PHP Code:
enum eChatFlags
{
    
ChatFlag_Invalid,
    
ChatFlag_All,
    
ChatFlag_Team,
    
ChatFlag_Spec,
    
ChatFlag_Dead

Yeah, ((flags & ChatFlag_Team) > 0) never evaluates to true..
__________________
retired
shavit is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 09-05-2016 , 13:37   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #39

Quote:
Originally Posted by shavit View Post
Yeah, ((flags & ChatFlag_Team) > 0) never evaluates to true..
Oh I misunderstood what you were asking
Addicted. is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 09-05-2016 , 15:15   Re: [Any] Chat-Processor (Replacement for Simple Chat Processor)
Reply With Quote #40

Quote:
Originally Posted by shavit View Post
Yeah, ((flags & ChatFlag_Team) > 0) never evaluates to true..
Code:
public Action OnChatMessage(int& author, ArrayList recipients, eChatFlags& flag, char[] name, char[] message, bool& bProcessColors, bool& bRemoveColors)
{
    flag = ChatFlag_Team;
    return Plugin_Changed;
}
In hindsight, I might change the system to bit flags but I don't see the true reason here to do so.

Last edited by Drixevel; 09-05-2016 at 15:16.
Drixevel 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:45.


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