Server is telling us about players that we can see
| 6242 | |
| 6243 | // Server is telling us about players that we can see |
| 6244 | void MultiDoVisiblePlayers(uint8_t *data) { |
| 6245 | int count = 0; |
| 6246 | int i; |
| 6247 | |
| 6248 | if (Netgame.local_role == LR_SERVER) |
| 6249 | return; |
| 6250 | |
| 6251 | SKIP_HEADER(data, &count); |
| 6252 | |
| 6253 | int bitmask = MultiGetUint(data, &count); |
| 6254 | |
| 6255 | MULTI_ASSERT_NOMESSAGE(MAX_NET_PLAYERS <= 32); |
| 6256 | |
| 6257 | for (i = 0; i < MAX_NET_PLAYERS; i++) { |
| 6258 | int hide_it = 0; |
| 6259 | |
| 6260 | if (i == Player_num) |
| 6261 | continue; |
| 6262 | |
| 6263 | if (!(NetPlayers[i].flags & NPF_CONNECTED) || NetPlayers[i].sequence != NETSEQ_PLAYING) |
| 6264 | hide_it = 1; |
| 6265 | |
| 6266 | if (!(bitmask & (1 << i)) || hide_it) { |
| 6267 | if (Objects[Players[i].objnum].type == OBJ_PLAYER || hide_it) { |
| 6268 | // Kill all the sounds, render types, etc. |
| 6269 | Objects[Players[i].objnum].render_type = RT_NONE; |
| 6270 | Objects[Players[i].objnum].movement_type = MT_NONE; |
| 6271 | Objects[Players[i].objnum].mtype.phys_info.flags |= PF_NO_COLLIDE; |
| 6272 | Objects[Players[i].objnum].weapon_fire_flags &= ~(WFF_ON_OFF | WFF_SPRAY); |
| 6273 | Players[i].flags &= ~(PLAYER_FLAGS_AFTERBURN_ON | PLAYER_FLAGS_THRUSTED); |
| 6274 | PlayerStopSounds(i); |
| 6275 | } |
| 6276 | } else { |
| 6277 | if (Objects[Players[i].objnum].type == OBJ_PLAYER) { |
| 6278 | Objects[Players[i].objnum].render_type = RT_POLYOBJ; |
| 6279 | Objects[Players[i].objnum].movement_type = MT_PHYSICS; |
| 6280 | Objects[Players[i].objnum].mtype.phys_info.flags &= ~PF_NO_COLLIDE; |
| 6281 | } |
| 6282 | } |
| 6283 | } |
| 6284 | } |
| 6285 | |
| 6286 | // Sends all the visible players to another player |
| 6287 | void MultiSendVisiblePlayers(int to_slot) { |
no test coverage detected