2016-01-12 03:41:44 +00:00
|
|
|
#ifndef OPENMW_LOCALPLAYER_HPP
|
|
|
|
#define OPENMW_LOCALPLAYER_HPP
|
|
|
|
|
|
|
|
#include <components/openmw-mp/Base/BasePlayer.hpp>
|
2021-07-21 16:14:31 +00:00
|
|
|
#include "../mwmechanics/activespells.hpp"
|
2017-04-16 06:58:40 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2021-07-04 10:54:11 +00:00
|
|
|
#include "../mwworld/timestamp.hpp"
|
2016-01-12 03:41:44 +00:00
|
|
|
#include <RakNetTypes.h>
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2016-12-16 08:59:15 +00:00
|
|
|
class Networking;
|
2016-01-12 03:41:44 +00:00
|
|
|
class LocalPlayer : public BasePlayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
LocalPlayer();
|
|
|
|
virtual ~LocalPlayer();
|
|
|
|
|
2018-07-06 11:17:54 +00:00
|
|
|
time_t deathTime;
|
2018-10-13 12:36:13 +00:00
|
|
|
bool receivedCharacter;
|
2018-07-06 11:17:54 +00:00
|
|
|
|
2019-12-03 21:55:55 +00:00
|
|
|
bool isUsingBed;
|
2020-02-22 21:59:42 +00:00
|
|
|
bool avoidSendingInventoryPackets;
|
2018-08-28 02:01:52 +00:00
|
|
|
bool isReceivingQuickKeys;
|
|
|
|
bool isPlayingAnimation;
|
|
|
|
bool diedSinceArrestAttempt;
|
2020-04-19 20:17:09 +00:00
|
|
|
unsigned int lastEnchantmentQuantity;
|
2018-08-28 02:01:52 +00:00
|
|
|
|
2016-11-15 19:54:06 +00:00
|
|
|
void update();
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2018-04-19 10:25:29 +00:00
|
|
|
bool processCharGen();
|
2018-10-13 12:36:13 +00:00
|
|
|
bool isLoggedIn();
|
2016-09-30 05:59:58 +00:00
|
|
|
|
2017-04-16 11:11:55 +00:00
|
|
|
void updateStatsDynamic(bool forceUpdate = false);
|
2016-09-30 01:52:21 +00:00
|
|
|
void updateAttributes(bool forceUpdate = false);
|
|
|
|
void updateSkills(bool forceUpdate = false);
|
|
|
|
void updateLevel(bool forceUpdate = false);
|
2017-04-25 18:24:39 +00:00
|
|
|
void updateBounty(bool forceUpdate = false);
|
2018-01-30 20:55:29 +00:00
|
|
|
void updateReputation(bool forceUpdate = false);
|
2016-09-30 05:59:58 +00:00
|
|
|
void updatePosition(bool forceUpdate = false);
|
2016-01-12 03:41:44 +00:00
|
|
|
void updateCell(bool forceUpdate = false);
|
2016-11-17 20:33:30 +00:00
|
|
|
void updateEquipment(bool forceUpdate = false);
|
2016-09-30 05:59:58 +00:00
|
|
|
void updateInventory(bool forceUpdate = false);
|
2019-08-25 06:35:23 +00:00
|
|
|
void updateAttackOrCast();
|
2017-04-14 13:00:34 +00:00
|
|
|
void updateAnimFlags(bool forceUpdate = false);
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2017-01-19 13:18:37 +00:00
|
|
|
void addItems();
|
|
|
|
void addSpells();
|
2020-07-10 00:09:11 +00:00
|
|
|
void addSpellsActive();
|
2017-01-24 17:32:25 +00:00
|
|
|
void addJournalItems();
|
2017-05-24 18:43:34 +00:00
|
|
|
void addTopics();
|
2017-01-19 13:18:37 +00:00
|
|
|
|
|
|
|
void removeItems();
|
|
|
|
void removeSpells();
|
2020-07-10 00:09:11 +00:00
|
|
|
void removeSpellsActive();
|
2017-01-19 13:18:37 +00:00
|
|
|
|
2020-11-14 23:02:58 +00:00
|
|
|
void die();
|
2018-01-27 17:09:55 +00:00
|
|
|
void resurrect();
|
|
|
|
|
2017-12-16 05:21:02 +00:00
|
|
|
void closeInventoryWindows();
|
2019-06-08 21:59:33 +00:00
|
|
|
void updateInventoryWindow();
|
2017-12-16 05:21:02 +00:00
|
|
|
|
2018-04-09 16:21:19 +00:00
|
|
|
void setCharacter();
|
2016-09-29 07:19:39 +00:00
|
|
|
void setDynamicStats();
|
2016-09-29 10:10:32 +00:00
|
|
|
void setAttributes();
|
|
|
|
void setSkills();
|
|
|
|
void setLevel();
|
2017-04-25 18:24:39 +00:00
|
|
|
void setBounty();
|
2018-01-30 20:55:29 +00:00
|
|
|
void setReputation();
|
2016-09-30 05:59:58 +00:00
|
|
|
void setPosition();
|
2018-04-29 20:47:17 +00:00
|
|
|
void setMomentum();
|
2016-09-30 05:59:58 +00:00
|
|
|
void setCell();
|
|
|
|
void setClass();
|
2016-11-17 20:33:30 +00:00
|
|
|
void setEquipment();
|
2017-01-19 13:18:37 +00:00
|
|
|
void setInventory();
|
|
|
|
void setSpellbook();
|
2020-07-10 00:09:11 +00:00
|
|
|
void setSpellsActive();
|
2021-07-10 20:15:19 +00:00
|
|
|
void setCooldowns();
|
2017-10-25 04:21:00 +00:00
|
|
|
void setQuickKeys();
|
2017-05-18 16:27:20 +00:00
|
|
|
void setFactions();
|
2017-06-27 05:27:14 +00:00
|
|
|
void setBooks();
|
2017-07-15 06:02:19 +00:00
|
|
|
void setShapeshift();
|
2018-01-31 02:50:29 +00:00
|
|
|
void setMarkLocation();
|
2018-02-06 04:36:46 +00:00
|
|
|
void setSelectedSpell();
|
2016-07-17 09:53:55 +00:00
|
|
|
|
2019-11-30 10:51:48 +00:00
|
|
|
void sendDeath(char newDeathState);
|
2016-09-30 05:59:58 +00:00
|
|
|
void sendClass();
|
2016-11-16 19:34:46 +00:00
|
|
|
void sendInventory();
|
2019-01-11 10:54:47 +00:00
|
|
|
void sendItemChange(const mwmp::Item& item, unsigned int action);
|
2018-08-21 07:10:06 +00:00
|
|
|
void sendItemChange(const MWWorld::Ptr& itemPtr, int count, unsigned int action);
|
|
|
|
void sendItemChange(const std::string& refId, int count, unsigned int action);
|
2020-02-25 05:45:06 +00:00
|
|
|
void sendStoredItemRemovals();
|
2017-01-20 07:07:07 +00:00
|
|
|
void sendSpellbook();
|
2018-08-20 22:20:30 +00:00
|
|
|
void sendSpellChange(std::string id, unsigned int action);
|
2020-07-10 00:09:11 +00:00
|
|
|
void sendSpellsActive();
|
2021-07-21 16:14:31 +00:00
|
|
|
void sendSpellsActiveAddition(const std::string id, bool isStackingSpell, const MWMechanics::ActiveSpells::ActiveSpellParams& params);
|
2021-07-04 10:54:11 +00:00
|
|
|
void sendSpellsActiveRemoval(const std::string id, bool isStackingSpell, MWWorld::TimeStamp timestamp);
|
2021-07-10 20:15:19 +00:00
|
|
|
void sendCooldownChange(std::string id, int startTimestampDay, float startTimestampHour);
|
2017-10-25 04:21:00 +00:00
|
|
|
void sendQuickKey(unsigned short slot, int type, const std::string& itemId = "");
|
2017-05-18 16:27:20 +00:00
|
|
|
void sendJournalEntry(const std::string& quest, int index, const MWWorld::Ptr& actor);
|
|
|
|
void sendJournalIndex(const std::string& quest, int index);
|
2017-07-05 04:05:52 +00:00
|
|
|
void sendFactionRank(const std::string& factionId, int rank);
|
|
|
|
void sendFactionExpulsionState(const std::string& factionId, bool isExpelled);
|
2017-07-13 10:36:00 +00:00
|
|
|
void sendFactionReputation(const std::string& factionId, int reputation);
|
2017-05-24 18:43:34 +00:00
|
|
|
void sendTopic(const std::string& topic);
|
2017-06-27 05:27:14 +00:00
|
|
|
void sendBook(const std::string& bookId);
|
2018-02-01 00:11:45 +00:00
|
|
|
void sendWerewolfState(bool isWerewolf);
|
2018-01-31 02:50:29 +00:00
|
|
|
void sendMarkLocation(const ESM::Cell& newMarkCell, const ESM::Position& newMarkPosition);
|
2018-02-06 04:36:46 +00:00
|
|
|
void sendSelectedSpell(const std::string& newSelectedSpellId);
|
2019-12-04 08:17:33 +00:00
|
|
|
void sendItemUse(const MWWorld::Ptr& itemPtr, bool usingItemMagic = false, char currentDrawState = 0);
|
2018-08-21 07:10:06 +00:00
|
|
|
void sendCellStates();
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2017-02-03 18:27:40 +00:00
|
|
|
void clearCellStates();
|
2017-02-05 16:45:23 +00:00
|
|
|
void clearCurrentContainer();
|
2017-02-03 18:27:40 +00:00
|
|
|
|
2018-01-28 19:19:03 +00:00
|
|
|
void storeCellState(const ESM::Cell& cell, int stateType);
|
2017-10-07 20:33:36 +00:00
|
|
|
void storeCurrentContainer(const MWWorld::Ptr& container);
|
2020-02-25 05:45:06 +00:00
|
|
|
void storeItemRemoval(const std::string& refId, int count);
|
2020-04-19 20:17:09 +00:00
|
|
|
void storeLastEnchantmentQuantity(unsigned int quantity);
|
2017-02-03 18:27:40 +00:00
|
|
|
|
2017-10-27 06:10:29 +00:00
|
|
|
void playAnimation();
|
2017-10-31 13:19:14 +00:00
|
|
|
void playSpeech();
|
2017-10-27 06:10:29 +00:00
|
|
|
|
2017-11-22 22:21:47 +00:00
|
|
|
MWWorld::Ptr getPlayerPtr();
|
|
|
|
|
2016-01-12 03:41:44 +00:00
|
|
|
private:
|
2016-11-15 19:54:06 +00:00
|
|
|
Networking *getNetworking();
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_LOCALPLAYER_HPP
|