1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Add minetest.get_player_window_information() (#12367)

This commit is contained in:
rubenwardy 2023-02-27 22:58:41 +00:00 committed by GitHub
parent fbbdae93ee
commit 39f4d26177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 345 additions and 35 deletions

View file

@ -40,6 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/pointedthing.h"
#include "util/serialize.h"
#include "util/srp.h"
#include "clientdynamicinfo.h"
void Server::handleCommand_Deprecated(NetworkPacket* pkt)
{
@ -1841,3 +1842,18 @@ void Server::handleCommand_HaveMedia(NetworkPacket *pkt)
}
}
}
void Server::handleCommand_UpdateClientInfo(NetworkPacket *pkt)
{
ClientDynamicInfo info;
*pkt >> info.render_target_size.X;
*pkt >> info.render_target_size.Y;
*pkt >> info.real_gui_scaling;
*pkt >> info.real_hud_scaling;
*pkt >> info.max_fs_size.X;
*pkt >> info.max_fs_size.Y;
session_t peer_id = pkt->getPeerId();
RemoteClient *client = getClient(peer_id, CS_Invalid);
client->setDynamicInfo(info);
}