69 {
70 int max_lenght = ChatMaxUserLength;
71 int name_lenght = params.param2.Length();
72 int text_lenght = params.param3.Length();
73 int total_lenght = text_lenght + name_lenght;
74 int channel = params.param1;
75
76 if( channel & CCSystem || channel & CCBattlEye)
77 {
79 return;
80
81 max_lenght = ChatMaxSystemLength;
82 }
83
84
85
86
87
88
89 else if( channel & CCAdmin )
90 {
92 return;
93 }
94 else if( channel & CCDirect || channel & CCMegaphone || channel & CCTransmitter || channel & CCPublicAddressSystem )
95 {
97 return;
98 }
99 else if( channel != 0 )
100 {
101 Print(
"Chat: Unknown channel " + channel);
102 return;
103 }
104
105 if (total_lenght > max_lenght)
106 {
107 int pos = 0;
108 int lenght = Math.Clamp(max_lenght - name_lenght, 0, text_lenght);
110
111 while (pos < text_lenght)
112 {
113 tmp.param3 = params.param3.Substring(pos, lenght);
115
116 tmp.param2 = "";
117 pos += lenght;
118 lenght = Math.Clamp(text_lenght - pos, 0, max_lenght);
119 }
120 }
121 else
122 {
124 }
125 }
void AddInternal(ChatMessageEventParams params)
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
proto void Print(void var)
Prints content of variable to console/log.