mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-05 18:19:41 +00:00
[Server] Add script functions that send ObjectMove/ObjectRotate packets
This commit is contained in:
parent
3222afc8b7
commit
d4f2686556
2 changed files with 46 additions and 0 deletions
|
@ -844,6 +844,28 @@ void ObjectFunctions::SendObjectState(bool sendToOtherPlayers, bool skipAttached
|
|||
packet->Send(true);
|
||||
}
|
||||
|
||||
void ObjectFunctions::SendObjectMove(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||
{
|
||||
mwmp::ObjectPacket* packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_MOVE);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
||||
if (!skipAttachedPlayer)
|
||||
packet->Send(false);
|
||||
if (sendToOtherPlayers)
|
||||
packet->Send(true);
|
||||
}
|
||||
|
||||
void ObjectFunctions::SendObjectRotate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||
{
|
||||
mwmp::ObjectPacket* packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_ROTATE);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
||||
if (!skipAttachedPlayer)
|
||||
packet->Send(false);
|
||||
if (sendToOtherPlayers)
|
||||
packet->Send(true);
|
||||
}
|
||||
|
||||
void ObjectFunctions::SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||
{
|
||||
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
|
||||
|
|
|
@ -161,6 +161,8 @@
|
|||
{"SendObjectScale", ObjectFunctions::SendObjectScale},\
|
||||
{"SendObjectSound", ObjectFunctions::SendObjectSound},\
|
||||
{"SendObjectState", ObjectFunctions::SendObjectState},\
|
||||
{"SendObjectMove", ObjectFunctions::SendObjectMove},\
|
||||
{"SendObjectRotate", ObjectFunctions::SendObjectRotate},\
|
||||
{"SendDoorState", ObjectFunctions::SendDoorState},\
|
||||
{"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
|
||||
{"SendContainer", ObjectFunctions::SendContainer},\
|
||||
|
@ -1445,6 +1447,28 @@ public:
|
|||
*/
|
||||
static void SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Send an ObjectMove packet.
|
||||
*
|
||||
* \param sendToOtherPlayers Whether this packet should be sent to players other than the
|
||||
* player attached to the packet (false by default).
|
||||
* \param skipAttachedPlayer Whether the packet should skip being sent to the player attached
|
||||
* to the packet (false by default).
|
||||
* \return void
|
||||
*/
|
||||
static void SendObjectMove(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Send an ObjectRotate packet.
|
||||
*
|
||||
* \param sendToOtherPlayers Whether this packet should be sent to players other than the
|
||||
* player attached to the packet (false by default).
|
||||
* \param skipAttachedPlayer Whether the packet should skip being sent to the player attached
|
||||
* to the packet (false by default).
|
||||
* \return void
|
||||
*/
|
||||
static void SendObjectRotate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Send a DoorState packet.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue