Add network link to ue-server implementation #13

Open
dkanus wants to merge 23 commits from feature_link into master
Showing only changes of commit b846fcf55b - Show all commits

View File

@ -45,13 +45,16 @@ pub struct MessageReader {
received_bytes: u64,
}
/// For converting byte stream expected to be generated by Acedia mod from the game server into
/// actual messages. Expected format is a sequence of either:
/// [HEAD_UE_RECEIVED: 1 byte] [amount of bytes received by game server since last update: 4 bytes]
/// [HEAD_UE_MESSAGE: 1 byte] [length of the message: 4 bytes] [utf8-encoded string: ??? bytes]
/// On any invalid input enters a failure state (can be checked by `is_broken()`) and
/// For converting byte stream that is expected from the ue-server into actual messages.
/// Expected format is a sequence of either:
/// 1. [HEAD_UE_RECEIVED: marker byte | 1 byte]
/// [AMOUNT: amount of bytes received by ue-server since last update | 4 bytes: u32 BE]
/// 2. [HEAD_UE_MESSAGE: marker byte | 1 byte]
Review

Maybe remove continue?

Maybe remove continue?
/// [LENGTH: length of the JSON message in utf8 encoding | 4 bytes: u32 BE]
dkanus marked this conversation as resolved Outdated

with_capactiy?

with_capactiy?
  • // will be recreated with with_capacity in push()
+ // will be recreated with with_capacity in push()
/// [PAYLOAD: utf8-encoded string | `LENGTH` bytes]
dkanus marked this conversation as resolved Outdated

with_capactiy?

with_capactiy?
/// On any invalid input enters into a failure state (can be checked by `is_broken()`) and
/// never recovers from it.
/// Use either `push_byte()` or `push()` to input byte stream from game server and `pop()` to
/// Use either `push_byte()` or `push()` to input byte stream from ue-server and `pop()` to
/// retrieve resulting messages.
impl MessageReader {
pub fn new() -> MessageReader {