diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 4f42cfabe..cbb9f427f 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3502,6 +3502,20 @@ void Server::SendLocalPlayerAnimations(u16 peer_id, v2f animation_frames[4], f32 m_clients.send(peer_id, 0, data, true); } +void Server::SendEyeOffset(u16 peer_id, v3f first, v3f third) +{ + std::ostringstream os(std::ios_base::binary); + + writeU16(os, TOCLIENT_EYE_OFFSET); + writeV3F1000(os, first); + writeV3F1000(os, third); + + // Make data buffer + std::string s = os.str(); + SharedBuffer<u8> data((u8 *)s.c_str(), s.size()); + // Send as reliable + m_clients.send(peer_id, 0, data, true); +} void Server::SendPlayerPrivileges(u16 peer_id) { Player *player = m_env->getPlayer(peer_id); @@ -4605,6 +4619,15 @@ bool Server::setLocalPlayerAnimations(Player *player, v2f animation_frames[4], f return true; } +bool Server::setPlayerEyeOffset(Player *player, v3f first, v3f third) +{ + if (!player) + return false; + + SendEyeOffset(player->peer_id, first, third); + return true; +} + bool Server::setSky(Player *player, const video::SColor &bgcolor, const std::string &type, const std::vector<std::string> ¶ms) { |