MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ServerSendChatMessage

Method ServerSendChatMessage

neo/game/Game_network.cpp:770–784  ·  view source on GitHub ↗

================ idGameLocal::ServerSendChatMessage ================ */

Source from the content-addressed store, hash-verified

768================
769*/
770void idGameLocal::ServerSendChatMessage( int to, const char *name, const char *text ) {
771 idBitMsg outMsg;
772 byte msgBuf[ MAX_GAME_MESSAGE_SIZE ];
773
774 outMsg.Init( msgBuf, sizeof( msgBuf ) );
775 outMsg.BeginWriting();
776 outMsg.WriteByte( GAME_RELIABLE_MESSAGE_CHAT );
777 outMsg.WriteString( name );
778 outMsg.WriteString( text, -1, false );
779 networkSystem->ServerSendReliableMessage( to, outMsg );
780
781 if ( to == -1 || to == localClientNum ) {
782 mpGame.AddChatLine( "%s^0: %s\n", name, text );
783 }
784}
785
786/*
787================

Callers 3

CastVoteMethod · 0.45
ServerCallVoteMethod · 0.45
EnterGameMethod · 0.45

Calls 6

BeginWritingMethod · 0.80
InitMethod · 0.45
WriteByteMethod · 0.45
WriteStringMethod · 0.45
AddChatLineMethod · 0.45

Tested by

no test coverage detected