mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
[Server] Turn sendToAttachedPlayer into skipAttachedPlayer
Unfortunately, default values set in the C++ code for our script function parameters don't actually seem to work, and they always default to false because they receive a nil value from Lua. As a result, to not break compatibility with previous scripts, I've decided to use a skipAttachedPlayer argument instead so it can default to false while still providing the same benefits that sendToAttachedPlayer provided.
This commit is contained in:
parent
141e404ed9
commit
2f1ef049d2
19 changed files with 72 additions and 73 deletions
|
@ -45,7 +45,7 @@ const char *BookFunctions::GetBookId(unsigned short pid, unsigned int i) noexcep
|
||||||
return player->bookChanges.books.at(i).bookId.c_str();
|
return player->bookChanges.books.at(i).bookId.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -54,7 +54,7 @@ void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers,
|
||||||
|
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendBookChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
||||||
#include <apps/openmw-mp/Networking.hpp>
|
#include <apps/openmw-mp/Networking.hpp>
|
||||||
|
|
||||||
void ChatFunctions::SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ChatFunctions::SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,);
|
GET_PLAYER(pid, player,);
|
||||||
|
@ -18,7 +18,7 @@ void ChatFunctions::SendMessage(unsigned short pid, const char *message, bool se
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_CHAT_MESSAGE);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_CHAT_MESSAGE);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Remove all messages from chat for a certain player.
|
* \brief Remove all messages from chat for a certain player.
|
||||||
|
|
|
@ -45,7 +45,7 @@ const char *DialogueFunctions::GetTopicId(unsigned short pid, unsigned int i) no
|
||||||
return player->topicChanges.topics.at(i).topicId.c_str();
|
return player->topicChanges.topics.at(i).topicId.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueFunctions::SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void DialogueFunctions::SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -53,7 +53,7 @@ void DialogueFunctions::SendTopicChanges(unsigned short pid, bool sendToOtherPla
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendTopicChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
static void PlayAnimation(unsigned short pid, const char* groupname, int mode = 0, int count = 1, bool persist = false) noexcept;
|
static void PlayAnimation(unsigned short pid, const char* groupname, int mode = 0, int count = 1, bool persist = false) noexcept;
|
||||||
static void PlaySpeech(unsigned short pid, const char* sound) noexcept;
|
static void PlaySpeech(unsigned short pid, const char* sound) noexcept;
|
||||||
|
|
|
@ -108,7 +108,7 @@ void FactionFunctions::AddFaction(unsigned short pid) noexcept
|
||||||
tempFaction = emptyFaction;
|
tempFaction = emptyFaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FactionFunctions::SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void FactionFunctions::SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -116,7 +116,7 @@ void FactionFunctions::SendFactionChanges(unsigned short pid, bool sendToOtherPl
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendFactionChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -177,7 +177,7 @@ void ItemFunctions::SendEquipment(unsigned short pid) noexcept
|
||||||
player->equipmentIndexChanges.clear();
|
player->equipmentIndexChanges.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemFunctions::SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ItemFunctions::SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -185,7 +185,7 @@ void ItemFunctions::SendInventoryChanges(unsigned short pid, bool sendToOtherPla
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -217,7 +217,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -399,133 +399,133 @@ void ObjectFunctions::AddContainerItem() noexcept
|
||||||
tempContainerItem = emptyContainerItem;
|
tempContainerItem = emptyContainerItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectPlace(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectSpawn(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectDelete(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectLock(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectTrap(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectScale(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendObjectState(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendDoorState(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendDoorDestination(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendContainer(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
|
||||||
packet->setObjectList(&writeObjectList);
|
packet->setObjectList(&writeObjectList);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendVideoPlay(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_VIDEO_PLAY);
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_VIDEO_PLAY);
|
||||||
packet->setObjectList(&writeObjectList);
|
packet->setObjectList(&writeObjectList);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFunctions::SendConsoleCommand(bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void ObjectFunctions::SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) 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);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -785,7 +785,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectPlace(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectSpawn packet.
|
* \brief Send an ObjectSpawn packet.
|
||||||
|
@ -796,7 +796,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectSpawn(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectDelete packet.
|
* \brief Send an ObjectDelete packet.
|
||||||
|
@ -806,7 +806,7 @@ public:
|
||||||
*
|
*
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectDelete(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectLock packet.
|
* \brief Send an ObjectLock packet.
|
||||||
|
@ -817,7 +817,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectLock(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectTrap packet.
|
* \brief Send an ObjectTrap packet.
|
||||||
|
@ -827,7 +827,7 @@ public:
|
||||||
*
|
*
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectTrap(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectScale packet.
|
* \brief Send an ObjectScale packet.
|
||||||
|
@ -838,7 +838,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectScale(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send an ObjectState packet.
|
* \brief Send an ObjectState packet.
|
||||||
|
@ -849,7 +849,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendObjectState(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a DoorState packet.
|
* \brief Send a DoorState packet.
|
||||||
|
@ -860,7 +860,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendDoorState(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a DoorDestination packet.
|
* \brief Send a DoorDestination packet.
|
||||||
|
@ -871,7 +871,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendDoorDestination(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a Container packet.
|
* \brief Send a Container packet.
|
||||||
|
@ -882,7 +882,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendContainer(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a VideoPlay packet.
|
* \brief Send a VideoPlay packet.
|
||||||
|
@ -893,7 +893,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendVideoPlay(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a ConsoleCommand packet.
|
* \brief Send a ConsoleCommand packet.
|
||||||
|
@ -904,7 +904,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendConsoleCommand(bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
|
|
||||||
// All methods below are deprecated versions of methods from above
|
// All methods below are deprecated versions of methods from above
|
||||||
|
|
|
@ -149,7 +149,7 @@ int QuestFunctions::GetReputation(unsigned short pid) noexcept
|
||||||
return player->npcStats.mReputation;
|
return player->npcStats.mReputation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestFunctions::SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void QuestFunctions::SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -157,13 +157,13 @@ void QuestFunctions::SendJournalChanges(unsigned short pid, bool sendToOtherPlay
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestFunctions::SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void QuestFunctions::SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -171,13 +171,13 @@ void QuestFunctions::SendKillChanges(unsigned short pid, bool sendToOtherPlayers
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestFunctions::SendReputation(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void QuestFunctions::SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -185,7 +185,7 @@ void QuestFunctions::SendReputation(unsigned short pid, bool sendToOtherPlayers,
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_REPUTATION);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_REPUTATION);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -181,7 +181,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendJournalChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a PlayerKillCount packet with a player's recorded kill count changes.
|
* \brief Send a PlayerKillCount packet with a player's recorded kill count changes.
|
||||||
|
@ -193,7 +193,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendKillChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a PlayerReputation packet with a player's recorded reputation.
|
* \brief Send a PlayerReputation packet with a player's recorded reputation.
|
||||||
|
@ -205,7 +205,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendReputation(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,7 @@ int SpellFunctions::GetSpellEffectMagnMax(unsigned short pid, unsigned int i, un
|
||||||
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mMagnMax;
|
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mMagnMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -277,7 +277,7 @@ void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPl
|
||||||
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK);
|
mwmp::PlayerPacket *packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK);
|
||||||
packet->setPlayer(player);
|
packet->setPlayer(player);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -261,7 +261,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ void WorldstateFunctions::LoadMapTileImageFile(int cellX, int cellY, const char*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldstateFunctions::SendWorldMap(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void WorldstateFunctions::SendWorldMap(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -147,13 +147,13 @@ void WorldstateFunctions::SendWorldMap(unsigned short pid, bool sendToOtherPlaye
|
||||||
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_MAP);
|
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_MAP);
|
||||||
packet->setWorldstate(&writeWorldstate);
|
packet->setWorldstate(&writeWorldstate);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldstateFunctions::SendWorldTime(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void WorldstateFunctions::SendWorldTime(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -163,13 +163,13 @@ void WorldstateFunctions::SendWorldTime(unsigned short pid, bool sendToOtherPlay
|
||||||
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME);
|
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME);
|
||||||
packet->setWorldstate(&writeWorldstate);
|
packet->setWorldstate(&writeWorldstate);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldstateFunctions::SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool sendToAttachedPlayer) noexcept
|
void WorldstateFunctions::SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
@ -179,7 +179,7 @@ void WorldstateFunctions::SendWorldCollisionOverride(unsigned short pid, bool se
|
||||||
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_COLLISION_OVERRIDE);
|
mwmp::WorldstatePacket *packet = mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_COLLISION_OVERRIDE);
|
||||||
packet->setWorldstate(&writeWorldstate);
|
packet->setWorldstate(&writeWorldstate);
|
||||||
|
|
||||||
if (sendToAttachedPlayer)
|
if (!skipAttachedPlayer)
|
||||||
packet->Send(false);
|
packet->Send(false);
|
||||||
if (sendToOtherPlayers)
|
if (sendToOtherPlayers)
|
||||||
packet->Send(true);
|
packet->Send(true);
|
||||||
|
|
|
@ -223,7 +223,7 @@ public:
|
||||||
* or to all players on the server.
|
* or to all players on the server.
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendWorldMap(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendWorldMap(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a WorldTime packet with the current time and time scale in the write-only
|
* \brief Send a WorldTime packet with the current time and time scale in the write-only
|
||||||
|
@ -236,7 +236,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendWorldTime(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendWorldTime(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a WorldCollisionOverride packet with the current collision overrides in
|
* \brief Send a WorldCollisionOverride packet with the current collision overrides in
|
||||||
|
@ -249,7 +249,7 @@ public:
|
||||||
* to the packet (true by default).
|
* to the packet (true by default).
|
||||||
* \return void
|
* \return void
|
||||||
*/
|
*/
|
||||||
static void SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers = false, bool sendToAttachedPlayer = true) noexcept;
|
static void SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <apps/openmw-mp/Player.hpp>
|
#include <apps/openmw-mp/Player.hpp>
|
||||||
#include <apps/openmw-mp/Networking.hpp>
|
#include <apps/openmw-mp/Networking.hpp>
|
||||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||||
#include <components/openmw-mp/Version.hpp>
|
|
||||||
|
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
constexpr char TypeString<Types...>::value[];
|
constexpr char TypeString<Types...>::value[];
|
||||||
|
|
Loading…
Reference in a new issue