======================= SV_SendClientSnapshot ======================= */
| 664 | ======================= |
| 665 | */ |
| 666 | void SV_SendClientSnapshot( client_t *client ) { |
| 667 | byte msg_buf[MAX_MSGLEN]; |
| 668 | msg_t msg; |
| 669 | |
| 670 | // build the snapshot |
| 671 | SV_BuildClientSnapshot( client ); |
| 672 | |
| 673 | // bots need to have their snapshots build, but |
| 674 | // the query them directly without needing to be sent |
| 675 | if ( client->gentity && client->gentity->svFlags & SVF_BOT ) { |
| 676 | return; |
| 677 | } |
| 678 | |
| 679 | MSG_Init (&msg, msg_buf, sizeof(msg_buf)); |
| 680 | msg.allowoverflow = qtrue; |
| 681 | |
| 682 | // (re)send any reliable server commands |
| 683 | SV_UpdateServerCommandsToClient( client, &msg ); |
| 684 | |
| 685 | // send over all the relevant entityState_t |
| 686 | // and the playerState_t |
| 687 | SV_WriteSnapshotToClient( client, &msg ); |
| 688 | |
| 689 | // check for overflow |
| 690 | if ( msg.overflowed ) { |
| 691 | Com_Printf ("WARNING: msg overflowed for %s\n", client->name); |
| 692 | MSG_Clear (&msg); |
| 693 | } |
| 694 | |
| 695 | SV_SendMessageToClient( &msg, client ); |
| 696 | } |
| 697 | |
| 698 | |
| 699 | /* |
no test coverage detected