added ubc channel and broadcasting of dirty devices#79
Conversation
i think sending the udp packet once then marking devices clean is not good idea unless the device is updating frequently enough that it doesnt matter
|
|
||
| case rec_proto.RECMessageType.REC_REGISTER_SESSION: | ||
| client_ip = client.ClientAddress[0] | ||
| self.ubc_channel.register(client.SessionId, (client_ip, 1312)) |
There was a problem hiding this comment.
the client won't be listening for UBC packets on 1312, but on an os- (or nat-)generated port, the registration flow will need to be changed, aiui it'll be as follows:
- client sends a keepalive packet to the server on ubc/uec (yes that would be the only c2s packet for ubc)
- server starts sending UBC/UEC packets to the new client host:port combo, including a session id
- client registers the session id over REC, linking the clients session to the client host:port combo for UBC/UEC
the exact details still need to be written in the spec, so this pr can't really be finished until then
@Stefan-5422 is the above correct?
There was a problem hiding this comment.
-
The port 1312 is fine the port conversion/resolve is done by the operating system/nat. Correct, check the port addociated with the sessionid for correct port. -
The channel does only send a reply to the keepalive not any other packages until registered.
-
Correct
There was a problem hiding this comment.
the client won't be listening for UBC packets on 1312, but on an os- (or nat-)generated port, the registration flow will need to be changed, aiui it'll be as follows:
1. client sends a keepalive packet to the server on ubc/uec (yes that would be the only c2s packet for ubc) 2. server starts sending UBC/UEC packets to the new client host:port combo, including a session id 3. client registers the session id over REC, linking the clients session to the client host:port combo for UBC/UECthe exact details still need to be written in the spec, so this pr can't really be finished until then @Stefan-5422 is the above correct?
this is known, however i wanted this implemented now so i can continue working on the client
|
perhaps another issue but not sure where to place it: UDP has a max packet size (the MTU), there's no protection against packets going above it i believe the rest is fine |
Stefan-5422
left a comment
There was a problem hiding this comment.
Same concerns as @RedstoneParkour see comment replies. Also the transmission for this works under the principle that all data changes frequently, Maybe we should think of a sheme where a part (M%) of all devices gets sent along every N updates to avoid desyncs, i.e all clients get every device every 1/M*N updates.
|
Also I would be willing to merge thid before the protobug changes so that @watchful5406 can continue testing and implementing his 2D client |
Perhaps something like https://gafferongames.com/post/state_synchronization/#priority-accumulator would work? The packets for updated devices would have a higher priority (for the tick they got updated) than non-updated devices. Though something like i'm suggesting should really be deferred for the future, maybe just dont test with too many devices at once :P |
I meant ontop of dirty updates |
maybe add a property if a device has a high frequency change rate and a low frequency and update the low frequency change rate devices no matter thier dirty status every 1 second (60 ticks) |
Also not a bad idea since refreshing high refresh rate items doesn't really do anything. Maybe this is settable per device type, since there probably arent any outliers there? |
|
What is this waiting on btw? |
I believe just https://gitlab.com/westfield-simulations/dose/spec/-/work_items/5 |
watchful told me to wait until the docs update |
|
with the update of the spec, we need to add heartbeat. i'll update the protobuf again |
todo: registering UBC session
Co-authored-by: RedstoneParkour <39594309+RedstoneParkour@users.noreply.github.com>
|
hmm another bug: if the client moves the switch to either CLOSE or TRIP and then back to neutral very quickly (for example because the client has it set up as a momentary switch) then the indicators don't update (but the flag does) |
i think sending the udp packet once then marking devices clean is not good idea unless the device is updating frequently enough that it doesnt matter