e_event_results.c
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "../../../../client.h"
00026 #include "../../../../cl_game.h"
00027 #include "e_event_results.h"
00028
00035 void CL_ParseResults (const eventRegister_t *self, struct dbuffer *msg)
00036 {
00037 int winner;
00038 int i, j, num;
00039 int num_spawned[MAX_TEAMS];
00040 int num_alive[MAX_TEAMS];
00041
00042 int num_kills[MAX_TEAMS][MAX_TEAMS];
00043 int num_stuns[MAX_TEAMS][MAX_TEAMS];
00044
00045 memset(num_spawned, 0, sizeof(num_spawned));
00046 memset(num_alive, 0, sizeof(num_alive));
00047 memset(num_kills, 0, sizeof(num_kills));
00048 memset(num_stuns, 0, sizeof(num_stuns));
00049
00050
00051 num = NET_ReadByte(msg);
00052 if (num > MAX_TEAMS)
00053 Com_Error(ERR_DROP, "Too many teams in result message");
00054
00055 Com_DPrintf(DEBUG_CLIENT, "Receiving results with %i teams.\n", num);
00056
00057
00058 winner = NET_ReadByte(msg);
00059
00060 if (cls.team > num)
00061 Com_Error(ERR_DROP, "Team number %d too high (only %d teams)", cls.team, num);
00062
00063
00064 for (i = 0; i < num; i++) {
00065 num_spawned[i] = NET_ReadByte(msg);
00066 num_alive[i] = NET_ReadByte(msg);
00067 }
00068
00069
00070 for (i = 0; i < num; i++)
00071 for (j = 0; j < num; j++)
00072 num_kills[i][j] = NET_ReadByte(msg);
00073
00074
00075 for (i = 0; i < num; i++)
00076 for (j = 0; j < num; j++)
00077 num_stuns[i][j] = NET_ReadByte(msg);
00078
00079 GAME_HandleResults(msg, winner, num_spawned, num_alive, num_kills, num_stuns);
00080 }