mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00: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:
parent
ed3ebd633d
commit
8804c47e59
2 changed files with 22 additions and 17 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue