mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
fix
This commit is contained in:
parent
9226f362a7
commit
946728e54e
3 changed files with 28 additions and 2 deletions
|
|
@ -111,6 +111,19 @@ static int l_request(lua::State* L, network::Network& network) {
|
|||
}
|
||||
|
||||
int currentRequestId = request_id++;
|
||||
request.onResponse = [currentRequestId](std::vector<char> bytes) {
|
||||
push_event(NetworkEvent(
|
||||
RESPONSE,
|
||||
ResponseEventDto {200, false, currentRequestId, std::move(bytes)}
|
||||
));
|
||||
};
|
||||
request.onReject = [currentRequestId](int code, std::vector<char> bytes) {
|
||||
push_event(NetworkEvent(
|
||||
RESPONSE,
|
||||
ResponseEventDto {code, false, currentRequestId, std::move(bytes)}
|
||||
));
|
||||
};
|
||||
|
||||
network.request(std::move(request));
|
||||
return lua::pushinteger(L, currentRequestId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue