1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Method add_pos for object/player (#14126)

This commit is contained in:
sfence 2024-01-01 22:48:56 +01:00 committed by GitHub
parent c9ab61aa8c
commit d0753dddb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 105 additions and 7 deletions

View file

@ -117,13 +117,13 @@ const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] =
{ "TOCLIENT_SET_SUN", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetSun }, // 0x5a
{ "TOCLIENT_SET_MOON", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetMoon }, // 0x5b
{ "TOCLIENT_SET_STARS", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetStars }, // 0x5c
null_command_handler,
{ "TOCLIENT_MOVE_PLAYER_REL", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_MovePlayerRel }, // 0x5d,
null_command_handler,
null_command_handler,
{ "TOCLIENT_SRP_BYTES_S_B", TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_SrpBytesSandB }, // 0x60
{ "TOCLIENT_FORMSPEC_PREPEND", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_FormspecPrepend }, // 0x61,
{ "TOCLIENT_MINIMAP_MODES", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_MinimapModes }, // 0x62,
{ "TOCLIENT_SET_LIGHTING", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_SetLighting }, // 0x63,
{ "TOCLIENT_SET_LIGHTING", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_SetLighting }, // 0x63,
};
const static ServerCommandFactory null_command_factory = { "TOSERVER_NULL", 0, false };

View file

@ -635,6 +635,17 @@ void Client::handleCommand_MovePlayer(NetworkPacket* pkt)
m_client_event_queue.push(event);
}
void Client::handleCommand_MovePlayerRel(NetworkPacket *pkt)
{
v3f added_pos;
*pkt >> added_pos;
LocalPlayer *player = m_env.getLocalPlayer();
assert(player);
player->addPosition(added_pos);
}
void Client::handleCommand_DeathScreen(NetworkPacket* pkt)
{
bool set_camera_point_target;

View file

@ -221,6 +221,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
[scheduled bump for 5.8.0]
PROTOCOL VERSION 44:
AO_CMD_SET_BONE_POSITION extended
Add TOCLIENT_MOVE_PLAYER_REL
[scheduled bump for 5.9.0]
*/
@ -835,6 +836,11 @@ enum ToClientCommand
f32 day_opacity
*/
TOCLIENT_MOVE_PLAYER_REL = 0x5d,
/*
v3f added_pos
*/
TOCLIENT_SRP_BYTES_S_B = 0x60,
/*
Belonging to AUTH_MECHANISM_SRP.