================ idGameLocal::ServerProcessReliableMessage ================ */
| 789 | ================ |
| 790 | */ |
| 791 | void idGameLocal::ServerProcessReliableMessage( int clientNum, const idBitMsg &msg ) { |
| 792 | int id; |
| 793 | |
| 794 | id = msg.ReadByte(); |
| 795 | switch( id ) { |
| 796 | case GAME_RELIABLE_MESSAGE_CHAT: |
| 797 | case GAME_RELIABLE_MESSAGE_TCHAT: { |
| 798 | char name[128]; |
| 799 | char text[128]; |
| 800 | |
| 801 | msg.ReadString( name, sizeof( name ) ); |
| 802 | msg.ReadString( text, sizeof( text ) ); |
| 803 | |
| 804 | mpGame.ProcessChatMessage( clientNum, id == GAME_RELIABLE_MESSAGE_TCHAT, name, text, NULL ); |
| 805 | |
| 806 | break; |
| 807 | } |
| 808 | case GAME_RELIABLE_MESSAGE_VCHAT: { |
| 809 | int index = msg.ReadInt(); |
| 810 | bool team = msg.ReadBits( 1 ) != 0; |
| 811 | mpGame.ProcessVoiceChat( clientNum, team, index ); |
| 812 | break; |
| 813 | } |
| 814 | case GAME_RELIABLE_MESSAGE_KILL: { |
| 815 | mpGame.WantKilled( clientNum ); |
| 816 | break; |
| 817 | } |
| 818 | case GAME_RELIABLE_MESSAGE_DROPWEAPON: { |
| 819 | mpGame.DropWeapon( clientNum ); |
| 820 | break; |
| 821 | } |
| 822 | case GAME_RELIABLE_MESSAGE_CALLVOTE: { |
| 823 | mpGame.ServerCallVote( clientNum, msg ); |
| 824 | break; |
| 825 | } |
| 826 | case GAME_RELIABLE_MESSAGE_CASTVOTE: { |
| 827 | bool vote = ( msg.ReadByte() != 0 ); |
| 828 | mpGame.CastVote( clientNum, vote ); |
| 829 | break; |
| 830 | } |
| 831 | #if 0 |
| 832 | // uncomment this if you want to track when players are in a menu |
| 833 | case GAME_RELIABLE_MESSAGE_MENU: { |
| 834 | bool menuUp = ( msg.ReadBits( 1 ) != 0 ); |
| 835 | break; |
| 836 | } |
| 837 | #endif |
| 838 | case GAME_RELIABLE_MESSAGE_EVENT: { |
| 839 | entityNetEvent_t *event; |
| 840 | |
| 841 | // allocate new event |
| 842 | event = eventQueue.Alloc(); |
| 843 | eventQueue.Enqueue( event, idEventQueue::OUTOFORDER_DROP ); |
| 844 | |
| 845 | event->spawnId = msg.ReadBits( 32 ); |
| 846 | event->event = msg.ReadByte(); |
| 847 | event->time = msg.ReadInt(); |
| 848 |
no test coverage detected