AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [DEV] Cider Chat Processor (https://forums.alliedmods.net/showthread.php?t=315443)

Mitchell 04-08-2019 17:50

[DEV] Cider Chat Processor
 
Cider Chat Processor

Just another SayText2 hook and forward plugin. The reason this exists is primarily because I've had so many issues with the other chat processors available. I needed something that could also change the recipients before any other plugin added chat colors etc, and manage dead chat properly. Also needed it to disable say_team theoretically, so the other team can see it (without the prefix of (TEAM)).

This plugin contains a few bug fixes that other processors do not contain that should prevent any exploits of players adding colors to their chat without help from a server plugin.

This is pretty much a simpler version of r3dw3r3w0lf's Chat Processor plugin, I've been sitting on this for a few years now and figured since I finished my own chat plugin I'll need to release this also.

This plugin is just a forwarder and will strip all unicode characters < 17 (except the terminator) from the name and message. This also doesn't use random crap includes like color variables, why the hell would a SayText2 forwarder need to assign colors anyways, that's the job for the plugin that it's forwarding to... /rant

Keep in mind this was created with TF2 testing, I only did minimal testing on csgo and haven't tried some of the changes I've pushed recently.

Also Special thanks to Drixevel and his processor, if the changes I needed weren't so different this would have just been a pull request to his processor.

Why 'Cider'
When creating this I was drinking some cider. Yee yee

Server Operator ConVar Config
Code:

//Enable Cider Chat Processor
sm_ccp_enable "1" 

//Name of the message formats config, incase you have some where else you want to put this?
sm_ccp_config "configs/chat_processor.cfg"

//Dead chat is seen by alive players.
// (WARNING) a module plugin can use CCP_OnChatMessagePre or CCP_OnChatMessage to change the array of recipients.
sm_ccp_deadchat "1"   

//Team chat isn't seen by other team
// 0 - Disabled, say_team isn't converted to All Chat.
// 1 - No Filter, all team's say_team is converted to All Chat.
// 2 - Team 2's chat is converted to All Chat.
// 3 - Team 3's chat is converted to All Chat.
sm_ccp_teamchat "0"

Developer Forwards
Code:

/**
* Called before CCP_OnChatMessage, useful to check the author and stop the message or change whose in the recipients ArrayList.
* flagstring can also be changed to make the message appear from an alive person etc.
* recipients contains userIds, by default it is filled matching the processors config file.
**/
forward Action CCP_OnChatMessagePre(int& author, ArrayList recipients, char[] flagstring);

/**
* Called while sending a chat message before It's sent to all recipients.
* This is where a chat manager plugin can change the name and message to add colors etc.
* Changing author to -1 will make {03} purple instead of team color (On CS:GO engine).
**/
forward Action CCP_OnChatMessage(int& author, ArrayList recipients, char[] flagstring, char[] name, char[] message);

/**
* Called after the chat message is sent to the designated clients by the author.
**/
forward void CCP_OnChatMessagePost(int author, ArrayList recipients, const char[] flagstring, const char[] formatstring, const char[] name, const char[] message);

Releases (Plugin)
GitHub (Source)

Drixevel 04-08-2019 17:59

Re: [DEV] Cider Chat Processor
 
nice release

Mitchell 04-08-2019 19:29

Re: [DEV] Cider Chat Processor
 
Added in thanks message to Drixevel for his chat-processor this was base off of.

Arkarr 04-09-2019 09:26

Re: [DEV] Cider Chat Processor
 
2011: OnChatMessage
2012: OnChatMessage
2016: CP_OnChatMessage
2019: CCP_OnChatMessage
2048: CCCCCCCCCCCCCP_OnChatMessage

:fox:

Anyway, sounds like we are blessed with a lot of your creations, thanks.

EDIT:
I didn't find any logic way of the growing of 'C' every years.

Dragokas 04-09-2019 10:23

Re: [DEV] Cider Chat Processor
 
Nice :) Thank you.

Mitchell 04-12-2019 18:47

Re: [DEV] Cider Chat Processor
 
Release v1.0.3 Changelog:
  • Fixed issue with team chat not properly handling the color unicodes
  • Default behavior without a chat manager will set the color back to default after the name.

Download:
Github Tag


All times are GMT -4. The time now is 01:21.

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