Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vp817 authored Jul 31, 2024
1 parent 26ad767 commit cab8682
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ you will need to check hole count in valid datagrams that is `Reliable or in seq

`receivedPacketsBaseIndex`: it only increments if valid datagram `Reliable or in sequence`

`receivedPacketQueue`: it is something that stores the `rangeNumber` of valid datagram as the key in the list and it's value is true not the datagram, it can be false but after meeting some coditions that will be stated below (false means that we got it sucessfully and true means we didn't get it sucessfully).
`receivedPacketQueue`: it is something that stores the `rangeNumber` of valid datagram as the key in the list and it's value is true not the datagram, it can be false but after meeting some coditions that will be stated below (false means that we got it sucessfully and true means we didn't get it sucessfully) and it it's data structure is a ![Queue](https://gist.github.com/vp817/f20f0d2b16b9fb5d7dfa6364928e0e9d).

to find the hole count subtract the current received valid datagram's `rangeNumber` with the `receivedPacketsBaseIndex` and that property increments everytime there is no hole count (`receivedPacketsBaseIndex` only increments if `Reliable or in sequence`).

Expand All @@ -457,10 +457,10 @@ to find the hole count subtract the current received valid datagram's `rangeNumb
if these conditions stated up was not met then:

1. if the hole count is greater than 1000000 then the hole count is too high (skip and do what is needed).
2. if hole count(with `bitwise and` the `uint32` max value if needed) is greater than the `receivedPacketQueue` size then fill it with hole count as the length with a key that is equals to the last key summed by 1 that has a value of true.
3. after condition(2) was done then add an element with it's key as the last key summed by 1 that has a value of false.
2. if hole count(with `bitwise and` the `uint32` max value if needed) is greater than the `receivedPacketQueue` size then fill it by pushing true values in queue.
3. after condition(2) was done then push false to queue.

after that you can create a loop and check if `receivedPacketQueue` size is greater than 0 and first value of `receivedPacketQueue` is false then increment the `receivedPacketsBaseIndex` and remove the last element of the `receivedPacketQueue` repeatedly.
after that you can create a loop and check if `receivedPacketQueue` size is greater than 0 and first value of `receivedPacketQueue` is false then remove the last element of the `receivedPacketQueue` then increment the `receivedPacketsBaseIndex`.

after that you can handle the valid datagrams normally.

Expand Down

0 comments on commit cab8682

Please sign in to comment.