MCPcopy Create free account
hub / github.com/JACoders/OpenJK / MSG_WriteString

Function MSG_WriteString

codemp/qcommon/msg.cpp:333–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void MSG_WriteString( msg_t *sb, const char *s ) {
334 if ( !s ) {
335 MSG_WriteData (sb, "", 1);
336 } else {
337 int l;
338 char string[MAX_STRING_CHARS];
339
340 l = strlen( s );
341 if ( l >= MAX_STRING_CHARS ) {
342 Com_Printf( "MSG_WriteString: MAX_STRING_CHARS" );
343 MSG_WriteData (sb, "", 1);
344 return;
345 }
346 Q_strncpyz( string, s, sizeof( string ) );
347
348// eurofix: eliminating this means you can chat in european languages. WTF are "old clients" anyway? -ste
349//
350// // get rid of 0xff chars, because old clients don't like them
351// for ( int i = 0 ; i < l ; i++ ) {
352// if ( ((byte *)string)[i] > 127 ) {
353// string[i] = '.';
354// }
355// }
356
357 MSG_WriteData (sb, string, l+1);
358 }
359}
360
361void MSG_WriteBigString( msg_t *sb, const char *s ) {
362 if ( !s ) {

Callers 3

CL_WritePacketFunction · 0.50
SV_WriteDownloadToClientFunction · 0.50

Calls 3

Q_strncpyzFunction · 0.85
MSG_WriteDataFunction · 0.70
Com_PrintfFunction · 0.70

Tested by

no test coverage detected