[Server] Rename script functions for clearing packet vectors for players

fix/skillcap 0.7.0-alpha
David Cernat 6 years ago
parent c79660f721
commit 292536439e

@ -7,12 +7,12 @@
using namespace mwmp;
void BookFunctions::InitializeBookChanges(unsigned short pid) noexcept
void BookFunctions::ClearBookChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
return player->bookChanges.books.clear();
player->bookChanges.books.clear();
}
unsigned int BookFunctions::GetBookChangesSize(unsigned short pid) noexcept
@ -59,3 +59,10 @@ void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers,
if (sendToOtherPlayers)
packet->Send(true);
}
// All methods below are deprecated versions of methods from above
void BookFunctions::InitializeBookChanges(unsigned short pid) noexcept
{
ClearBookChanges(pid);
}

@ -2,7 +2,7 @@
#define OPENMW_BOOKAPI_HPP
#define BOOKAPI \
{"InitializeBookChanges", BookFunctions::InitializeBookChanges},\
{"ClearBookChanges", BookFunctions::ClearBookChanges},\
\
{"GetBookChangesSize", BookFunctions::GetBookChangesSize},\
\
@ -10,7 +10,9 @@
\
{"GetBookId", BookFunctions::GetBookId},\
\
{"SendBookChanges", BookFunctions::SendBookChanges}
{"SendBookChanges", BookFunctions::SendBookChanges},\
\
{"InitializeBookChanges", BookFunctions::InitializeBookChanges}
class BookFunctions
{
@ -24,7 +26,7 @@ public:
* \param pid The player ID whose book changes should be used.
* \return void
*/
static void InitializeBookChanges(unsigned short pid) noexcept;
static void ClearBookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest book changes.
@ -64,7 +66,9 @@ public:
*/
static void SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
private:
// All methods below are deprecated versions of methods from above
static void InitializeBookChanges(unsigned short pid) noexcept;
};

@ -7,7 +7,7 @@
using namespace mwmp;
void DialogueFunctions::InitializeTopicChanges(unsigned short pid) noexcept
void DialogueFunctions::ClearTopicChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -89,3 +89,10 @@ void DialogueFunctions::PlaySpeech(unsigned short pid, const char* sound) noexce
packet->Send(false);
player->sendToLoaded(packet);
}
// All methods below are deprecated versions of methods from above
void DialogueFunctions::InitializeTopicChanges(unsigned short pid) noexcept
{
ClearTopicChanges(pid);
}

@ -2,7 +2,7 @@
#define OPENMW_DIALOGUEAPI_HPP
#define DIALOGUEAPI \
{"InitializeTopicChanges", DialogueFunctions::InitializeTopicChanges},\
{"ClearTopicChanges", DialogueFunctions::ClearTopicChanges},\
\
{"GetTopicChangesSize", DialogueFunctions::GetTopicChangesSize},\
\
@ -13,7 +13,9 @@
{"SendTopicChanges", DialogueFunctions::SendTopicChanges},\
\
{"PlayAnimation", DialogueFunctions::PlayAnimation},\
{"PlaySpeech", DialogueFunctions::PlaySpeech}
{"PlaySpeech", DialogueFunctions::PlaySpeech},\
\
{"InitializeTopicChanges", DialogueFunctions::InitializeTopicChanges}
class DialogueFunctions
{
@ -27,7 +29,7 @@ public:
* \param pid The player ID whose topic changes should be used.
* \return void
*/
static void InitializeTopicChanges(unsigned short pid) noexcept;
static void ClearTopicChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest topic changes.
@ -90,7 +92,9 @@ public:
*/
static void PlaySpeech(unsigned short pid, const char* sound) noexcept;
private:
// All methods below are deprecated versions of methods from above
static void InitializeTopicChanges(unsigned short pid) noexcept;
};

@ -11,7 +11,7 @@ using namespace mwmp;
Faction tempFaction;
const Faction emptyFaction = {};
void FactionFunctions::InitializeFactionChanges(unsigned short pid) noexcept
void FactionFunctions::ClearFactionChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -121,3 +121,10 @@ void FactionFunctions::SendFactionChanges(unsigned short pid, bool sendToOtherPl
if (sendToOtherPlayers)
packet->Send(true);
}
// All methods below are deprecated versions of methods from above
void FactionFunctions::InitializeFactionChanges(unsigned short pid) noexcept
{
ClearFactionChanges(pid);
}

@ -2,7 +2,7 @@
#define OPENMW_FACTIONAPI_HPP
#define FACTIONAPI \
{"InitializeFactionChanges", FactionFunctions::InitializeFactionChanges},\
{"ClearFactionChanges", FactionFunctions::ClearFactionChanges},\
\
{"GetFactionChangesSize", FactionFunctions::GetFactionChangesSize},\
{"GetFactionChangesAction", FactionFunctions::GetFactionChangesAction},\
@ -20,7 +20,9 @@
\
{"AddFaction", FactionFunctions::AddFaction},\
\
{"SendFactionChanges", FactionFunctions::SendFactionChanges}
{"SendFactionChanges", FactionFunctions::SendFactionChanges},\
\
{"InitializeFactionChanges", FactionFunctions::InitializeFactionChanges}
class FactionFunctions
{
@ -34,7 +36,7 @@ public:
* \param pid The player ID whose faction changes should be used.
* \return void
*/
static void InitializeFactionChanges(unsigned short pid) noexcept;
static void ClearFactionChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest faction changes.
@ -151,7 +153,10 @@ public:
* \return void
*/
static void SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
private:
// All methods below are deprecated versions of methods from above
static void InitializeFactionChanges(unsigned short pid) noexcept;
};

@ -1,7 +1,3 @@
//
// Created by koncord on 23.07.16.
//
#include "GUI.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
@ -88,7 +84,7 @@ void GUIFunctions::ListBox(unsigned short pid, int id, const char *label, const
packet->Send(false);
}
void GUIFunctions::InitializeQuickKeyChanges(unsigned short pid) noexcept
void GUIFunctions::ClearQuickKeyChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -168,3 +164,10 @@ void GUIFunctions::SetMapVisibilityAll(unsigned short targetPid, unsigned short
{
LOG_MESSAGE(Log::LOG_WARN, "stub");
}
// All methods below are deprecated versions of methods from above
void GUIFunctions::InitializeQuickKeyChanges(unsigned short pid) noexcept
{
ClearQuickKeyChanges(pid);
}

@ -1,7 +1,3 @@
//
// Created by koncord on 30.08.16.
//
#ifndef OPENMW_GUIAPI_HPP
#define OPENMW_GUIAPI_HPP
@ -12,7 +8,7 @@
{"PasswordDialog", GUIFunctions::PasswordDialog},\
{"ListBox", GUIFunctions::ListBox},\
\
{"InitializeQuickKeyChanges", GUIFunctions::InitializeQuickKeyChanges},\
{"ClearQuickKeyChanges", GUIFunctions::ClearQuickKeyChanges},\
\
{"GetQuickKeyChangesSize", GUIFunctions::GetQuickKeyChangesSize},\
\
@ -25,7 +21,9 @@
{"SendQuickKeyChanges", GUIFunctions::SendQuickKeyChanges},\
\
{"SetMapVisibility", GUIFunctions::SetMapVisibility},\
{"SetMapVisibilityAll", GUIFunctions::SetMapVisibilityAll}
{"SetMapVisibilityAll", GUIFunctions::SetMapVisibilityAll},\
\
{"InitializeQuickKeyChanges", GUIFunctions::InitializeQuickKeyChanges}
class GUIFunctions
{
@ -103,7 +101,7 @@ public:
* \param pid The player ID whose quick key changes should be used.
* \return void
*/
static void InitializeQuickKeyChanges(unsigned short pid) noexcept;
static void ClearQuickKeyChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest quick key changes.
@ -183,6 +181,11 @@ public:
* \return void
*/
static void SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept;
// All methods below are deprecated versions of methods from above
static void InitializeQuickKeyChanges(unsigned short pid) noexcept;
};
#endif //OPENMW_GUIAPI_HPP

@ -9,7 +9,7 @@
using namespace mwmp;
void ItemFunctions::InitializeInventoryChanges(unsigned short pid) noexcept
void ItemFunctions::ClearInventoryChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -255,6 +255,11 @@ void ItemFunctions::SendItemUse(unsigned short pid) noexcept
// All methods below are deprecated versions of methods from above
void ItemFunctions::InitializeInventoryChanges(unsigned short pid) noexcept
{
ClearInventoryChanges(pid);
}
void ItemFunctions::AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept
{

@ -2,7 +2,7 @@
#define OPENMW_ITEMAPI_HPP
#define ITEMAPI \
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
{"ClearInventoryChanges", ItemFunctions::ClearInventoryChanges},\
\
{"GetEquipmentSize", ItemFunctions::GetEquipmentSize},\
{"GetInventoryChangesSize", ItemFunctions::GetInventoryChangesSize},\
@ -38,6 +38,7 @@
{"SendInventoryChanges", ItemFunctions::SendInventoryChanges},\
{"SendItemUse", ItemFunctions::SendItemUse},\
\
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
{"AddItem", ItemFunctions::AddItem}
class ItemFunctions
@ -52,7 +53,7 @@ public:
* \param pid The player ID whose inventory changes should be used.
* \return void
*/
static void InitializeInventoryChanges(unsigned short pid) noexcept;
static void ClearInventoryChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of slots used for equipment.
@ -293,6 +294,8 @@ public:
// All methods below are deprecated versions of methods from above
static void InitializeInventoryChanges(unsigned short pid) noexcept;
static void AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept;

@ -8,7 +8,7 @@
using namespace mwmp;
void QuestFunctions::InitializeJournalChanges(unsigned short pid) noexcept
void QuestFunctions::ClearJournalChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -16,7 +16,7 @@ void QuestFunctions::InitializeJournalChanges(unsigned short pid) noexcept
player->journalChanges.journalItems.clear();
}
void QuestFunctions::InitializeKillChanges(unsigned short pid) noexcept
void QuestFunctions::ClearKillChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -211,3 +211,15 @@ void QuestFunctions::SendReputation(unsigned short pid, bool sendToOtherPlayers,
if (sendToOtherPlayers)
packet->Send(true);
}
// All methods below are deprecated versions of methods from above
void QuestFunctions::InitializeJournalChanges(unsigned short pid) noexcept
{
ClearJournalChanges(pid);
}
void QuestFunctions::InitializeKillChanges(unsigned short pid) noexcept
{
ClearKillChanges(pid);
}

@ -2,8 +2,8 @@
#define OPENMW_QUESTAPI_HPP
#define QUESTAPI \
{"InitializeJournalChanges", QuestFunctions::InitializeJournalChanges},\
{"InitializeKillChanges", QuestFunctions::InitializeKillChanges},\
{"ClearJournalChanges", QuestFunctions::ClearJournalChanges},\
{"ClearKillChanges", QuestFunctions::ClearKillChanges},\
\
{"GetJournalChangesSize", QuestFunctions::GetJournalChangesSize},\
{"GetKillChangesSize", QuestFunctions::GetKillChangesSize},\
@ -26,7 +26,10 @@
\
{"SendJournalChanges", QuestFunctions::SendJournalChanges},\
{"SendKillChanges", QuestFunctions::SendKillChanges},\
{"SendReputation", QuestFunctions::SendReputation}
{"SendReputation", QuestFunctions::SendReputation},\
\
{"InitializeJournalChanges", QuestFunctions::InitializeJournalChanges},\
{"InitializeKillChanges", QuestFunctions::InitializeKillChanges}
class QuestFunctions
{
@ -40,7 +43,7 @@ public:
* \param pid The player ID whose journal changes should be used.
* \return void
*/
static void InitializeJournalChanges(unsigned short pid) noexcept;
static void ClearJournalChanges(unsigned short pid) noexcept;
/**
* \brief Clear the last recorded kill count changes for a player.
@ -50,7 +53,7 @@ public:
* \param pid The player ID whose kill count changes should be used.
* \return void
*/
static void InitializeKillChanges(unsigned short pid) noexcept;
static void ClearKillChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest journal changes.
@ -225,6 +228,11 @@ public:
*/
static void SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
static void InitializeJournalChanges(unsigned short pid) noexcept;
static void InitializeKillChanges(unsigned short pid) noexcept;
private:
};

@ -8,7 +8,7 @@
using namespace mwmp;
void SpellFunctions::InitializeSpellbookChanges(unsigned short pid) noexcept
void SpellFunctions::ClearSpellbookChanges(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -75,3 +75,10 @@ void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPl
if (sendToOtherPlayers)
packet->Send(true);
}
// All methods below are deprecated versions of methods from above
void SpellFunctions::InitializeSpellbookChanges(unsigned short pid) noexcept
{
ClearSpellbookChanges(pid);
}

@ -2,7 +2,7 @@
#define OPENMW_SPELLAPI_HPP
#define SPELLAPI \
{"InitializeSpellbookChanges", SpellFunctions::InitializeSpellbookChanges},\
{"ClearSpellbookChanges", SpellFunctions::ClearSpellbookChanges},\
\
{"GetSpellbookChangesSize", SpellFunctions::GetSpellbookChangesSize},\
{"GetSpellbookChangesAction", SpellFunctions::GetSpellbookChangesAction},\
@ -12,7 +12,9 @@
\
{"GetSpellId", SpellFunctions::GetSpellId},\
\
{"SendSpellbookChanges", SpellFunctions::SendSpellbookChanges}
{"SendSpellbookChanges", SpellFunctions::SendSpellbookChanges},\
\
{"InitializeSpellbookChanges", SpellFunctions::InitializeSpellbookChanges}
class SpellFunctions
{
@ -26,7 +28,7 @@ public:
* \param pid The player ID whose spellbook changes should be used.
* \return void
*/
static void InitializeSpellbookChanges(unsigned short pid) noexcept;
static void ClearSpellbookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest spellbook changes.
@ -83,6 +85,10 @@ public:
*/
static void SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
static void InitializeSpellbookChanges(unsigned short pid) noexcept;
private:
};

Loading…
Cancel
Save