projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow server-side teleporting
[oweals/minetest.git]
/
src
/
connection.cpp
diff --git
a/src/connection.cpp
b/src/connection.cpp
index 31c0f77a353279f25d20e58b92600f3d71ad89d4..b9c5d2ac8bac413c1264ac6746e873fca0c471e7 100644
(file)
--- a/
src/connection.cpp
+++ b/
src/connection.cpp
@@
-1577,7
+1577,7
@@
void Connection::Disconnect()
putCommand(c);
}
putCommand(c);
}
-u32 Connection::Receive(u16 &peer_id,
u8 *data, u32 datasize
)
+u32 Connection::Receive(u16 &peer_id,
SharedBuffer<u8> &data
)
{
for(;;){
ConnectionEvent e = waitEvent(m_bc_receive_timeout);
{
for(;;){
ConnectionEvent e = waitEvent(m_bc_receive_timeout);
@@
-1589,7
+1589,7
@@
u32 Connection::Receive(u16 &peer_id, u8 *data, u32 datasize)
throw NoIncomingDataException("No incoming data");
case CONNEVENT_DATA_RECEIVED:
peer_id = e.peer_id;
throw NoIncomingDataException("No incoming data");
case CONNEVENT_DATA_RECEIVED:
peer_id = e.peer_id;
-
memcpy(data, *e.data, e.data.getSize()
);
+
data = SharedBuffer<u8>(e.data
);
return e.data.getSize();
case CONNEVENT_PEER_ADDED: {
Peer tmp(e.peer_id, e.address);
return e.data.getSize();
case CONNEVENT_PEER_ADDED: {
Peer tmp(e.peer_id, e.address);