mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 05:36:43 +00:00
[Server] Add GetVideoFilename() and SendVideoPlay() script functions
This commit is contained in:
parent
3ed9d89280
commit
14e4f64296
2 changed files with 36 additions and 0 deletions
|
@ -183,6 +183,11 @@ double ObjectFunctions::GetObjectRotZ(unsigned int i) noexcept
|
||||||
return readObjectList->baseObjects.at(i).position.rot[2];
|
return readObjectList->baseObjects.at(i).position.rot[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *ObjectFunctions::GetVideoFilename(unsigned int i) noexcept
|
||||||
|
{
|
||||||
|
return readObjectList->baseObjects.at(i).videoFilename.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
||||||
{
|
{
|
||||||
return readObjectList->baseObjects.at(objectIndex).containerItemCount;
|
return readObjectList->baseObjects.at(objectIndex).containerItemCount;
|
||||||
|
@ -494,6 +499,16 @@ void ObjectFunctions::SendContainer(bool broadcast) noexcept
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectFunctions::SendVideoPlay(bool broadcast) noexcept
|
||||||
|
{
|
||||||
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_VIDEO_PLAY);
|
||||||
|
packet->setObjectList(&writeObjectList);
|
||||||
|
packet->Send(false);
|
||||||
|
|
||||||
|
if (broadcast)
|
||||||
|
packet->Send(true);
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendConsoleCommand(bool broadcast) noexcept
|
void ObjectFunctions::SendConsoleCommand(bool broadcast) noexcept
|
||||||
{
|
{
|
||||||
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
{"GetObjectRotY", ObjectFunctions::GetObjectRotY},\
|
{"GetObjectRotY", ObjectFunctions::GetObjectRotY},\
|
||||||
{"GetObjectRotZ", ObjectFunctions::GetObjectRotZ},\
|
{"GetObjectRotZ", ObjectFunctions::GetObjectRotZ},\
|
||||||
\
|
\
|
||||||
|
{"GetVideoFilename", ObjectFunctions::GetVideoFilename},\
|
||||||
|
\
|
||||||
{"GetContainerChangesSize", ObjectFunctions::GetContainerChangesSize},\
|
{"GetContainerChangesSize", ObjectFunctions::GetContainerChangesSize},\
|
||||||
{"GetContainerItemRefId", ObjectFunctions::GetContainerItemRefId},\
|
{"GetContainerItemRefId", ObjectFunctions::GetContainerItemRefId},\
|
||||||
{"GetContainerItemCount", ObjectFunctions::GetContainerItemCount},\
|
{"GetContainerItemCount", ObjectFunctions::GetContainerItemCount},\
|
||||||
|
@ -97,6 +99,7 @@
|
||||||
{"SendDoorState", ObjectFunctions::SendDoorState},\
|
{"SendDoorState", ObjectFunctions::SendDoorState},\
|
||||||
{"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
|
{"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
|
||||||
{"SendContainer", ObjectFunctions::SendContainer},\
|
{"SendContainer", ObjectFunctions::SendContainer},\
|
||||||
|
{"SendVideoPlay", ObjectFunctions::SendVideoPlay},\
|
||||||
{"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\
|
{"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\
|
||||||
\
|
\
|
||||||
{"ReadLastEvent", ObjectFunctions::ReadLastEvent},\
|
{"ReadLastEvent", ObjectFunctions::ReadLastEvent},\
|
||||||
|
@ -381,6 +384,14 @@ public:
|
||||||
*/
|
*/
|
||||||
static double GetObjectRotZ(unsigned int i) noexcept;
|
static double GetObjectRotZ(unsigned int i) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get the videoFilename of the object at a certain index in the read object list's object
|
||||||
|
* changes.
|
||||||
|
*
|
||||||
|
* \return The videoFilename.
|
||||||
|
*/
|
||||||
|
static const char *GetVideoFilename(unsigned int i) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the number of container item indexes of the object at a certain index in the
|
* \brief Get the number of container item indexes of the object at a certain index in the
|
||||||
* read object list's object changes.
|
* read object list's object changes.
|
||||||
|
@ -865,6 +876,16 @@ public:
|
||||||
*/
|
*/
|
||||||
static void SendContainer(bool broadcast = false) noexcept;
|
static void SendContainer(bool broadcast = false) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Send a VideoPlay packet.
|
||||||
|
*
|
||||||
|
* \param broadcast Whether this packet should be sent only to the player for whom the current
|
||||||
|
* object list was initialized or to everyone on the server.
|
||||||
|
*
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SendVideoPlay(bool broadcast = false) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a ConsoleCommand packet.
|
* \brief Send a ConsoleCommand packet.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue