Monday, 22 February 2021

Calculate packet size for RCON?

Hullo!

Using mbr-rcon, im able to send commands and get the output using the following code (I ommited the create connection part for simplicity):

command = "list";

rconclient.send(command, {
    onSuccess: function(response){},
            
    onError: function(error){
        console.log(error);
    }
});

Theres one problem tho, if i try and send a really long command (1400ish characters) it fails. So I tought that maybe it'd be a good idea to come up with a function to limit the character size, right? But here's the catch: The RCON spec says the max packet size is 4096 bytes. Even if I limit the output to 4096B, it still fails at like 1400ish. Why is that? Even if my input is 100% ASCII text it fails and makes the library's onClose(); method fire up (which is used for when the connection terminates). Many libraries I've tried have a similar problem.

Any tips frens?



from Calculate packet size for RCON?

No comments:

Post a Comment