Hello,
First:About timeout, Xfennec says
Quote:
No timeout on client side, currently. This should be done, during and after connexion to the server.
So i implement a null packet keepalive, with a new packet type. The period is actually half the timeout period.
Ancient netcode is bugged, with nelem=0 a packet is send but data are not initialised. So a "random" packet is send over the network (from my point of vue). This can cause lot's of problems, if for example some fields are correct and some other not.
Creating a
"keep alive" packet is needed (i thought). Sending this keep alive packet at normal packet period is perhaps better than waiting timeout/2.
Secondly:Pre existant element are not send over the network. Their
nid is -1 as the network is not "connected" when element is created.
Then thoses packet are never send over network api, so no NIDWHO ...
As network api support well hot network connection (i make lot's of test about this). This point is really ennoying.
Here is my reverse engenering of network api, hope i'm not wrong !!!Actually element nid can have two type of value: >1000 and -1
ode_net.c line 487. As it use (raydium_network_uid+1) all network(ed) element will have an nid>1000.
It seem that somewhere in the code element filtering use 1000 as trigger value. I can't find reference now.
The idea is: nid==-1 element is not networked at all.
nid >=0 and <=1000 element is "ready" for network. Just waiting network connection.
nid>1000 normal behavior.
Line 180 in ode_net.c is client time_out handling.
If no element need to be send and timeout/2 time elapsed i send a dummy packet. type RAYDIUM_NETWORK_PACKET_KEEP_ALIVE_CLIENT
To avoid random data in the packet i fill with raydium_network_uid which is a value as an other but fixed.
Hope this clarify a bit things.
I made lot's of tests about thoses modification, on local network but with wide load charge. It not enough for sure, but it work quite well for cases tested.
i'll continue to work on it when we found the correct solution ok ?
Have a nice day
Ouille