altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 17 forks source link

Sending big amount of data from client to server is broken #879

Closed LeonMrBonnie closed 3 years ago

LeonMrBonnie commented 3 years ago

Client/server version

Build #dev/4.0-dev5, branch dev

Current behavior

When transmitting a big amount of data from client to server (e.g. a screenshot taken with alt.takeScreenshot) only a partial amount of the data is received on the serverside.

Expected behavior

The maximum size the client can send to server has been increased to UINT32_MAX bytes in a prior update, this has worked fine for e.g. sending a screenshot from client to server before.

Steps to reproduce

Client:

let screen = await alt.takeScreenshot();
alt.log(screen.length);
alt.emitServer("getScreenshot", screen);

Server:

alt.onClient("getScreenshot", (player, screenshot) => {
    alt.log(screenshot.length);
});

Context (environment)

Sending a screenshot from client to server.

Possible solution

This has appeared since the packet compression is available in dev branch, so it is probably related.

inpex commented 3 years ago

this problem still persists. would it be possible to fix this. before merging in release. For us an actively used function

FabianTerhorst commented 3 years ago

We prefered to limit the amount of data. Thats why limit is now added again. Client has a http client for that now.

LeonMrBonnie commented 3 years ago

We prefered to limit the amount of data. Thats why limit is now added again. Client has a http client for that now.

Or WebSocketClient. If you need to send such big amounts of data, you should just use the Http Client or the Websocket Client to send that data to your server, alt:V events are not made for that.