Possible packet improvements?
#1
How is MCServer sending packets at this moment? Are they being queued up and sent after the tick has happened, or are they being sent as soon as something happens that needs them?
Reply
Thanks given by:
#2
The packet is written to a buffer when it is "sent" by the cClientHandle / cProtocol classes. Then another thread is notified that outgoing data is ready, and that thread then takes care of sending as much data as possible to the client. See for example the cProtocol172::SendData() function, that is called to send each packet's raw data, it calls cClientHandle::SendData(), which queues the outgoing data in two buffers (a fast ringbuffer and a dynamically-allocated overflow buffer, then it notifies the cServer::cNotifyWriteThread that it should send the data for this client.
Reply
Thanks given by:
#3
Do you think there might be any benefit to queueing up block changes by chunk and then sending them with Multi Block Change packet after the tick is done?
Reply
Thanks given by:
#4
I think that is already done now, let me check again.

Yup, that is already done, cChunk::m_PendingSendBlocks is the per-chunk queue for the changes.
Reply
Thanks given by:
#5
Ok. Anyone got any ideas on how to make packet handling better?
Reply
Thanks given by:
#6
Why, do you have an issue with its current state? I think it's good enough.
Reply
Thanks given by:
#7
Well, I can't remember if this was part of the AI development or the mob spawning merge, but you mentioned that the packet handling was slow and could be better. I'm trying to find that conversation now.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)