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

Function SV_ExecuteClientMessage

code/server/sv_client.cpp:542–576  ·  view source on GitHub ↗

=================== SV_ExecuteClientMessage Parse a client packet =================== */

Source from the content-addressed store, hash-verified

540===================
541*/
542void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
543 int c;
544
545 while( 1 ) {
546 if ( msg->readcount > msg->cursize ) {
547 SV_DropClient (cl, "had a badread");
548 return;
549 }
550
551 c = MSG_ReadByte( msg );
552 if ( c == -1 ) {
553 break;
554 }
555
556 switch( c ) {
557 default:
558 SV_DropClient( cl,"had an unknown command char" );
559 return;
560
561 case clc_nop:
562 break;
563
564 case clc_move:
565 SV_UserMove( cl, msg );
566 break;
567
568 case clc_clientCommand:
569 SV_ClientCommand( cl, msg );
570 if (cl->state == CS_ZOMBIE) {
571 return; // disconnect command
572 }
573 break;
574 }
575 }
576}
577
578
579void SV_FreeClient(client_t *client)

Callers 1

SV_PacketEventFunction · 0.70

Calls 4

SV_DropClientFunction · 0.70
SV_UserMoveFunction · 0.70
SV_ClientCommandFunction · 0.70
MSG_ReadByteFunction · 0.50

Tested by

no test coverage detected