mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 21:49:56 +00:00
3bd8aa82fe
Whenever an item is added to or removed from the player's ContainerStore, that player sends a PlayerInventory packet with just that addition or removal.
This eliminates all the unnecessary packet spam related to oversized PlayerInventory packets that had existed in one form or another since the initial implementation of inventory sync in 1b259e2d33
Additionally, move booleans from BasePlayer to LocalPlayer when they are only needed on the client, and make the usage of the isReceivingQuickKeys boolean consistent with the new isReceivingInventory boolean by having them both in the processors of their associated packets.
115 lines
3.6 KiB
C++
115 lines
3.6 KiB
C++
#ifndef OPENMW_LOCALPLAYER_HPP
|
|
#define OPENMW_LOCALPLAYER_HPP
|
|
|
|
#include <components/openmw-mp/Base/BasePlayer.hpp>
|
|
#include "../mwworld/ptr.hpp"
|
|
#include <RakNetTypes.h>
|
|
|
|
namespace mwmp
|
|
{
|
|
class Networking;
|
|
class LocalPlayer : public BasePlayer
|
|
{
|
|
public:
|
|
|
|
LocalPlayer();
|
|
virtual ~LocalPlayer();
|
|
|
|
time_t deathTime;
|
|
|
|
bool isReceivingInventory;
|
|
bool isReceivingQuickKeys;
|
|
bool isPlayingAnimation;
|
|
bool diedSinceArrestAttempt;
|
|
|
|
void update();
|
|
|
|
bool processCharGen();
|
|
bool hasFinishedCharGen();
|
|
|
|
void updateStatsDynamic(bool forceUpdate = false);
|
|
void updateAttributes(bool forceUpdate = false);
|
|
void updateSkills(bool forceUpdate = false);
|
|
void updateLevel(bool forceUpdate = false);
|
|
void updateBounty(bool forceUpdate = false);
|
|
void updateReputation(bool forceUpdate = false);
|
|
void updatePosition(bool forceUpdate = false);
|
|
void updateCell(bool forceUpdate = false);
|
|
void updateEquipment(bool forceUpdate = false);
|
|
void updateInventory(bool forceUpdate = false);
|
|
void updateAttack();
|
|
void updateAnimFlags(bool forceUpdate = false);
|
|
|
|
void addItems();
|
|
void addSpells();
|
|
void addJournalItems();
|
|
void addTopics();
|
|
|
|
void removeItems();
|
|
void removeSpells();
|
|
|
|
void resurrect();
|
|
|
|
void closeInventoryWindows();
|
|
|
|
void setCharacter();
|
|
void setDynamicStats();
|
|
void setAttributes();
|
|
void setSkills();
|
|
void setLevel();
|
|
void setBounty();
|
|
void setReputation();
|
|
void setPosition();
|
|
void setMomentum();
|
|
void setCell();
|
|
void setClass();
|
|
void setEquipment();
|
|
void setInventory();
|
|
void setSpellbook();
|
|
void setQuickKeys();
|
|
void setFactions();
|
|
void setKills();
|
|
void setBooks();
|
|
void setShapeshift();
|
|
void setMarkLocation();
|
|
void setSelectedSpell();
|
|
|
|
void sendClass();
|
|
void sendInventory();
|
|
void sendItemChange(const MWWorld::Ptr& itemPtr, int count, unsigned int action);
|
|
void sendItemChange(const std::string& refId, int count, unsigned int action);
|
|
void sendSpellbook();
|
|
void sendSpellChange(std::string id, unsigned int action);
|
|
void sendQuickKey(unsigned short slot, int type, const std::string& itemId = "");
|
|
void sendJournalEntry(const std::string& quest, int index, const MWWorld::Ptr& actor);
|
|
void sendJournalIndex(const std::string& quest, int index);
|
|
void sendFactionRank(const std::string& factionId, int rank);
|
|
void sendFactionExpulsionState(const std::string& factionId, bool isExpelled);
|
|
void sendFactionReputation(const std::string& factionId, int reputation);
|
|
void sendTopic(const std::string& topic);
|
|
void sendKill(const std::string& refId, int number);
|
|
void sendBook(const std::string& bookId);
|
|
void sendWerewolfState(bool isWerewolf);
|
|
void sendMarkLocation(const ESM::Cell& newMarkCell, const ESM::Position& newMarkPosition);
|
|
void sendSelectedSpell(const std::string& newSelectedSpellId);
|
|
void sendItemUse(const MWWorld::Ptr& itemPtr);
|
|
void sendCellStates();
|
|
|
|
void clearCellStates();
|
|
void clearCurrentContainer();
|
|
|
|
void storeCellState(const ESM::Cell& cell, int stateType);
|
|
void storeCurrentContainer(const MWWorld::Ptr& container);
|
|
|
|
void playAnimation();
|
|
void playSpeech();
|
|
|
|
MWWorld::Ptr getPlayerPtr();
|
|
|
|
private:
|
|
Networking *getNetworking();
|
|
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_LOCALPLAYER_HPP
|