forked from mirror/openmw-tes3mp
[Server] Rename WorldFunctions into ObjectFunctions
This commit is contained in:
parent
78234f9071
commit
d4f7936a76
4 changed files with 153 additions and 153 deletions
|
@ -82,7 +82,7 @@ set(SERVER
|
|||
Script/Script.cpp Script/ScriptFunction.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/Chat.cpp Script/Functions/Dialogue.cpp Script/Functions/Factions.cpp
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <apps/openmw-mp/Utils.hpp>
|
||||
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
||||
|
||||
#include "World.hpp"
|
||||
#include "Objects.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
|
@ -19,12 +19,12 @@ const BaseObject emptyObject = {};
|
|||
ContainerItem tempContainerItem;
|
||||
const ContainerItem emptyContainerItem = {};
|
||||
|
||||
void WorldFunctions::ReadLastObjectList() noexcept
|
||||
void ObjectFunctions::ReadLastObjectList() noexcept
|
||||
{
|
||||
readObjectList = mwmp::Networking::getPtr()->getLastObjectList();
|
||||
}
|
||||
|
||||
void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
|
||||
void ObjectFunctions::InitializeObjectList(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
@ -34,259 +34,259 @@ void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
|
|||
writeObjectList.guid = player->guid;
|
||||
}
|
||||
|
||||
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
|
||||
unsigned int ObjectFunctions::GetObjectChangesSize() noexcept
|
||||
{
|
||||
return readObjectList->baseObjectCount;
|
||||
}
|
||||
|
||||
unsigned char WorldFunctions::GetObjectListAction() noexcept
|
||||
unsigned char ObjectFunctions::GetObjectListAction() noexcept
|
||||
{
|
||||
return readObjectList->action;
|
||||
}
|
||||
|
||||
unsigned char WorldFunctions::GetObjectListContainerSubAction() noexcept
|
||||
unsigned char ObjectFunctions::GetObjectListContainerSubAction() noexcept
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
|
||||
int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
int WorldFunctions::GetObjectCount(unsigned int i) noexcept
|
||||
int ObjectFunctions::GetObjectCount(unsigned int i) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
double WorldFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
|
||||
double ObjectFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
double WorldFunctions::GetObjectScale(unsigned int i) noexcept
|
||||
double ObjectFunctions::GetObjectScale(unsigned int i) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept
|
||||
int ObjectFunctions::GetObjectDoorState(unsigned int i) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
double WorldFunctions::GetObjectPosX(unsigned int i) noexcept
|
||||
double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept
|
||||
{
|
||||
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];
|
||||
}
|
||||
|
||||
double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept
|
||||
double ObjectFunctions::GetObjectPosZ(unsigned int i) noexcept
|
||||
{
|
||||
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];
|
||||
}
|
||||
|
||||
double WorldFunctions::GetObjectRotY(unsigned int i) noexcept
|
||||
double ObjectFunctions::GetObjectRotY(unsigned int i) noexcept
|
||||
{
|
||||
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];
|
||||
}
|
||||
|
||||
unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
||||
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
||||
{
|
||||
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)
|
||||
.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)
|
||||
.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)
|
||||
.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)
|
||||
.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)
|
||||
.containerItems.at(itemIndex).actionCount;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
||||
void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
||||
{
|
||||
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectListAction(unsigned char action) noexcept
|
||||
void ObjectFunctions::SetObjectListAction(unsigned char action) noexcept
|
||||
{
|
||||
writeObjectList.action = action;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
|
||||
void ObjectFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
|
||||
{
|
||||
writeObjectList.consoleCommand = consoleCommand;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectRefId(const char* refId) noexcept
|
||||
void ObjectFunctions::SetObjectRefId(const char* refId) noexcept
|
||||
{
|
||||
tempObject.refId = refId;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
|
||||
void ObjectFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
|
||||
{
|
||||
tempObject.refNumIndex = refNumIndex;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectMpNum(int mpNum) noexcept
|
||||
void ObjectFunctions::SetObjectMpNum(int mpNum) noexcept
|
||||
{
|
||||
tempObject.mpNum = mpNum;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectCount(int count) noexcept
|
||||
void ObjectFunctions::SetObjectCount(int count) noexcept
|
||||
{
|
||||
tempObject.count = count;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectCharge(int charge) noexcept
|
||||
void ObjectFunctions::SetObjectCharge(int charge) noexcept
|
||||
{
|
||||
tempObject.charge = charge;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
|
||||
void ObjectFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
|
||||
{
|
||||
tempObject.enchantmentCharge = enchantmentCharge;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectGoldValue(int goldValue) noexcept
|
||||
void ObjectFunctions::SetObjectGoldValue(int goldValue) noexcept
|
||||
{
|
||||
tempObject.goldValue = goldValue;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectScale(double scale) noexcept
|
||||
void ObjectFunctions::SetObjectScale(double scale) noexcept
|
||||
{
|
||||
tempObject.scale = scale;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectState(bool objectState) noexcept
|
||||
void ObjectFunctions::SetObjectState(bool objectState) noexcept
|
||||
{
|
||||
tempObject.objectState = objectState;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectLockLevel(int lockLevel) noexcept
|
||||
void ObjectFunctions::SetObjectLockLevel(int lockLevel) noexcept
|
||||
{
|
||||
tempObject.lockLevel = lockLevel;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectDisarmState(bool disarmState) noexcept
|
||||
void ObjectFunctions::SetObjectDisarmState(bool disarmState) noexcept
|
||||
{
|
||||
tempObject.isDisarmed = disarmState;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectMasterState(bool masterState) noexcept
|
||||
void ObjectFunctions::SetObjectMasterState(bool masterState) noexcept
|
||||
{
|
||||
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[1] = y;
|
||||
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[1] = y;
|
||||
tempObject.position.rot[2] = z;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectDoorState(int doorState) noexcept
|
||||
void ObjectFunctions::SetObjectDoorState(int doorState) noexcept
|
||||
{
|
||||
tempObject.doorState = doorState;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
|
||||
void ObjectFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
|
||||
{
|
||||
tempObject.teleportState = teleportState;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
|
||||
void ObjectFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
|
||||
{
|
||||
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[1] = y;
|
||||
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[2] = z;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
||||
void ObjectFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
@ -295,32 +295,32 @@ void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
|||
tempObject.isPlayer = true;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetContainerItemRefId(const char* refId) noexcept
|
||||
void ObjectFunctions::SetContainerItemRefId(const char* refId) noexcept
|
||||
{
|
||||
tempContainerItem.refId = refId;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetContainerItemCount(int count) noexcept
|
||||
void ObjectFunctions::SetContainerItemCount(int count) noexcept
|
||||
{
|
||||
tempContainerItem.count = count;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetContainerItemCharge(int charge) noexcept
|
||||
void ObjectFunctions::SetContainerItemCharge(int charge) noexcept
|
||||
{
|
||||
tempContainerItem.charge = charge;
|
||||
}
|
||||
|
||||
void WorldFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept
|
||||
void ObjectFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void WorldFunctions::AddObject() noexcept
|
||||
void ObjectFunctions::AddObject() noexcept
|
||||
{
|
||||
tempObject.droppedByPlayer = false;
|
||||
writeObjectList.baseObjects.push_back(tempObject);
|
||||
|
@ -328,14 +328,14 @@ void WorldFunctions::AddObject() noexcept
|
|||
tempObject = emptyObject;
|
||||
}
|
||||
|
||||
void WorldFunctions::AddContainerItem() noexcept
|
||||
void ObjectFunctions::AddContainerItem() noexcept
|
||||
{
|
||||
tempObject.containerItems.push_back(tempContainerItem);
|
||||
|
||||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -345,7 +345,7 @@ void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -355,7 +355,7 @@ void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -365,7 +365,7 @@ void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -375,7 +375,7 @@ void WorldFunctions::SendObjectLock(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -385,7 +385,7 @@ void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -395,7 +395,7 @@ void WorldFunctions::SendObjectScale(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -405,7 +405,7 @@ void WorldFunctions::SendObjectState(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -415,7 +415,7 @@ void WorldFunctions::SendDoorState(bool broadcast) noexcept
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -425,7 +425,7 @@ void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
|
|||
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);
|
||||
|
||||
|
@ -440,7 +440,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) n
|
|||
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);
|
||||
packet->setObjectList(&writeObjectList);
|
||||
|
@ -450,7 +450,7 @@ void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
|
|||
packet->Send(true);
|
||||
}
|
||||
|
||||
void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
|
||||
void ObjectFunctions::SetHour(unsigned short pid, double hour) noexcept
|
||||
{
|
||||
Player *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);
|
||||
}
|
||||
|
||||
void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
|
||||
void ObjectFunctions::SetMonth(unsigned short pid, int month) noexcept
|
||||
{
|
||||
Player *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;
|
||||
GET_PLAYER(pid, player,);
|
|
@ -1,93 +1,93 @@
|
|||
#ifndef OPENMW_WORLDAPI_HPP
|
||||
#define OPENMW_WORLDAPI_HPP
|
||||
#ifndef OPENMW_OBJECTAPI_HPP
|
||||
#define OPENMW_OBJECTAPI_HPP
|
||||
|
||||
#define WORLDAPI \
|
||||
{"ReadLastObjectList", WorldFunctions::ReadLastObjectList},\
|
||||
{"InitializeObjectList", WorldFunctions::InitializeObjectList},\
|
||||
#define OBJECTAPI \
|
||||
{"ReadLastObjectList", ObjectFunctions::ReadLastObjectList},\
|
||||
{"InitializeObjectList", ObjectFunctions::InitializeObjectList},\
|
||||
\
|
||||
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
|
||||
{"GetObjectListAction", WorldFunctions::GetObjectListAction},\
|
||||
{"GetObjectListContainerSubAction", WorldFunctions::GetObjectListContainerSubAction},\
|
||||
{"GetObjectChangesSize", ObjectFunctions::GetObjectChangesSize},\
|
||||
{"GetObjectListAction", ObjectFunctions::GetObjectListAction},\
|
||||
{"GetObjectListContainerSubAction", ObjectFunctions::GetObjectListContainerSubAction},\
|
||||
\
|
||||
{"GetObjectRefId", WorldFunctions::GetObjectRefId},\
|
||||
{"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\
|
||||
{"GetObjectMpNum", WorldFunctions::GetObjectMpNum},\
|
||||
{"GetObjectCount", WorldFunctions::GetObjectCount},\
|
||||
{"GetObjectCharge", WorldFunctions::GetObjectCharge},\
|
||||
{"GetObjectEnchantmentCharge", WorldFunctions::GetObjectEnchantmentCharge},\
|
||||
{"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\
|
||||
{"GetObjectScale", WorldFunctions::GetObjectScale},\
|
||||
{"GetObjectState", WorldFunctions::GetObjectState},\
|
||||
{"GetObjectDoorState", WorldFunctions::GetObjectDoorState},\
|
||||
{"GetObjectLockLevel", WorldFunctions::GetObjectLockLevel},\
|
||||
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\
|
||||
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\
|
||||
{"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\
|
||||
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\
|
||||
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\
|
||||
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\
|
||||
{"GetObjectRefId", ObjectFunctions::GetObjectRefId},\
|
||||
{"GetObjectRefNumIndex", ObjectFunctions::GetObjectRefNumIndex},\
|
||||
{"GetObjectMpNum", ObjectFunctions::GetObjectMpNum},\
|
||||
{"GetObjectCount", ObjectFunctions::GetObjectCount},\
|
||||
{"GetObjectCharge", ObjectFunctions::GetObjectCharge},\
|
||||
{"GetObjectEnchantmentCharge", ObjectFunctions::GetObjectEnchantmentCharge},\
|
||||
{"GetObjectGoldValue", ObjectFunctions::GetObjectGoldValue},\
|
||||
{"GetObjectScale", ObjectFunctions::GetObjectScale},\
|
||||
{"GetObjectState", ObjectFunctions::GetObjectState},\
|
||||
{"GetObjectDoorState", ObjectFunctions::GetObjectDoorState},\
|
||||
{"GetObjectLockLevel", ObjectFunctions::GetObjectLockLevel},\
|
||||
{"GetObjectPosX", ObjectFunctions::GetObjectPosX},\
|
||||
{"GetObjectPosY", ObjectFunctions::GetObjectPosY},\
|
||||
{"GetObjectPosZ", ObjectFunctions::GetObjectPosZ},\
|
||||
{"GetObjectRotX", ObjectFunctions::GetObjectRotX},\
|
||||
{"GetObjectRotY", ObjectFunctions::GetObjectRotY},\
|
||||
{"GetObjectRotZ", ObjectFunctions::GetObjectRotZ},\
|
||||
\
|
||||
{"GetContainerChangesSize", WorldFunctions::GetContainerChangesSize},\
|
||||
{"GetContainerItemRefId", WorldFunctions::GetContainerItemRefId},\
|
||||
{"GetContainerItemCount", WorldFunctions::GetContainerItemCount},\
|
||||
{"GetContainerItemCharge", WorldFunctions::GetContainerItemCharge},\
|
||||
{"GetContainerItemEnchantmentCharge", WorldFunctions::GetContainerItemEnchantmentCharge},\
|
||||
{"GetContainerItemActionCount", WorldFunctions::GetContainerItemActionCount},\
|
||||
{"GetContainerChangesSize", ObjectFunctions::GetContainerChangesSize},\
|
||||
{"GetContainerItemRefId", ObjectFunctions::GetContainerItemRefId},\
|
||||
{"GetContainerItemCount", ObjectFunctions::GetContainerItemCount},\
|
||||
{"GetContainerItemCharge", ObjectFunctions::GetContainerItemCharge},\
|
||||
{"GetContainerItemEnchantmentCharge", ObjectFunctions::GetContainerItemEnchantmentCharge},\
|
||||
{"GetContainerItemActionCount", ObjectFunctions::GetContainerItemActionCount},\
|
||||
\
|
||||
{"SetObjectListCell", WorldFunctions::SetObjectListCell},\
|
||||
{"SetObjectListAction", WorldFunctions::SetObjectListAction},\
|
||||
{"SetObjectListConsoleCommand", WorldFunctions::SetObjectListConsoleCommand},\
|
||||
{"SetObjectListCell", ObjectFunctions::SetObjectListCell},\
|
||||
{"SetObjectListAction", ObjectFunctions::SetObjectListAction},\
|
||||
{"SetObjectListConsoleCommand", ObjectFunctions::SetObjectListConsoleCommand},\
|
||||
\
|
||||
{"SetObjectRefId", WorldFunctions::SetObjectRefId},\
|
||||
{"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\
|
||||
{"SetObjectMpNum", WorldFunctions::SetObjectMpNum},\
|
||||
{"SetObjectCount", WorldFunctions::SetObjectCount},\
|
||||
{"SetObjectCharge", WorldFunctions::SetObjectCharge},\
|
||||
{"SetObjectEnchantmentCharge", WorldFunctions::SetObjectEnchantmentCharge},\
|
||||
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
|
||||
{"SetObjectScale", WorldFunctions::SetObjectScale},\
|
||||
{"SetObjectState", WorldFunctions::SetObjectState},\
|
||||
{"SetObjectLockLevel", WorldFunctions::SetObjectLockLevel},\
|
||||
{"SetObjectDisarmState", WorldFunctions::SetObjectDisarmState},\
|
||||
{"SetObjectMasterState", WorldFunctions::SetObjectMasterState},\
|
||||
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
|
||||
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\
|
||||
{"SetObjectRefId", ObjectFunctions::SetObjectRefId},\
|
||||
{"SetObjectRefNumIndex", ObjectFunctions::SetObjectRefNumIndex},\
|
||||
{"SetObjectMpNum", ObjectFunctions::SetObjectMpNum},\
|
||||
{"SetObjectCount", ObjectFunctions::SetObjectCount},\
|
||||
{"SetObjectCharge", ObjectFunctions::SetObjectCharge},\
|
||||
{"SetObjectEnchantmentCharge", ObjectFunctions::SetObjectEnchantmentCharge},\
|
||||
{"SetObjectGoldValue", ObjectFunctions::SetObjectGoldValue},\
|
||||
{"SetObjectScale", ObjectFunctions::SetObjectScale},\
|
||||
{"SetObjectState", ObjectFunctions::SetObjectState},\
|
||||
{"SetObjectLockLevel", ObjectFunctions::SetObjectLockLevel},\
|
||||
{"SetObjectDisarmState", ObjectFunctions::SetObjectDisarmState},\
|
||||
{"SetObjectMasterState", ObjectFunctions::SetObjectMasterState},\
|
||||
{"SetObjectPosition", ObjectFunctions::SetObjectPosition},\
|
||||
{"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
|
||||
\
|
||||
{"SetObjectDoorState", WorldFunctions::SetObjectDoorState},\
|
||||
{"SetObjectDoorTeleportState", WorldFunctions::SetObjectDoorTeleportState},\
|
||||
{"SetObjectDoorDestinationCell", WorldFunctions::SetObjectDoorDestinationCell},\
|
||||
{"SetObjectDoorDestinationPosition", WorldFunctions::SetObjectDoorDestinationPosition},\
|
||||
{"SetObjectDoorDestinationRotation", WorldFunctions::SetObjectDoorDestinationRotation},\
|
||||
{"SetObjectDoorState", ObjectFunctions::SetObjectDoorState},\
|
||||
{"SetObjectDoorTeleportState", ObjectFunctions::SetObjectDoorTeleportState},\
|
||||
{"SetObjectDoorDestinationCell", ObjectFunctions::SetObjectDoorDestinationCell},\
|
||||
{"SetObjectDoorDestinationPosition", ObjectFunctions::SetObjectDoorDestinationPosition},\
|
||||
{"SetObjectDoorDestinationRotation", ObjectFunctions::SetObjectDoorDestinationRotation},\
|
||||
\
|
||||
{"SetPlayerAsObject", WorldFunctions::SetPlayerAsObject},\
|
||||
{"SetPlayerAsObject", ObjectFunctions::SetPlayerAsObject},\
|
||||
\
|
||||
{"SetContainerItemRefId", WorldFunctions::SetContainerItemRefId},\
|
||||
{"SetContainerItemCount", WorldFunctions::SetContainerItemCount},\
|
||||
{"SetContainerItemCharge", WorldFunctions::SetContainerItemCharge},\
|
||||
{"SetContainerItemEnchantmentCharge", WorldFunctions::SetContainerItemEnchantmentCharge},\
|
||||
{"SetContainerItemRefId", ObjectFunctions::SetContainerItemRefId},\
|
||||
{"SetContainerItemCount", ObjectFunctions::SetContainerItemCount},\
|
||||
{"SetContainerItemCharge", ObjectFunctions::SetContainerItemCharge},\
|
||||
{"SetContainerItemEnchantmentCharge", ObjectFunctions::SetContainerItemEnchantmentCharge},\
|
||||
\
|
||||
{"SetReceivedContainerItemActionCount", WorldFunctions::SetReceivedContainerItemActionCount},\
|
||||
{"SetReceivedContainerItemActionCount", ObjectFunctions::SetReceivedContainerItemActionCount},\
|
||||
\
|
||||
{"AddObject", WorldFunctions::AddObject},\
|
||||
{"AddContainerItem", WorldFunctions::AddContainerItem},\
|
||||
{"AddObject", ObjectFunctions::AddObject},\
|
||||
{"AddContainerItem", ObjectFunctions::AddContainerItem},\
|
||||
\
|
||||
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\
|
||||
{"SendObjectSpawn", WorldFunctions::SendObjectSpawn},\
|
||||
{"SendObjectDelete", WorldFunctions::SendObjectDelete},\
|
||||
{"SendObjectLock", WorldFunctions::SendObjectLock},\
|
||||
{"SendObjectTrap", WorldFunctions::SendObjectTrap},\
|
||||
{"SendObjectScale", WorldFunctions::SendObjectScale},\
|
||||
{"SendObjectState", WorldFunctions::SendObjectState},\
|
||||
{"SendDoorState", WorldFunctions::SendDoorState},\
|
||||
{"SendDoorDestination", WorldFunctions::SendDoorDestination},\
|
||||
{"SendContainer", WorldFunctions::SendContainer},\
|
||||
{"SendConsoleCommand", WorldFunctions::SendConsoleCommand},\
|
||||
{"SendObjectPlace", ObjectFunctions::SendObjectPlace},\
|
||||
{"SendObjectSpawn", ObjectFunctions::SendObjectSpawn},\
|
||||
{"SendObjectDelete", ObjectFunctions::SendObjectDelete},\
|
||||
{"SendObjectLock", ObjectFunctions::SendObjectLock},\
|
||||
{"SendObjectTrap", ObjectFunctions::SendObjectTrap},\
|
||||
{"SendObjectScale", ObjectFunctions::SendObjectScale},\
|
||||
{"SendObjectState", ObjectFunctions::SendObjectState},\
|
||||
{"SendDoorState", ObjectFunctions::SendDoorState},\
|
||||
{"SendDoorDestination", ObjectFunctions::SendDoorDestination},\
|
||||
{"SendContainer", ObjectFunctions::SendContainer},\
|
||||
{"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\
|
||||
\
|
||||
{"SetHour", WorldFunctions::SetHour},\
|
||||
{"SetMonth", WorldFunctions::SetMonth},\
|
||||
{"SetDay", WorldFunctions::SetDay}
|
||||
{"SetHour", ObjectFunctions::SetHour},\
|
||||
{"SetMonth", ObjectFunctions::SetMonth},\
|
||||
{"SetDay", ObjectFunctions::SetDay}
|
||||
|
||||
class WorldFunctions
|
||||
class ObjectFunctions
|
||||
{
|
||||
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/Spells.hpp>
|
||||
#include <Script/Functions/Stats.hpp>
|
||||
#include <Script/Functions/World.hpp>
|
||||
#include <Script/Functions/Objects.hpp>
|
||||
#include <RakNetTypes.h>
|
||||
//#include <amx/amx.h>
|
||||
#include <tuple>
|
||||
|
@ -291,7 +291,7 @@ public:
|
|||
SETTINGSAPI,
|
||||
SPELLAPI,
|
||||
STATAPI,
|
||||
WORLDAPI
|
||||
OBJECTAPI
|
||||
};
|
||||
|
||||
static constexpr ScriptCallbackData callbacks[]{
|
||||
|
|
Loading…
Reference in a new issue