[Server] Rename WorldFunctions into ObjectFunctions

pull/427/head
David Cernat 7 years ago
parent 78234f9071
commit d4f7936a76

@ -82,7 +82,7 @@ set(SERVER
Script/Script.cpp Script/ScriptFunction.cpp Script/Script.cpp Script/ScriptFunction.cpp
Script/ScriptFunctions.cpp Script/ScriptFunctions.cpp
Script/Functions/Actors.cpp Script/Functions/World.cpp Script/Functions/Miscellaneous.cpp Script/Functions/Actors.cpp Script/Functions/Objects.cpp Script/Functions/Miscellaneous.cpp
Script/Functions/Books.cpp Script/Functions/Cells.cpp Script/Functions/CharClass.cpp Script/Functions/Books.cpp Script/Functions/Cells.cpp Script/Functions/CharClass.cpp
Script/Functions/Chat.cpp Script/Functions/Dialogue.cpp Script/Functions/Factions.cpp Script/Functions/Chat.cpp Script/Functions/Dialogue.cpp Script/Functions/Factions.cpp

@ -6,7 +6,7 @@
#include <apps/openmw-mp/Utils.hpp> #include <apps/openmw-mp/Utils.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp> #include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include "World.hpp" #include "Objects.hpp"
using namespace mwmp; using namespace mwmp;
@ -19,12 +19,12 @@ const BaseObject emptyObject = {};
ContainerItem tempContainerItem; ContainerItem tempContainerItem;
const ContainerItem emptyContainerItem = {}; const ContainerItem emptyContainerItem = {};
void WorldFunctions::ReadLastObjectList() noexcept void ObjectFunctions::ReadLastObjectList() noexcept
{ {
readObjectList = mwmp::Networking::getPtr()->getLastObjectList(); readObjectList = mwmp::Networking::getPtr()->getLastObjectList();
} }
void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept void ObjectFunctions::InitializeObjectList(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ); GET_PLAYER(pid, player, );
@ -34,259 +34,259 @@ void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
writeObjectList.guid = player->guid; writeObjectList.guid = player->guid;
} }
unsigned int WorldFunctions::GetObjectChangesSize() noexcept unsigned int ObjectFunctions::GetObjectChangesSize() noexcept
{ {
return readObjectList->baseObjectCount; return readObjectList->baseObjectCount;
} }
unsigned char WorldFunctions::GetObjectListAction() noexcept unsigned char ObjectFunctions::GetObjectListAction() noexcept
{ {
return readObjectList->action; return readObjectList->action;
} }
unsigned char WorldFunctions::GetObjectListContainerSubAction() noexcept unsigned char ObjectFunctions::GetObjectListContainerSubAction() noexcept
{ {
return readObjectList->containerSubAction; return readObjectList->containerSubAction;
} }
const char *WorldFunctions::GetObjectRefId(unsigned int i) noexcept const char *ObjectFunctions::GetObjectRefId(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).refId.c_str(); return readObjectList->baseObjects.at(i).refId.c_str();
} }
int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).refNumIndex; return readObjectList->baseObjects.at(i).refNumIndex;
} }
int WorldFunctions::GetObjectMpNum(unsigned int i) noexcept int ObjectFunctions::GetObjectMpNum(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).mpNum; return readObjectList->baseObjects.at(i).mpNum;
} }
int WorldFunctions::GetObjectCount(unsigned int i) noexcept int ObjectFunctions::GetObjectCount(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).count; return readObjectList->baseObjects.at(i).count;
} }
int WorldFunctions::GetObjectCharge(unsigned int i) noexcept int ObjectFunctions::GetObjectCharge(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).charge; return readObjectList->baseObjects.at(i).charge;
} }
double WorldFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept double ObjectFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).enchantmentCharge; return readObjectList->baseObjects.at(i).enchantmentCharge;
} }
int WorldFunctions::GetObjectGoldValue(unsigned int i) noexcept int ObjectFunctions::GetObjectGoldValue(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).goldValue; return readObjectList->baseObjects.at(i).goldValue;
} }
double WorldFunctions::GetObjectScale(unsigned int i) noexcept double ObjectFunctions::GetObjectScale(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).scale; return readObjectList->baseObjects.at(i).scale;
} }
bool WorldFunctions::GetObjectState(unsigned int i) noexcept bool ObjectFunctions::GetObjectState(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).objectState; return readObjectList->baseObjects.at(i).objectState;
} }
int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept int ObjectFunctions::GetObjectDoorState(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).doorState; return readObjectList->baseObjects.at(i).doorState;
} }
int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept int ObjectFunctions::GetObjectLockLevel(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).lockLevel; return readObjectList->baseObjects.at(i).lockLevel;
} }
double WorldFunctions::GetObjectPosX(unsigned int i) noexcept double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[0]; return readObjectList->baseObjects.at(i).position.pos[0];
} }
double WorldFunctions::GetObjectPosY(unsigned int i) noexcept double ObjectFunctions::GetObjectPosY(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[1]; return readObjectList->baseObjects.at(i).position.pos[1];
} }
double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept double ObjectFunctions::GetObjectPosZ(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[2]; return readObjectList->baseObjects.at(i).position.pos[2];
} }
double WorldFunctions::GetObjectRotX(unsigned int i) noexcept double ObjectFunctions::GetObjectRotX(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[0]; return readObjectList->baseObjects.at(i).position.rot[0];
} }
double WorldFunctions::GetObjectRotY(unsigned int i) noexcept double ObjectFunctions::GetObjectRotY(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[1]; return readObjectList->baseObjects.at(i).position.rot[1];
} }
double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept double ObjectFunctions::GetObjectRotZ(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[2]; return readObjectList->baseObjects.at(i).position.rot[2];
} }
unsigned int WorldFunctions::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;
} }
const char *WorldFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept const char *ObjectFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept
{ {
return readObjectList->baseObjects.at(objectIndex) return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).refId.c_str(); .containerItems.at(itemIndex).refId.c_str();
} }
int WorldFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept int ObjectFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
{ {
return readObjectList->baseObjects.at(objectIndex) return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).count; .containerItems.at(itemIndex).count;
} }
int WorldFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept int ObjectFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
{ {
return readObjectList->baseObjects.at(objectIndex) return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).charge; .containerItems.at(itemIndex).charge;
} }
double WorldFunctions::GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept double ObjectFunctions::GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
{ {
return readObjectList->baseObjects.at(objectIndex) return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).enchantmentCharge; .containerItems.at(itemIndex).enchantmentCharge;
} }
int WorldFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept int ObjectFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
{ {
return readObjectList->baseObjects.at(objectIndex) return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).actionCount; .containerItems.at(itemIndex).actionCount;
} }
void WorldFunctions::SetObjectListCell(const char* cellDescription) noexcept void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
{ {
writeObjectList.cell = Utils::getCellFromDescription(cellDescription); writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
} }
void WorldFunctions::SetObjectListAction(unsigned char action) noexcept void ObjectFunctions::SetObjectListAction(unsigned char action) noexcept
{ {
writeObjectList.action = action; writeObjectList.action = action;
} }
void WorldFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept void ObjectFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
{ {
writeObjectList.consoleCommand = consoleCommand; writeObjectList.consoleCommand = consoleCommand;
} }
void WorldFunctions::SetObjectRefId(const char* refId) noexcept void ObjectFunctions::SetObjectRefId(const char* refId) noexcept
{ {
tempObject.refId = refId; tempObject.refId = refId;
} }
void WorldFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept void ObjectFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
{ {
tempObject.refNumIndex = refNumIndex; tempObject.refNumIndex = refNumIndex;
} }
void WorldFunctions::SetObjectMpNum(int mpNum) noexcept void ObjectFunctions::SetObjectMpNum(int mpNum) noexcept
{ {
tempObject.mpNum = mpNum; tempObject.mpNum = mpNum;
} }
void WorldFunctions::SetObjectCount(int count) noexcept void ObjectFunctions::SetObjectCount(int count) noexcept
{ {
tempObject.count = count; tempObject.count = count;
} }
void WorldFunctions::SetObjectCharge(int charge) noexcept void ObjectFunctions::SetObjectCharge(int charge) noexcept
{ {
tempObject.charge = charge; tempObject.charge = charge;
} }
void WorldFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept void ObjectFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
{ {
tempObject.enchantmentCharge = enchantmentCharge; tempObject.enchantmentCharge = enchantmentCharge;
} }
void WorldFunctions::SetObjectGoldValue(int goldValue) noexcept void ObjectFunctions::SetObjectGoldValue(int goldValue) noexcept
{ {
tempObject.goldValue = goldValue; tempObject.goldValue = goldValue;
} }
void WorldFunctions::SetObjectScale(double scale) noexcept void ObjectFunctions::SetObjectScale(double scale) noexcept
{ {
tempObject.scale = scale; tempObject.scale = scale;
} }
void WorldFunctions::SetObjectState(bool objectState) noexcept void ObjectFunctions::SetObjectState(bool objectState) noexcept
{ {
tempObject.objectState = objectState; tempObject.objectState = objectState;
} }
void WorldFunctions::SetObjectLockLevel(int lockLevel) noexcept void ObjectFunctions::SetObjectLockLevel(int lockLevel) noexcept
{ {
tempObject.lockLevel = lockLevel; tempObject.lockLevel = lockLevel;
} }
void WorldFunctions::SetObjectDisarmState(bool disarmState) noexcept void ObjectFunctions::SetObjectDisarmState(bool disarmState) noexcept
{ {
tempObject.isDisarmed = disarmState; tempObject.isDisarmed = disarmState;
} }
void WorldFunctions::SetObjectMasterState(bool masterState) noexcept void ObjectFunctions::SetObjectMasterState(bool masterState) noexcept
{ {
tempObject.hasMaster = masterState; tempObject.hasMaster = masterState;
} }
void WorldFunctions::SetObjectPosition(double x, double y, double z) noexcept void ObjectFunctions::SetObjectPosition(double x, double y, double z) noexcept
{ {
tempObject.position.pos[0] = x; tempObject.position.pos[0] = x;
tempObject.position.pos[1] = y; tempObject.position.pos[1] = y;
tempObject.position.pos[2] = z; tempObject.position.pos[2] = z;
} }
void WorldFunctions::SetObjectRotation(double x, double y, double z) noexcept void ObjectFunctions::SetObjectRotation(double x, double y, double z) noexcept
{ {
tempObject.position.rot[0] = x; tempObject.position.rot[0] = x;
tempObject.position.rot[1] = y; tempObject.position.rot[1] = y;
tempObject.position.rot[2] = z; tempObject.position.rot[2] = z;
} }
void WorldFunctions::SetObjectDoorState(int doorState) noexcept void ObjectFunctions::SetObjectDoorState(int doorState) noexcept
{ {
tempObject.doorState = doorState; tempObject.doorState = doorState;
} }
void WorldFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept void ObjectFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
{ {
tempObject.teleportState = teleportState; tempObject.teleportState = teleportState;
} }
void WorldFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept void ObjectFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
{ {
tempObject.destinationCell = Utils::getCellFromDescription(cellDescription); tempObject.destinationCell = Utils::getCellFromDescription(cellDescription);
} }
void WorldFunctions::SetObjectDoorDestinationPosition(double x, double y, double z) noexcept void ObjectFunctions::SetObjectDoorDestinationPosition(double x, double y, double z) noexcept
{ {
tempObject.destinationPosition.pos[0] = x; tempObject.destinationPosition.pos[0] = x;
tempObject.destinationPosition.pos[1] = y; tempObject.destinationPosition.pos[1] = y;
tempObject.destinationPosition.pos[2] = z; tempObject.destinationPosition.pos[2] = z;
} }
void WorldFunctions::SetObjectDoorDestinationRotation(double x, double z) noexcept void ObjectFunctions::SetObjectDoorDestinationRotation(double x, double z) noexcept
{ {
tempObject.destinationPosition.rot[0] = x; tempObject.destinationPosition.rot[0] = x;
tempObject.destinationPosition.rot[2] = z; tempObject.destinationPosition.rot[2] = z;
} }
void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept void ObjectFunctions::SetPlayerAsObject(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ); GET_PLAYER(pid, player, );
@ -295,32 +295,32 @@ void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
tempObject.isPlayer = true; tempObject.isPlayer = true;
} }
void WorldFunctions::SetContainerItemRefId(const char* refId) noexcept void ObjectFunctions::SetContainerItemRefId(const char* refId) noexcept
{ {
tempContainerItem.refId = refId; tempContainerItem.refId = refId;
} }
void WorldFunctions::SetContainerItemCount(int count) noexcept void ObjectFunctions::SetContainerItemCount(int count) noexcept
{ {
tempContainerItem.count = count; tempContainerItem.count = count;
} }
void WorldFunctions::SetContainerItemCharge(int charge) noexcept void ObjectFunctions::SetContainerItemCharge(int charge) noexcept
{ {
tempContainerItem.charge = charge; tempContainerItem.charge = charge;
} }
void WorldFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept void ObjectFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept
{ {
tempContainerItem.enchantmentCharge = enchantmentCharge; tempContainerItem.enchantmentCharge = enchantmentCharge;
} }
void WorldFunctions::SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept void ObjectFunctions::SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept
{ {
readObjectList->baseObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount; readObjectList->baseObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount;
} }
void WorldFunctions::AddObject() noexcept void ObjectFunctions::AddObject() noexcept
{ {
tempObject.droppedByPlayer = false; tempObject.droppedByPlayer = false;
writeObjectList.baseObjects.push_back(tempObject); writeObjectList.baseObjects.push_back(tempObject);
@ -328,14 +328,14 @@ void WorldFunctions::AddObject() noexcept
tempObject = emptyObject; tempObject = emptyObject;
} }
void WorldFunctions::AddContainerItem() noexcept void ObjectFunctions::AddContainerItem() noexcept
{ {
tempObject.containerItems.push_back(tempContainerItem); tempObject.containerItems.push_back(tempContainerItem);
tempContainerItem = emptyContainerItem; tempContainerItem = emptyContainerItem;
} }
void WorldFunctions::SendObjectPlace(bool broadcast) noexcept void ObjectFunctions::SendObjectPlace(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -345,7 +345,7 @@ void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept void ObjectFunctions::SendObjectSpawn(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -355,7 +355,7 @@ void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectDelete(bool broadcast) noexcept void ObjectFunctions::SendObjectDelete(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -365,7 +365,7 @@ void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectLock(bool broadcast) noexcept void ObjectFunctions::SendObjectLock(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -375,7 +375,7 @@ void WorldFunctions::SendObjectLock(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectTrap(bool broadcast) noexcept void ObjectFunctions::SendObjectTrap(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -385,7 +385,7 @@ void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectScale(bool broadcast) noexcept void ObjectFunctions::SendObjectScale(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -395,7 +395,7 @@ void WorldFunctions::SendObjectScale(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendObjectState(bool broadcast) noexcept void ObjectFunctions::SendObjectState(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -405,7 +405,7 @@ void WorldFunctions::SendObjectState(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendDoorState(bool broadcast) noexcept void ObjectFunctions::SendDoorState(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -415,7 +415,7 @@ void WorldFunctions::SendDoorState(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendDoorDestination(bool broadcast) noexcept void ObjectFunctions::SendDoorDestination(bool broadcast) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -425,7 +425,7 @@ void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) noexcept void ObjectFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) noexcept
{ {
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
@ -440,7 +440,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) n
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::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);
packet->setObjectList(&writeObjectList); packet->setObjectList(&writeObjectList);
@ -450,7 +450,7 @@ void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
packet->Send(true); packet->Send(true);
} }
void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept void ObjectFunctions::SetHour(unsigned short pid, double hour) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -463,7 +463,7 @@ void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_TIME)->Send(false); mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_TIME)->Send(false);
} }
void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept void ObjectFunctions::SetMonth(unsigned short pid, int month) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -477,7 +477,7 @@ void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
} }
void WorldFunctions::SetDay(unsigned short pid, int day) noexcept void ObjectFunctions::SetDay(unsigned short pid, int day) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);

@ -1,93 +1,93 @@
#ifndef OPENMW_WORLDAPI_HPP #ifndef OPENMW_OBJECTAPI_HPP
#define OPENMW_WORLDAPI_HPP #define OPENMW_OBJECTAPI_HPP
#define WORLDAPI \ #define OBJECTAPI \
{"ReadLastObjectList", WorldFunctions::ReadLastObjectList},\ {"ReadLastObjectList", ObjectFunctions::ReadLastObjectList},\
{"InitializeObjectList", WorldFunctions::InitializeObjectList},\ {"InitializeObjectList", ObjectFunctions::InitializeObjectList},\
\ \
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\ {"GetObjectChangesSize", ObjectFunctions::GetObjectChangesSize},\
{"GetObjectListAction", WorldFunctions::GetObjectListAction},\ {"GetObjectListAction", ObjectFunctions::GetObjectListAction},\
{"GetObjectListContainerSubAction", WorldFunctions::GetObjectListContainerSubAction},\ {"GetObjectListContainerSubAction", ObjectFunctions::GetObjectListContainerSubAction},\
\ \
{"GetObjectRefId", WorldFunctions::GetObjectRefId},\ {"GetObjectRefId", ObjectFunctions::GetObjectRefId},\
{"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\ {"GetObjectRefNumIndex", ObjectFunctions::GetObjectRefNumIndex},\
{"GetObjectMpNum", WorldFunctions::GetObjectMpNum},\ {"GetObjectMpNum", ObjectFunctions::GetObjectMpNum},\
{"GetObjectCount", WorldFunctions::GetObjectCount},\ {"GetObjectCount", ObjectFunctions::GetObjectCount},\
{"GetObjectCharge", WorldFunctions::GetObjectCharge},\ {"GetObjectCharge", ObjectFunctions::GetObjectCharge},\
{"GetObjectEnchantmentCharge", WorldFunctions::GetObjectEnchantmentCharge},\ {"GetObjectEnchantmentCharge", ObjectFunctions::GetObjectEnchantmentCharge},\
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\ {"GetObjectGoldValue", ObjectFunctions::GetObjectGoldValue},\
{"GetObjectScale", WorldFunctions::GetObjectScale},\ {"GetObjectScale", ObjectFunctions::GetObjectScale},\
{"GetObjectState", WorldFunctions::GetObjectState},\ {"GetObjectState", ObjectFunctions::GetObjectState},\
{"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\ {"GetObjectDoorState", ObjectFunctions::GetObjectDoorState},\
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\ {"GetObjectLockLevel", ObjectFunctions::GetObjectLockLevel},\
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\ {"GetObjectPosX", ObjectFunctions::GetObjectPosX},\
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\ {"GetObjectPosY", ObjectFunctions::GetObjectPosY},\
{"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\ {"GetObjectPosZ", ObjectFunctions::GetObjectPosZ},\
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\ {"GetObjectRotX", ObjectFunctions::GetObjectRotX},\
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\ {"GetObjectRotY", ObjectFunctions::GetObjectRotY},\
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\ {"GetObjectRotZ", ObjectFunctions::GetObjectRotZ},\
\ \
{"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\ {"GetContainerChangesSize", ObjectFunctions::GetContainerChangesSize},\
{"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\ {"GetContainerItemRefId", ObjectFunctions::GetContainerItemRefId},\
{"GetContainerItemCount", WorldFunctions::GetContainerItemCount},\ {"GetContainerItemCount", ObjectFunctions::GetContainerItemCount},\
{"GetContainerItemCharge", WorldFunctions::GetContainerItemCharge},\ {"GetContainerItemCharge", ObjectFunctions::GetContainerItemCharge},\
{"GetContainerItemEnchantmentCharge", WorldFunctions::GetContainerItemEnchantmentCharge},\ {"GetContainerItemEnchantmentCharge", ObjectFunctions::GetContainerItemEnchantmentCharge},\
{"GetContainerItemActionCount", WorldFunctions::GetContainerItemActionCount},\ {"GetContainerItemActionCount", ObjectFunctions::GetContainerItemActionCount},\
\ \
{"SetObjectListCell", WorldFunctions::SetObjectListCell},\ {"SetObjectListCell", ObjectFunctions::SetObjectListCell},\
{"SetObjectListAction", WorldFunctions::SetObjectListAction},\ {"SetObjectListAction", ObjectFunctions::SetObjectListAction},\
{"SetObjectListConsoleCommand", WorldFunctions::SetObjectListConsoleCommand},\ {"SetObjectListConsoleCommand", ObjectFunctions::SetObjectListConsoleCommand},\
\ \
{"SetObjectRefId", WorldFunctions::SetObjectRefId},\ {"SetObjectRefId", ObjectFunctions::SetObjectRefId},\
{"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\ {"SetObjectRefNumIndex", ObjectFunctions::SetObjectRefNumIndex},\
{"SetObjectMpNum", WorldFunctions::SetObjectMpNum},\ {"SetObjectMpNum", ObjectFunctions::SetObjectMpNum},\
{"SetObjectCount", WorldFunctions::SetObjectCount},\ {"SetObjectCount", ObjectFunctions::SetObjectCount},\
{"SetObjectCharge", WorldFunctions::SetObjectCharge},\ {"SetObjectCharge", ObjectFunctions::SetObjectCharge},\
{"SetObjectEnchantmentCharge", WorldFunctions::SetObjectEnchantmentCharge},\ {"SetObjectEnchantmentCharge", ObjectFunctions::SetObjectEnchantmentCharge},\
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\ {"SetObjectGoldValue", ObjectFunctions::SetObjectGoldValue},\
{"SetObjectScale", WorldFunctions::SetObjectScale},\ {"SetObjectScale", ObjectFunctions::SetObjectScale},\
{"SetObjectState", WorldFunctions::SetObjectState},\ {"SetObjectState", ObjectFunctions::SetObjectState},\
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\ {"SetObjectLockLevel", ObjectFunctions::SetObjectLockLevel},\
{"SetObjectDisarmState", WorldFunctions::SetObjectDisarmState},\ {"SetObjectDisarmState", ObjectFunctions::SetObjectDisarmState},\
{"SetObjectMasterState", WorldFunctions::SetObjectMasterState},\ {"SetObjectMasterState", ObjectFunctions::SetObjectMasterState},\
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\ {"SetObjectPosition", ObjectFunctions::SetObjectPosition},\
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\ {"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
\ \
{"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\ {"SetObjectDoorState", ObjectFunctions::SetObjectDoorState},\
{"SetObjectDoorTeleportState", WorldFunctions::SetObjectDoorTeleportState},\ {"SetObjectDoorTeleportState", ObjectFunctions::SetObjectDoorTeleportState},\
{"SetObjectDoorDestinationCell", WorldFunctions::SetObjectDoorDestinationCell},\ {"SetObjectDoorDestinationCell", ObjectFunctions::SetObjectDoorDestinationCell},\
{"SetObjectDoorDestinationPosition", WorldFunctions::SetObjectDoorDestinationPosition},\ {"SetObjectDoorDestinationPosition", ObjectFunctions::SetObjectDoorDestinationPosition},\
{"SetObjectDoorDestinationRotation", WorldFunctions::SetObjectDoorDestinationRotation},\ {"SetObjectDoorDestinationRotation", ObjectFunctions::SetObjectDoorDestinationRotation},\
\ \
{"SetPlayerAsObject", WorldFunctions::SetPlayerAsObject},\ {"SetPlayerAsObject", ObjectFunctions::SetPlayerAsObject},\
\ \
{"SetContainerItemRefId", WorldFunctions::SetContainerItemRefId},\ {"SetContainerItemRefId", ObjectFunctions::SetContainerItemRefId},\
{"SetContainerItemCount", WorldFunctions::SetContainerItemCount},\ {"SetContainerItemCount", ObjectFunctions::SetContainerItemCount},\
{"SetContainerItemCharge", WorldFunctions::SetContainerItemCharge},\ {"SetContainerItemCharge", ObjectFunctions::SetContainerItemCharge},\
{"SetContainerItemEnchantmentCharge", WorldFunctions::SetContainerItemEnchantmentCharge},\ {"SetContainerItemEnchantmentCharge", ObjectFunctions::SetContainerItemEnchantmentCharge},\
\ \
{"SetReceivedContainerItemActionCount", WorldFunctions::SetReceivedContainerItemActionCount},\ {"SetReceivedContainerItemActionCount", ObjectFunctions::SetReceivedContainerItemActionCount},\
\ \
{"AddObject", WorldFunctions::AddObject},\ {"AddObject", ObjectFunctions::AddObject},\
{"AddContainerItem", WorldFunctions::AddContainerItem},\ {"AddContainerItem", ObjectFunctions::AddContainerItem},\
\ \
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\ {"SendObjectPlace", ObjectFunctions::SendObjectPlace},\
{"SendObjectSpawn", WorldFunctions::SendObjectSpawn},\ {"SendObjectSpawn", ObjectFunctions::SendObjectSpawn},\
{"SendObjectDelete", WorldFunctions::SendObjectDelete},\ {"SendObjectDelete", ObjectFunctions::SendObjectDelete},\
{"SendObjectLock", WorldFunctions::SendObjectLock},\ {"SendObjectLock", ObjectFunctions::SendObjectLock},\
{"SendObjectTrap", WorldFunctions::SendObjectTrap},\ {"SendObjectTrap", ObjectFunctions::SendObjectTrap},\
{"SendObjectScale", WorldFunctions::SendObjectScale},\ {"SendObjectScale", ObjectFunctions::SendObjectScale},\
{"SendObjectState", WorldFunctions::SendObjectState},\ {"SendObjectState", ObjectFunctions::SendObjectState},\
{"SendDoorState", WorldFunctions::SendDoorState},\ {"SendDoorState", ObjectFunctions::SendDoorState},\
{"SendDoorDestination", WorldFunctions::SendDoorDestination},\ {"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
{"SendContainer", WorldFunctions::SendContainer},\ {"SendContainer", ObjectFunctions::SendContainer},\
{"SendConsoleCommand", WorldFunctions::SendConsoleCommand},\ {"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\
\ \
{"SetHour", WorldFunctions::SetHour},\ {"SetHour", ObjectFunctions::SetHour},\
{"SetMonth", WorldFunctions::SetMonth},\ {"SetMonth", ObjectFunctions::SetMonth},\
{"SetDay", WorldFunctions::SetDay} {"SetDay", ObjectFunctions::SetDay}
class WorldFunctions class ObjectFunctions
{ {
public: public:
@ -780,4 +780,4 @@ public:
}; };
#endif //OPENMW_WORLDAPI_HPP #endif //OPENMW_OBJECTAPI_HPP

@ -21,7 +21,7 @@
#include <Script/Functions/Settings.hpp> #include <Script/Functions/Settings.hpp>
#include <Script/Functions/Spells.hpp> #include <Script/Functions/Spells.hpp>
#include <Script/Functions/Stats.hpp> #include <Script/Functions/Stats.hpp>
#include <Script/Functions/World.hpp> #include <Script/Functions/Objects.hpp>
#include <RakNetTypes.h> #include <RakNetTypes.h>
//#include <amx/amx.h> //#include <amx/amx.h>
#include <tuple> #include <tuple>
@ -291,7 +291,7 @@ public:
SETTINGSAPI, SETTINGSAPI,
SPELLAPI, SPELLAPI,
STATAPI, STATAPI,
WORLDAPI OBJECTAPI
}; };
static constexpr ScriptCallbackData callbacks[]{ static constexpr ScriptCallbackData callbacks[]{

Loading…
Cancel
Save