From 3205a92ad872f918c8322cdcd1434c231a1fd251 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 17 Feb 2020 18:06:54 -0300 Subject: PoolVector is gone, replaced by Vector Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector`. --- modules/websocket/websocket_multiplayer_peer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'modules/websocket/websocket_multiplayer_peer.cpp') diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index 27ea50b524..5c01d44ede 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -127,12 +127,12 @@ Error WebSocketMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).put_packet/var to communicate with peers when not using the MultiplayerAPI."); - PoolVector buffer = _make_pkt(SYS_NONE, get_unique_id(), _target_peer, p_buffer, p_buffer_size); + Vector buffer = _make_pkt(SYS_NONE, get_unique_id(), _target_peer, p_buffer, p_buffer_size); if (is_server()) { - return _server_relay(1, _target_peer, &(buffer.read()[0]), buffer.size()); + return _server_relay(1, _target_peer, &(buffer.ptr()[0]), buffer.size()); } else { - return get_peer(1)->put_packet(&(buffer.read()[0]), buffer.size()); + return get_peer(1)->put_packet(&(buffer.ptr()[0]), buffer.size()); } } @@ -183,16 +183,16 @@ void WebSocketMultiplayerPeer::_send_sys(Ref p_peer, uint8_t p_ty ERR_FAIL_COND(!p_peer.is_valid()); ERR_FAIL_COND(!p_peer->is_connected_to_host()); - PoolVector message = _make_pkt(p_type, 1, 0, (uint8_t *)&p_peer_id, 4); - p_peer->put_packet(&(message.read()[0]), message.size()); + Vector message = _make_pkt(p_type, 1, 0, (uint8_t *)&p_peer_id, 4); + p_peer->put_packet(&(message.ptr()[0]), message.size()); } -PoolVector WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size) { +Vector WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size) { - PoolVector out; + Vector out; out.resize(PROTO_SIZE + p_data_size); - PoolVector::Write w = out.write(); + uint8_t *w = out.ptrw(); copymem(&w[0], &p_type, 1); copymem(&w[1], &p_from, 4); copymem(&w[5], &p_to, 4); -- cgit v1.2.3