Posts: 34
Threads: 2
Joined: Mar 2012
Thanks: 1
Given 3 thank(s) in 3 post(s)
So you're not planning to physically divide packet-event handling to different files for each protocol? Just implementing some minor differences (to use encyption or not) between two last versions of client in one place? If so, why bother? Is there any real reason to temporary keep older version in use?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
They will be in different files - each protocol will be handled by one class, each class in a separate file. I'll be reusing protocol classes by deriving the new one from the old one, thus the new one will only implement the changes.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
08-16-2012, 05:54 AM
(This post was last modified: 08-16-2012, 06:32 AM by xoft.)
One thing has started to bother me now. Currently the client is capable of doing selective packet removal - if there are two packets containing moves for the same entity, the earlier packet is dropped and never sent, because the later packet would invalidate it anyway. This saves (surprisingly quite a lot of) bandwidth. But with the new architecture this would be difficult to maintain. If the command did serialize the packet immediately, it would be impossible to later remove that packet from the stream.
The only solution that I can see is to modify the entity move command caller not to emit that command that often - don't move the entity 20 times a second, but only 5 times a second, for example.
I take back the importance of this. I've just tried adding some statistics and the RelEntMoveLook packet is currently not optimized away any single time in over 15000 packets sent. True, that's for a LAN session, WAN results may still vary.
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
It did drop a lot of packets on my server, that's why I implemented that feature :O
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Maybe it was in the time when the server was not properly multithreaded and the generator and lighting were slow. This could've caused the outgoing packet queue to grow. Nowadays the packet leave the server almost as soon as they are queued.