We're asking the servers permission to fire
| 8752 | |
| 8753 | // We're asking the servers permission to fire |
| 8754 | void MultiSendRequestToFire(int wb_index, int fire_mask, float scalar) { |
| 8755 | // Send quaded info if needed |
| 8756 | uint8_t index_to_send = wb_index; |
| 8757 | |
| 8758 | if (Objects[Players[Player_num].objnum].dynamic_wb[wb_index].flags & DWBF_QUAD) |
| 8759 | index_to_send |= MPFF_QUADED; |
| 8760 | |
| 8761 | uint8_t damage_scalar = (scalar * 64.0); |
| 8762 | |
| 8763 | int count = 0; |
| 8764 | uint8_t data[MAX_GAME_DATA_SIZE]; |
| 8765 | int size_offset; |
| 8766 | size_offset = START_DATA(MP_REQUEST_TO_FIRE, data, &count); |
| 8767 | |
| 8768 | MultiAddByte(Player_num, data, &count); |
| 8769 | MultiAddUbyte(index_to_send, data, &count); |
| 8770 | MultiAddUbyte(fire_mask, data, &count); |
| 8771 | MultiAddUbyte(damage_scalar, data, &count); |
| 8772 | |
| 8773 | END_DATA(count, data, size_offset); |
| 8774 | |
| 8775 | if (Netgame.local_role == LR_SERVER) { |
| 8776 | MultiDoRequestToFire(data); |
| 8777 | } else { |
| 8778 | #ifdef RELIABLE_SECONDARIES |
| 8779 | // should we send reliably? (secondaries) |
| 8780 | if ((wb_index >= SECONDARY_INDEX) && (wb_index != FLARE_INDEX)) { |
| 8781 | // send reliably |
| 8782 | // mprintf(0,"PCS: Sending fire request reliably\n"); |
| 8783 | nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, true); |
| 8784 | } else |
| 8785 | #endif |
| 8786 | { |
| 8787 | nw_Send(&Netgame.server_address, data, count, 0); |
| 8788 | } |
| 8789 | } |
| 8790 | } |
| 8791 | |
| 8792 | // Server is processing a request for a marker |
| 8793 | void MultiDoRequestMarker(uint8_t *data) { |
no test coverage detected