Merge pull request #14708 from Faless/get_packet_not_const_rebased

Remove "const" from PacketPeer get_packet/get_var, move windows network related stuff to drivers
This commit is contained in:
Rémi Verschelde 2017-12-16 00:05:18 +01:00 committed by GitHub
commit cf7bd1a7e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 90 additions and 80 deletions

View file

@ -386,7 +386,7 @@ int NetworkedMultiplayerENet::get_available_packet_count() const {
return incoming_packets.size();
}
Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buffer_size) const {
Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
ERR_FAIL_COND_V(incoming_packets.size() == 0, ERR_UNAVAILABLE);
@ -480,7 +480,7 @@ int NetworkedMultiplayerENet::get_max_packet_size() const {
return 1 << 24; //anything is good
}
void NetworkedMultiplayerENet::_pop_current_packet() const {
void NetworkedMultiplayerENet::_pop_current_packet() {
if (current_packet.packet) {
enet_packet_destroy(current_packet.packet);

View file

@ -86,12 +86,12 @@ private:
CompressionMode compression_mode;
mutable List<Packet> incoming_packets;
List<Packet> incoming_packets;
mutable Packet current_packet;
Packet current_packet;
uint32_t _gen_unique_id() const;
void _pop_current_packet() const;
void _pop_current_packet();
Vector<uint8_t> src_compressor_mem;
Vector<uint8_t> dst_compressor_mem;
@ -123,7 +123,7 @@ public:
virtual bool is_server() const;
virtual int get_available_packet_count() const;
virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) const; ///< buffer is GONE after next get_packet
virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); ///< buffer is GONE after next get_packet
virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size);
virtual int get_max_packet_size() const;