forked from teamnwah/openmw-tes3coop
[Server] Rework script functons by removing unnecessary vector buffers
Add new initialization script functions to allow clearing all player changes vectors in a manner consistent with Actor and World functions Add toOthers boolean to all methods that send packets with player changes vectors
This commit is contained in:
parent
2c05b7f747
commit
6dde0ca9c9
15 changed files with 188 additions and 140 deletions
|
@ -70,16 +70,6 @@ public:
|
||||||
|
|
||||||
void forEachLoaded(std::function<void(Player *pl, Player *other)> func);
|
void forEachLoaded(std::function<void(Player *pl, Player *other)> func);
|
||||||
|
|
||||||
public:
|
|
||||||
mwmp::InventoryChanges inventoryChangesBuffer;
|
|
||||||
mwmp::SpellbookChanges spellbookChangesBuffer;
|
|
||||||
mwmp::JournalChanges journalChangesBuffer;
|
|
||||||
mwmp::FactionChanges factionChangesBuffer;
|
|
||||||
mwmp::TopicChanges topicChangesBuffer;
|
|
||||||
mwmp::KillChanges killChangesBuffer;
|
|
||||||
mwmp::BookChanges bookChangesBuffer;
|
|
||||||
mwmp::MapChanges mapChangesBuffer;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CellController::TContainer cells;
|
CellController::TContainer cells;
|
||||||
bool handshakeState;
|
bool handshakeState;
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void BookFunctions::InitializeBookChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
return player->bookChanges.books.clear();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int BookFunctions::GetBookChangesSize(unsigned short pid) noexcept
|
unsigned int BookFunctions::GetBookChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -21,7 +29,7 @@ void BookFunctions::AddBook(unsigned short pid, const char* bookId) noexcept
|
||||||
mwmp::Book book;
|
mwmp::Book book;
|
||||||
book.bookId = bookId;
|
book.bookId = bookId;
|
||||||
|
|
||||||
player->bookChangesBuffer.books.push_back(book);
|
player->bookChanges.books.push_back(book);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *BookFunctions::GetBookId(unsigned short pid, unsigned int i) noexcept
|
const char *BookFunctions::GetBookId(unsigned short pid, unsigned int i) noexcept
|
||||||
|
@ -35,14 +43,11 @@ 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) noexcept
|
void BookFunctions::SendBookChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->bookChanges, player->bookChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_BOOK)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_BOOK)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_BOOK)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_BOOK)->Send(toOthers);
|
||||||
player->bookChanges = std::move(player->bookChangesBuffer);
|
|
||||||
player->bookChangesBuffer.books.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#define OPENMW_BOOKAPI_HPP
|
#define OPENMW_BOOKAPI_HPP
|
||||||
|
|
||||||
#define BOOKAPI \
|
#define BOOKAPI \
|
||||||
|
{"InitializeBookChanges", BookFunctions::InitializeBookChanges},\
|
||||||
|
\
|
||||||
{"GetBookChangesSize", BookFunctions::GetBookChangesSize},\
|
{"GetBookChangesSize", BookFunctions::GetBookChangesSize},\
|
||||||
\
|
\
|
||||||
{"AddBook", BookFunctions::AddBook},\
|
{"AddBook", BookFunctions::AddBook},\
|
||||||
|
@ -14,13 +16,15 @@ class BookFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeBookChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetBookChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetBookChangesSize(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static void AddBook(unsigned short pid, const char* bookId) noexcept;
|
static void AddBook(unsigned short pid, const char* bookId) noexcept;
|
||||||
|
|
||||||
static const char *GetBookId(unsigned short pid, unsigned int i) noexcept;
|
static const char *GetBookId(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendBookChanges(unsigned short pid) noexcept;
|
static void SendBookChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,14 @@ using namespace std;
|
||||||
|
|
||||||
static std::string tempCellDescription;
|
static std::string tempCellDescription;
|
||||||
|
|
||||||
|
void CellFunctions::InitializeMapChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->mapChanges.cellsExplored.clear();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int CellFunctions::GetCellStateChangesSize(unsigned short pid) noexcept
|
unsigned int CellFunctions::GetCellStateChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -119,7 +127,7 @@ void CellFunctions::AddCellExplored(unsigned short pid, const char* cellDescript
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
ESM::Cell cellExplored = Utils::getCellFromDescription(cellDescription);
|
ESM::Cell cellExplored = Utils::getCellFromDescription(cellDescription);
|
||||||
player->mapChangesBuffer.cellsExplored.push_back(cellExplored);
|
player->mapChanges.cellsExplored.push_back(cellExplored);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CellFunctions::SendCell(unsigned short pid) noexcept
|
void CellFunctions::SendCell(unsigned short pid) noexcept
|
||||||
|
@ -131,14 +139,11 @@ void CellFunctions::SendCell(unsigned short pid) noexcept
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_CELL_CHANGE)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_CELL_CHANGE)->Send(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CellFunctions::SendMapChanges(unsigned short pid) noexcept
|
void CellFunctions::SendMapChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->mapChanges, player->mapChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_MAP)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_MAP)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_MAP)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_MAP)->Send(toOthers);
|
||||||
player->mapChanges = std::move(player->mapChangesBuffer);
|
|
||||||
player->mapChangesBuffer.cellsExplored.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "../Types.hpp"
|
#include "../Types.hpp"
|
||||||
|
|
||||||
#define CELLAPI \
|
#define CELLAPI \
|
||||||
|
{"InitializeMapChanges", CellFunctions::InitializeMapChanges},\
|
||||||
|
\
|
||||||
{"GetCellStateChangesSize", CellFunctions::GetCellStateChangesSize},\
|
{"GetCellStateChangesSize", CellFunctions::GetCellStateChangesSize},\
|
||||||
\
|
\
|
||||||
{"GetCellStateType", CellFunctions::GetCellStateType},\
|
{"GetCellStateType", CellFunctions::GetCellStateType},\
|
||||||
|
@ -28,6 +30,9 @@
|
||||||
class CellFunctions
|
class CellFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeMapChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetCellStateChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetCellStateChangesSize(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetCellStateType(unsigned short pid, unsigned int i) noexcept;
|
static unsigned int GetCellStateType(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
@ -46,7 +51,7 @@ public:
|
||||||
static void AddCellExplored(unsigned short pid, const char* cellDescription) noexcept;
|
static void AddCellExplored(unsigned short pid, const char* cellDescription) noexcept;
|
||||||
|
|
||||||
static void SendCell(unsigned short pid) noexcept;
|
static void SendCell(unsigned short pid) noexcept;
|
||||||
static void SendMapChanges(unsigned short pid) noexcept;
|
static void SendMapChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //OPENMW_CELLAPI_HPP
|
#endif //OPENMW_CELLAPI_HPP
|
||||||
|
|
|
@ -5,6 +5,22 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void DialogueFunctions::InitializeTopicChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->topicChanges.topics.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogueFunctions::InitializeKillChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->killChanges.kills.clear();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int DialogueFunctions::GetTopicChangesSize(unsigned short pid) noexcept
|
unsigned int DialogueFunctions::GetTopicChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -29,7 +45,7 @@ void DialogueFunctions::AddTopic(unsigned short pid, const char* topicId) noexce
|
||||||
mwmp::Topic topic;
|
mwmp::Topic topic;
|
||||||
topic.topicId = topicId;
|
topic.topicId = topicId;
|
||||||
|
|
||||||
player->topicChangesBuffer.topics.push_back(topic);
|
player->topicChanges.topics.push_back(topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueFunctions::AddKill(unsigned short pid, const char* refId, int number) noexcept
|
void DialogueFunctions::AddKill(unsigned short pid, const char* refId, int number) noexcept
|
||||||
|
@ -41,7 +57,7 @@ void DialogueFunctions::AddKill(unsigned short pid, const char* refId, int numbe
|
||||||
kill.refId = refId;
|
kill.refId = refId;
|
||||||
kill.number = number;
|
kill.number = number;
|
||||||
|
|
||||||
player->killChangesBuffer.kills.push_back(kill);
|
player->killChanges.kills.push_back(kill);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *DialogueFunctions::GetTopicId(unsigned short pid, unsigned int i) noexcept
|
const char *DialogueFunctions::GetTopicId(unsigned short pid, unsigned int i) noexcept
|
||||||
|
@ -74,26 +90,20 @@ int DialogueFunctions::GetKillNumber(unsigned short pid, unsigned int i) noexcep
|
||||||
return player->killChanges.kills.at(i).number;
|
return player->killChanges.kills.at(i).number;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueFunctions::SendTopicChanges(unsigned short pid) noexcept
|
void DialogueFunctions::SendTopicChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->topicChanges, player->topicChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_TOPIC)->Send(toOthers);
|
||||||
player->topicChanges = std::move(player->topicChangesBuffer);
|
|
||||||
player->topicChangesBuffer.topics.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueFunctions::SendKillChanges(unsigned short pid) noexcept
|
void DialogueFunctions::SendKillChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->killChanges, player->killChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_KILL_COUNT)->Send(toOthers);
|
||||||
player->killChanges = std::move(player->killChangesBuffer);
|
|
||||||
player->killChangesBuffer.kills.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#define OPENMW_DIALOGUEAPI_HPP
|
#define OPENMW_DIALOGUEAPI_HPP
|
||||||
|
|
||||||
#define DIALOGUEAPI \
|
#define DIALOGUEAPI \
|
||||||
|
{"InitializeTopicChanges", DialogueFunctions::InitializeTopicChanges},\
|
||||||
|
{"InitializeKillChanges", DialogueFunctions::InitializeKillChanges},\
|
||||||
|
\
|
||||||
{"GetTopicChangesSize", DialogueFunctions::GetTopicChangesSize},\
|
{"GetTopicChangesSize", DialogueFunctions::GetTopicChangesSize},\
|
||||||
{"GetKillChangesSize", DialogueFunctions::GetKillChangesSize},\
|
{"GetKillChangesSize", DialogueFunctions::GetKillChangesSize},\
|
||||||
\
|
\
|
||||||
|
@ -19,6 +22,9 @@ class DialogueFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeTopicChanges(unsigned short pid) noexcept;
|
||||||
|
static void InitializeKillChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetTopicChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetTopicChangesSize(unsigned short pid) noexcept;
|
||||||
static unsigned int GetKillChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetKillChangesSize(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
@ -29,8 +35,8 @@ public:
|
||||||
static const char *GetKillRefId(unsigned short pid, unsigned int i) noexcept;
|
static const char *GetKillRefId(unsigned short pid, unsigned int i) noexcept;
|
||||||
static int GetKillNumber(unsigned short pid, unsigned int i) noexcept;
|
static int GetKillNumber(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendTopicChanges(unsigned short pid) noexcept;
|
static void SendTopicChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
static void SendKillChanges(unsigned short pid) noexcept;
|
static void SendKillChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,14 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void FactionFunctions::InitializeFactionChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->factionChanges.factions.clear();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int FactionFunctions::GetFactionChangesSize(unsigned short pid) noexcept
|
unsigned int FactionFunctions::GetFactionChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -22,19 +30,6 @@ unsigned char FactionFunctions::GetFactionChangesAction(unsigned short pid) noex
|
||||||
return player->factionChanges.action;
|
return player->factionChanges.action;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FactionFunctions::AddFaction(unsigned short pid, const char* factionId, unsigned int rank, bool isExpelled) noexcept
|
|
||||||
{
|
|
||||||
Player *player;
|
|
||||||
GET_PLAYER(pid, player, );
|
|
||||||
|
|
||||||
mwmp::Faction faction;
|
|
||||||
faction.factionId = factionId;
|
|
||||||
faction.rank = rank;
|
|
||||||
faction.isExpelled = isExpelled;
|
|
||||||
|
|
||||||
player->factionChangesBuffer.factions.push_back(faction);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *FactionFunctions::GetFactionId(unsigned short pid, unsigned int i) noexcept
|
const char *FactionFunctions::GetFactionId(unsigned short pid, unsigned int i) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -62,16 +57,32 @@ bool FactionFunctions::GetFactionExpelledState(unsigned short pid, unsigned int
|
||||||
return player->factionChanges.factions.at(i).isExpelled;
|
return player->factionChanges.factions.at(i).isExpelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FactionFunctions::SendFactionChanges(unsigned short pid) noexcept
|
void FactionFunctions::SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
player->factionChangesBuffer.action = mwmp::FactionChanges::BOTH;
|
player->factionChanges.action = action;
|
||||||
|
}
|
||||||
std::swap(player->factionChanges, player->factionChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION)->setPlayer(player);
|
void FactionFunctions::AddFaction(unsigned short pid, const char* factionId, unsigned int rank, bool isExpelled) noexcept
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION)->Send(false);
|
{
|
||||||
player->factionChanges = std::move(player->factionChangesBuffer);
|
Player *player;
|
||||||
player->factionChangesBuffer.factions.clear();
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
mwmp::Faction faction;
|
||||||
|
faction.factionId = factionId;
|
||||||
|
faction.rank = rank;
|
||||||
|
faction.isExpelled = isExpelled;
|
||||||
|
|
||||||
|
player->factionChanges.factions.push_back(faction);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FactionFunctions::SendFactionChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION)->setPlayer(player);
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_FACTION)->Send(toOthers);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,31 +2,37 @@
|
||||||
#define OPENMW_FACTIONAPI_HPP
|
#define OPENMW_FACTIONAPI_HPP
|
||||||
|
|
||||||
#define FACTIONAPI \
|
#define FACTIONAPI \
|
||||||
{"GetFactionChangesSize", FactionFunctions::GetFactionChangesSize},\
|
{"InitializeFactionChanges", FactionFunctions::InitializeFactionChanges},\
|
||||||
{"GetFactionChangesAction", FactionFunctions::GetFactionChangesAction},\
|
|
||||||
\
|
\
|
||||||
{"AddFaction", FactionFunctions::AddFaction},\
|
{"GetFactionChangesSize", FactionFunctions::GetFactionChangesSize},\
|
||||||
|
{"GetFactionChangesAction", FactionFunctions::GetFactionChangesAction},\
|
||||||
\
|
\
|
||||||
{"GetFactionId", FactionFunctions::GetFactionId},\
|
{"GetFactionId", FactionFunctions::GetFactionId},\
|
||||||
{"GetFactionRank", FactionFunctions::GetFactionRank},\
|
{"GetFactionRank", FactionFunctions::GetFactionRank},\
|
||||||
{"GetFactionExpelledState", FactionFunctions::GetFactionExpelledState},\
|
{"GetFactionExpelledState", FactionFunctions::GetFactionExpelledState},\
|
||||||
\
|
\
|
||||||
{"SendFactionChanges", FactionFunctions::SendFactionChanges}
|
{"SetFactionChangesAction", FactionFunctions::SetFactionChangesAction},\
|
||||||
|
{"AddFaction", FactionFunctions::AddFaction},\
|
||||||
|
\
|
||||||
|
{"SendFactionChanges", FactionFunctions::SendFactionChanges}
|
||||||
|
|
||||||
class FactionFunctions
|
class FactionFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeFactionChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetFactionChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetFactionChangesSize(unsigned short pid) noexcept;
|
||||||
static unsigned char GetFactionChangesAction(unsigned short pid) noexcept;
|
static unsigned char GetFactionChangesAction(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static void AddFaction(unsigned short pid, const char* factionId, unsigned int rank, bool isExpelled) noexcept;
|
|
||||||
|
|
||||||
static const char *GetFactionId(unsigned short pid, unsigned int i) noexcept;
|
static const char *GetFactionId(unsigned short pid, unsigned int i) noexcept;
|
||||||
static int GetFactionRank(unsigned short pid, unsigned int i) noexcept;
|
static int GetFactionRank(unsigned short pid, unsigned int i) noexcept;
|
||||||
static bool GetFactionExpelledState(unsigned short pid, unsigned int i) noexcept;
|
static bool GetFactionExpelledState(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendFactionChanges(unsigned short pid) noexcept;
|
static void SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept;
|
||||||
|
static void AddFaction(unsigned short pid, const char* factionId, unsigned int rank, bool isExpelled) noexcept;
|
||||||
|
|
||||||
|
static void SendFactionChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,6 +11,15 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void ItemFunctions::InitializeInventoryChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->inventoryChanges.items.clear();
|
||||||
|
player->inventoryChanges.action = InventoryChanges::SET;
|
||||||
|
}
|
||||||
|
|
||||||
int ItemFunctions::GetEquipmentSize() noexcept
|
int ItemFunctions::GetEquipmentSize() noexcept
|
||||||
{
|
{
|
||||||
return MWWorld::InventoryStore::Slots;
|
return MWWorld::InventoryStore::Slots;
|
||||||
|
@ -52,8 +61,8 @@ void ItemFunctions::AddItem(unsigned short pid, const char* refId, unsigned int
|
||||||
item.count = count;
|
item.count = count;
|
||||||
item.charge = charge;
|
item.charge = charge;
|
||||||
|
|
||||||
player->inventoryChangesBuffer.items.push_back(item);
|
player->inventoryChanges.items.push_back(item);
|
||||||
player->inventoryChangesBuffer.action = InventoryChanges::ADD;
|
player->inventoryChanges.action = InventoryChanges::ADD;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemFunctions::RemoveItem(unsigned short pid, const char* refId, unsigned short count) noexcept
|
void ItemFunctions::RemoveItem(unsigned short pid, const char* refId, unsigned short count) noexcept
|
||||||
|
@ -65,17 +74,8 @@ void ItemFunctions::RemoveItem(unsigned short pid, const char* refId, unsigned s
|
||||||
item.refId = refId;
|
item.refId = refId;
|
||||||
item.count = count;
|
item.count = count;
|
||||||
|
|
||||||
player->inventoryChangesBuffer.items.push_back(item);
|
player->inventoryChanges.items.push_back(item);
|
||||||
player->inventoryChangesBuffer.action = InventoryChanges::REMOVE;
|
player->inventoryChanges.action = InventoryChanges::REMOVE;
|
||||||
}
|
|
||||||
|
|
||||||
void ItemFunctions::ClearInventory(unsigned short pid) noexcept
|
|
||||||
{
|
|
||||||
Player *player;
|
|
||||||
GET_PLAYER(pid, player, );
|
|
||||||
|
|
||||||
player->inventoryChangesBuffer.items.clear();
|
|
||||||
player->inventoryChangesBuffer.action = InventoryChanges::SET;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemFunctions::HasItemEquipped(unsigned short pid, const char* refId)
|
bool ItemFunctions::HasItemEquipped(unsigned short pid, const char* refId)
|
||||||
|
@ -150,14 +150,11 @@ void ItemFunctions::SendEquipment(unsigned short pid) noexcept
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_EQUIPMENT)->Send(true);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_EQUIPMENT)->Send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemFunctions::SendInventoryChanges(unsigned short pid) noexcept
|
void ItemFunctions::SendInventoryChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->inventoryChanges, player->inventoryChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_INVENTORY)->Send(toOthers);
|
||||||
player->inventoryChanges = std::move(player->inventoryChangesBuffer);
|
|
||||||
player->inventoryChangesBuffer.items.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,33 +6,36 @@
|
||||||
#define OPENMW_ITEMAPI_HPP
|
#define OPENMW_ITEMAPI_HPP
|
||||||
|
|
||||||
#define ITEMAPI \
|
#define ITEMAPI \
|
||||||
{"GetEquipmentSize", ItemFunctions::GetEquipmentSize},\
|
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
|
||||||
{"GetInventoryChangesSize", ItemFunctions::GetInventoryChangesSize},\
|
|
||||||
\
|
\
|
||||||
{"EquipItem", ItemFunctions::EquipItem},\
|
{"GetEquipmentSize", ItemFunctions::GetEquipmentSize},\
|
||||||
{"UnequipItem", ItemFunctions::UnequipItem},\
|
{"GetInventoryChangesSize", ItemFunctions::GetInventoryChangesSize},\
|
||||||
\
|
\
|
||||||
{"AddItem", ItemFunctions::AddItem},\
|
{"EquipItem", ItemFunctions::EquipItem},\
|
||||||
{"RemoveItem", ItemFunctions::RemoveItem},\
|
{"UnequipItem", ItemFunctions::UnequipItem},\
|
||||||
{"ClearInventory", ItemFunctions::ClearInventory},\
|
|
||||||
\
|
\
|
||||||
{"HasItemEquipped", ItemFunctions::HasItemEquipped},\
|
{"AddItem", ItemFunctions::AddItem},\
|
||||||
|
{"RemoveItem", ItemFunctions::RemoveItem},\
|
||||||
\
|
\
|
||||||
{"GetEquipmentItemRefId", ItemFunctions::GetEquipmentItemRefId},\
|
{"HasItemEquipped", ItemFunctions::HasItemEquipped},\
|
||||||
{"GetEquipmentItemCount", ItemFunctions::GetEquipmentItemCount},\
|
|
||||||
{"GetEquipmentItemCharge", ItemFunctions::GetEquipmentItemCharge},\
|
|
||||||
\
|
\
|
||||||
{"GetInventoryItemRefId", ItemFunctions::GetInventoryItemRefId},\
|
{"GetEquipmentItemRefId", ItemFunctions::GetEquipmentItemRefId},\
|
||||||
{"GetInventoryItemCount", ItemFunctions::GetInventoryItemCount},\
|
{"GetEquipmentItemCount", ItemFunctions::GetEquipmentItemCount},\
|
||||||
{"GetInventoryItemCharge", ItemFunctions::GetInventoryItemCharge},\
|
{"GetEquipmentItemCharge", ItemFunctions::GetEquipmentItemCharge},\
|
||||||
\
|
\
|
||||||
{"SendEquipment", ItemFunctions::SendEquipment},\
|
{"GetInventoryItemRefId", ItemFunctions::GetInventoryItemRefId},\
|
||||||
{"SendInventoryChanges", ItemFunctions::SendInventoryChanges}
|
{"GetInventoryItemCount", ItemFunctions::GetInventoryItemCount},\
|
||||||
|
{"GetInventoryItemCharge", ItemFunctions::GetInventoryItemCharge},\
|
||||||
|
\
|
||||||
|
{"SendEquipment", ItemFunctions::SendEquipment},\
|
||||||
|
{"SendInventoryChanges", ItemFunctions::SendInventoryChanges}
|
||||||
|
|
||||||
class ItemFunctions
|
class ItemFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeInventoryChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static int GetEquipmentSize() noexcept;
|
static int GetEquipmentSize() noexcept;
|
||||||
static unsigned int GetInventoryChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetInventoryChangesSize(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
@ -41,7 +44,6 @@ public:
|
||||||
|
|
||||||
static void AddItem(unsigned short pid, const char* refId, unsigned int count, int charge) noexcept;
|
static void AddItem(unsigned short pid, const char* refId, unsigned int count, int charge) noexcept;
|
||||||
static void RemoveItem(unsigned short pid, const char* refId, unsigned short count) noexcept;
|
static void RemoveItem(unsigned short pid, const char* refId, unsigned short count) noexcept;
|
||||||
static void ClearInventory(unsigned short pid) noexcept;
|
|
||||||
|
|
||||||
static bool HasItemEquipped(unsigned short pid, const char* refId);
|
static bool HasItemEquipped(unsigned short pid, const char* refId);
|
||||||
|
|
||||||
|
@ -54,7 +56,7 @@ public:
|
||||||
static int GetInventoryItemCharge(unsigned short pid, unsigned int i) noexcept;
|
static int GetInventoryItemCharge(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendEquipment(unsigned short pid) noexcept;
|
static void SendEquipment(unsigned short pid) noexcept;
|
||||||
static void SendInventoryChanges(unsigned short pid) noexcept;
|
static void SendInventoryChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,14 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void QuestFunctions::InitializeJournalChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->journalChanges.journalItems.clear();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int QuestFunctions::GetJournalChangesSize(unsigned short pid) noexcept
|
unsigned int QuestFunctions::GetJournalChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -25,7 +33,7 @@ void QuestFunctions::AddJournalEntry(unsigned short pid, const char* quest, unsi
|
||||||
journalItem.index = index;
|
journalItem.index = index;
|
||||||
journalItem.actorRefId = actorRefId;
|
journalItem.actorRefId = actorRefId;
|
||||||
|
|
||||||
player->journalChangesBuffer.journalItems.push_back(journalItem);
|
player->journalChanges.journalItems.push_back(journalItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestFunctions::AddJournalIndex(unsigned short pid, const char* quest, unsigned int index) noexcept
|
void QuestFunctions::AddJournalIndex(unsigned short pid, const char* quest, unsigned int index) noexcept
|
||||||
|
@ -38,7 +46,7 @@ void QuestFunctions::AddJournalIndex(unsigned short pid, const char* quest, unsi
|
||||||
journalItem.quest = quest;
|
journalItem.quest = quest;
|
||||||
journalItem.index = index;
|
journalItem.index = index;
|
||||||
|
|
||||||
player->journalChangesBuffer.journalItems.push_back(journalItem);
|
player->journalChanges.journalItems.push_back(journalItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *QuestFunctions::GetJournalItemQuest(unsigned short pid, unsigned int i) noexcept
|
const char *QuestFunctions::GetJournalItemQuest(unsigned short pid, unsigned int i) noexcept
|
||||||
|
@ -76,14 +84,11 @@ const char *QuestFunctions::GetJournalItemActorRefId(unsigned short pid, unsigne
|
||||||
return player->journalChanges.journalItems.at(i).actorRefId.c_str();
|
return player->journalChanges.journalItems.at(i).actorRefId.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestFunctions::SendJournalChanges(unsigned short pid) noexcept
|
void QuestFunctions::SendJournalChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->journalChanges, player->journalChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JOURNAL)->Send(toOthers);
|
||||||
player->journalChanges = std::move(player->journalChangesBuffer);
|
|
||||||
player->journalChangesBuffer.journalItems.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#define OPENMW_QUESTAPI_HPP
|
#define OPENMW_QUESTAPI_HPP
|
||||||
|
|
||||||
#define QUESTAPI \
|
#define QUESTAPI \
|
||||||
|
{"InitializeJournalChanges", QuestFunctions::InitializeJournalChanges},\
|
||||||
|
\
|
||||||
{"GetJournalChangesSize", QuestFunctions::GetJournalChangesSize},\
|
{"GetJournalChangesSize", QuestFunctions::GetJournalChangesSize},\
|
||||||
\
|
\
|
||||||
{"AddJournalEntry", QuestFunctions::AddJournalEntry},\
|
{"AddJournalEntry", QuestFunctions::AddJournalEntry},\
|
||||||
|
@ -17,6 +19,7 @@
|
||||||
class QuestFunctions
|
class QuestFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void InitializeJournalChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetJournalChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetJournalChangesSize(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
@ -28,7 +31,7 @@ public:
|
||||||
static int GetJournalItemType(unsigned short pid, unsigned int i) noexcept;
|
static int GetJournalItemType(unsigned short pid, unsigned int i) noexcept;
|
||||||
static const char *GetJournalItemActorRefId(unsigned short pid, unsigned int i) noexcept;
|
static const char *GetJournalItemActorRefId(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendJournalChanges(unsigned short pid) noexcept;
|
static void SendJournalChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,15 @@
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
void SpellFunctions::InitializeSpellbookChanges(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->spellbookChanges.spells.clear();
|
||||||
|
player->spellbookChanges.action = SpellbookChanges::SET;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int SpellFunctions::GetSpellbookChangesSize(unsigned short pid) noexcept
|
unsigned int SpellFunctions::GetSpellbookChangesSize(unsigned short pid) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
|
@ -30,8 +39,8 @@ void SpellFunctions::AddSpell(unsigned short pid, const char* spellId) noexcept
|
||||||
ESM::Spell spell;
|
ESM::Spell spell;
|
||||||
spell.mId = spellId;
|
spell.mId = spellId;
|
||||||
|
|
||||||
player->spellbookChangesBuffer.spells.push_back(spell);
|
player->spellbookChanges.spells.push_back(spell);
|
||||||
player->spellbookChangesBuffer.action = SpellbookChanges::ADD;
|
player->spellbookChanges.action = SpellbookChanges::ADD;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellFunctions::RemoveSpell(unsigned short pid, const char* spellId) noexcept
|
void SpellFunctions::RemoveSpell(unsigned short pid, const char* spellId) noexcept
|
||||||
|
@ -42,17 +51,8 @@ void SpellFunctions::RemoveSpell(unsigned short pid, const char* spellId) noexce
|
||||||
ESM::Spell spell;
|
ESM::Spell spell;
|
||||||
spell.mId = spellId;
|
spell.mId = spellId;
|
||||||
|
|
||||||
player->spellbookChangesBuffer.spells.push_back(spell);
|
player->spellbookChanges.spells.push_back(spell);
|
||||||
player->spellbookChangesBuffer.action = SpellbookChanges::REMOVE;
|
player->spellbookChanges.action = SpellbookChanges::REMOVE;
|
||||||
}
|
|
||||||
|
|
||||||
void SpellFunctions::ClearSpellbook(unsigned short pid) noexcept
|
|
||||||
{
|
|
||||||
Player *player;
|
|
||||||
GET_PLAYER(pid, player, );
|
|
||||||
|
|
||||||
player->spellbookChangesBuffer.spells.clear();
|
|
||||||
player->spellbookChangesBuffer.action = SpellbookChanges::SET;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SpellFunctions::GetSpellId(unsigned short pid, unsigned int i) noexcept
|
const char *SpellFunctions::GetSpellId(unsigned short pid, unsigned int i) noexcept
|
||||||
|
@ -66,14 +66,11 @@ const char *SpellFunctions::GetSpellId(unsigned short pid, unsigned int i) noexc
|
||||||
return player->spellbookChanges.spells.at(i).mId.c_str();
|
return player->spellbookChanges.spells.at(i).mId.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellFunctions::SendSpellbookChanges(unsigned short pid) noexcept
|
void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool toOthers) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, );
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
std::swap(player->spellbookChanges, player->spellbookChangesBuffer);
|
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK)->setPlayer(player);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK)->setPlayer(player);
|
||||||
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK)->Send(false);
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SPELLBOOK)->Send(toOthers);
|
||||||
player->spellbookChanges = std::move(player->spellbookChangesBuffer);
|
|
||||||
player->spellbookChangesBuffer.spells.clear();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,31 +2,33 @@
|
||||||
#define OPENMW_SPELLAPI_HPP
|
#define OPENMW_SPELLAPI_HPP
|
||||||
|
|
||||||
#define SPELLAPI \
|
#define SPELLAPI \
|
||||||
{"GetSpellbookChangesSize", SpellFunctions::GetSpellbookChangesSize},\
|
{"InitializeSpellbookChanges", SpellFunctions::InitializeSpellbookChanges},\
|
||||||
{"GetSpellbookAction", SpellFunctions::GetSpellbookAction},\
|
|
||||||
\
|
\
|
||||||
{"AddSpell", SpellFunctions::AddSpell},\
|
{"GetSpellbookChangesSize", SpellFunctions::GetSpellbookChangesSize},\
|
||||||
{"RemoveSpell", SpellFunctions::RemoveSpell},\
|
{"GetSpellbookAction", SpellFunctions::GetSpellbookAction},\
|
||||||
{"ClearSpellbook", SpellFunctions::ClearSpellbook},\
|
|
||||||
\
|
\
|
||||||
{"GetSpellId", SpellFunctions::GetSpellId},\
|
{"AddSpell", SpellFunctions::AddSpell},\
|
||||||
|
{"RemoveSpell", SpellFunctions::RemoveSpell},\
|
||||||
\
|
\
|
||||||
{"SendSpellbookChanges", SpellFunctions::SendSpellbookChanges}
|
{"GetSpellId", SpellFunctions::GetSpellId},\
|
||||||
|
\
|
||||||
|
{"SendSpellbookChanges", SpellFunctions::SendSpellbookChanges}
|
||||||
|
|
||||||
class SpellFunctions
|
class SpellFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static void InitializeSpellbookChanges(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static unsigned int GetSpellbookChangesSize(unsigned short pid) noexcept;
|
static unsigned int GetSpellbookChangesSize(unsigned short pid) noexcept;
|
||||||
static unsigned int GetSpellbookAction(unsigned short pid) noexcept;
|
static unsigned int GetSpellbookAction(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static void AddSpell(unsigned short pid, const char* spellId) noexcept;
|
static void AddSpell(unsigned short pid, const char* spellId) noexcept;
|
||||||
static void RemoveSpell(unsigned short pid, const char* spellId) noexcept;
|
static void RemoveSpell(unsigned short pid, const char* spellId) noexcept;
|
||||||
static void ClearSpellbook(unsigned short pid) noexcept;
|
|
||||||
|
|
||||||
static const char *GetSpellId(unsigned short pid, unsigned int i) noexcept;
|
static const char *GetSpellId(unsigned short pid, unsigned int i) noexcept;
|
||||||
|
|
||||||
static void SendSpellbookChanges(unsigned short pid) noexcept;
|
static void SendSpellbookChanges(unsigned short pid, bool toOthers = false) noexcept;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue