mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD can be unreliable, catch PacketError exception.
Also set the packet size at creation not when pushing rawString, no functional change
This commit is contained in:
@@ -1897,7 +1897,7 @@ void Server::SendPlayerInventoryFormspec(u16 peer_id)
|
||||
|
||||
u32 Server::SendActiveObjectRemoveAdd(u16 peer_id, const std::string &datas)
|
||||
{
|
||||
NetworkPacket pkt(TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD, 0, peer_id);
|
||||
NetworkPacket pkt(TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD, datas.size(), peer_id);
|
||||
pkt.putRawString(datas.c_str(), datas.size());
|
||||
Send(&pkt);
|
||||
return pkt.getSize();
|
||||
@@ -1906,7 +1906,7 @@ u32 Server::SendActiveObjectRemoveAdd(u16 peer_id, const std::string &datas)
|
||||
void Server::SendActiveObjectMessages(u16 peer_id, const std::string &datas, bool reliable)
|
||||
{
|
||||
NetworkPacket pkt(TOCLIENT_ACTIVE_OBJECT_MESSAGES,
|
||||
0, peer_id);
|
||||
datas.size(), peer_id);
|
||||
|
||||
pkt.putRawString(datas.c_str(), datas.size());
|
||||
|
||||
|
Reference in New Issue
Block a user