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

Method ServerProcessReliableMessage

neo/d3xp/Game_network.cpp:805–879  ·  view source on GitHub ↗

================ idGameLocal::ServerProcessReliableMessage ================ */

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

WarningFunction · 0.85
ReadByteAlignMethod · 0.80
ReadByteMethod · 0.45
ReadStringMethod · 0.45
ProcessChatMessageMethod · 0.45
ReadIntMethod · 0.45
ReadBitsMethod · 0.45
ProcessVoiceChatMethod · 0.45
WantKilledMethod · 0.45
DropWeaponMethod · 0.45
ServerCallVoteMethod · 0.45
CastVoteMethod · 0.45

Tested by

no test coverage detected