forked from Mirrorlandia_minetest/minetest
Use a Buffer instead of SharedBuffer in ConnectionCommand
This fixes #6373
This commit is contained in:
parent
f231112cc4
commit
a3c298e1d1
@ -325,7 +325,7 @@ struct ConnectionCommand
|
|||||||
Address address;
|
Address address;
|
||||||
u16 peer_id = PEER_ID_INEXISTENT;
|
u16 peer_id = PEER_ID_INEXISTENT;
|
||||||
u8 channelnum = 0;
|
u8 channelnum = 0;
|
||||||
SharedBuffer<u8> data;
|
Buffer<u8> data;
|
||||||
bool reliable = false;
|
bool reliable = false;
|
||||||
bool raw = false;
|
bool raw = false;
|
||||||
|
|
||||||
|
@ -168,6 +168,18 @@ public:
|
|||||||
/*
|
/*
|
||||||
Copies whole buffer
|
Copies whole buffer
|
||||||
*/
|
*/
|
||||||
|
SharedBuffer(const Buffer<T> &buffer)
|
||||||
|
{
|
||||||
|
m_size = buffer.getSize();
|
||||||
|
if (m_size != 0) {
|
||||||
|
data = new T[m_size];
|
||||||
|
memcpy(data, *buffer, buffer.getSize());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
data = NULL;
|
||||||
|
refcount = new unsigned int;
|
||||||
|
(*refcount) = 1;
|
||||||
|
}
|
||||||
~SharedBuffer()
|
~SharedBuffer()
|
||||||
{
|
{
|
||||||
drop();
|
drop();
|
||||||
|
Loading…
Reference in New Issue
Block a user