[Server] Add script functions for getting world object refIds & refNums

coverity_scan^2
David Cernat 8 years ago
parent b549da996e
commit 27ac314cb1

@ -5,16 +5,16 @@
#define CELLAPI \
{"GetCellStateChangesSize", CellFunctions::GetCellStateChangesSize},\
\
\
{"GetCellStateDescription", CellFunctions::GetCellStateDescription},\
\
\
{"GetCell", CellFunctions::GetCell},\
{"SetCell", CellFunctions::SetCell},\
{"SetExterior", CellFunctions::SetExterior},\
{"GetExteriorX", CellFunctions::GetExteriorX},\
{"GetExteriorY", CellFunctions::GetExteriorY},\
{"IsInExterior", CellFunctions::IsInExterior},\
\
\
{"SendCell", CellFunctions::SendCell}

@ -68,6 +68,21 @@ void WorldFunctions::SetObjectPosition(unsigned int i, double x, double y, doubl
worldEvent->objectChanges.objects[i].pos.pos[2] = z;
}
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.count;
}
const char *WorldFunctions::GetObjectRefId(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].refId.c_str();
}
int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].refNumIndex;
}
void WorldFunctions::SendObjectDelete() noexcept
{
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(worldEvent, worldEvent->guid);

@ -11,6 +11,11 @@
{"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
\
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
\
{"GetObjectRefId", WorldFunctions::GetObjectRefId},\
{"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\
\
{"SendObjectDelete", WorldFunctions::SendObjectDelete},\
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\
\
@ -31,6 +36,11 @@ public:
static void SetObjectRefNumIndex(unsigned int i, int refNumIndex) noexcept;
static void SetObjectPosition(unsigned int i, double x, double y, double z) noexcept;
static unsigned int GetObjectChangesSize() noexcept;
static const char *GetObjectRefId(unsigned int i) noexcept;
static int GetObjectRefNumIndex(unsigned int i) noexcept;
static void SendObjectDelete() noexcept;
static void SendObjectPlace() noexcept;

Loading…
Cancel
Save