mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 03:45:32 +00:00
[Server] Rename ClearScriptEvent into InitScriptEvent with pid argument
This commit is contained in:
parent
868c837aa0
commit
af35ee38d1
2 changed files with 28 additions and 45 deletions
|
@ -15,10 +15,14 @@ ContainerItem tempContainerItem;
|
|||
|
||||
std::regex exteriorCellPattern("^(-?\\d+), (-?\\d+)$");
|
||||
|
||||
void WorldFunctions::ClearScriptEvent() noexcept
|
||||
void WorldFunctions::InitScriptEvent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
scriptEvent.cell.blank();
|
||||
scriptEvent.objectChanges.objects.clear();
|
||||
scriptEvent.guid = player->guid;
|
||||
}
|
||||
|
||||
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
|
||||
|
@ -256,60 +260,39 @@ void WorldFunctions::AddContainerItem() noexcept
|
|||
tempWorldObject.containerChanges.items.push_back(containerItem);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendObjectDelete(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendObjectDelete() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendObjectPlace(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendObjectPlace() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_PLACE)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_PLACE)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendObjectScale(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendObjectScale() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_SCALE)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_SCALE)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendObjectLock(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendObjectLock() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_LOCK)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_LOCK)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendObjectUnlock(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendObjectUnlock() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_UNLOCK)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_UNLOCK)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendDoorState(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendDoorState() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_DOOR_STATE)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_DOOR_STATE)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SendContainer(unsigned short pid) noexcept
|
||||
void WorldFunctions::SendContainer() noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_CONTAINER)->Send(&scriptEvent, player->guid);
|
||||
mwmp::Networking::get().getWorldController()->GetPacket(ID_CONTAINER)->Send(&scriptEvent, scriptEvent.guid);
|
||||
}
|
||||
|
||||
void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define OPENMW_WORLD_HPP
|
||||
|
||||
#define WORLDFUNCTIONS \
|
||||
{"ClearScriptEvent", WorldFunctions::ClearScriptEvent},\
|
||||
{"InitScriptEvent", WorldFunctions::InitScriptEvent},\
|
||||
\
|
||||
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
|
||||
{"GetLastEventAction", WorldFunctions::GetLastEventAction},\
|
||||
|
@ -65,7 +65,7 @@ class WorldFunctions
|
|||
{
|
||||
public:
|
||||
|
||||
static void ClearScriptEvent() noexcept;
|
||||
static void InitScriptEvent(unsigned short pid) noexcept;
|
||||
|
||||
static unsigned int GetObjectChangesSize() noexcept;
|
||||
static unsigned int GetLastEventAction() noexcept;
|
||||
|
@ -112,13 +112,13 @@ public:
|
|||
static void AddWorldObject() noexcept;
|
||||
static void AddContainerItem() noexcept;
|
||||
|
||||
static void SendObjectDelete(unsigned short pid) noexcept;
|
||||
static void SendObjectPlace(unsigned short pid) noexcept;
|
||||
static void SendObjectScale(unsigned short pid) noexcept;
|
||||
static void SendObjectLock(unsigned short pid) noexcept;
|
||||
static void SendObjectUnlock(unsigned short pid) noexcept;
|
||||
static void SendDoorState(unsigned short pid) noexcept;
|
||||
static void SendContainer(unsigned short pid) noexcept;
|
||||
static void SendObjectDelete() noexcept;
|
||||
static void SendObjectPlace() noexcept;
|
||||
static void SendObjectScale() noexcept;
|
||||
static void SendObjectLock() noexcept;
|
||||
static void SendObjectUnlock() noexcept;
|
||||
static void SendDoorState() noexcept;
|
||||
static void SendContainer() noexcept;
|
||||
|
||||
static void SetHour(unsigned short pid, double hour) noexcept;
|
||||
static void SetMonth(unsigned short pid, int month) noexcept;
|
||||
|
|
Loading…
Reference in a new issue