2016-01-12 03:41:44 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 14.01.16.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef OPENMW_LOCALPLAYER_HPP
|
|
|
|
#define OPENMW_LOCALPLAYER_HPP
|
|
|
|
|
|
|
|
#include <components/openmw-mp/Base/BasePlayer.hpp>
|
2017-04-16 06:58:40 +00:00
|
|
|
#include "../mwworld/ptr.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();
|
|
|
|
|
2016-11-15 19:54:06 +00:00
|
|
|
void update();
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2016-09-30 05:59:58 +00:00
|
|
|
void charGen(int stageFirst, int stageEnd);
|
|
|
|
bool charGenThread(); // return true if CGStage::current == CGStage::end
|
2017-01-26 11:13:43 +00:00
|
|
|
bool hasFinishedCharGen();
|
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);
|
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-09-30 05:59:58 +00:00
|
|
|
void updateChar();
|
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);
|
2017-04-19 19:06:04 +00:00
|
|
|
void updateAttack();
|
2016-09-30 05:59:58 +00:00
|
|
|
void updateDeadState(bool forceUpdate = false);
|
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();
|
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();
|
|
|
|
|
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();
|
2016-09-30 05:59:58 +00:00
|
|
|
void setPosition();
|
|
|
|
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();
|
2017-05-18 16:27:20 +00:00
|
|
|
void setFactions();
|
2017-06-10 11:04:19 +00:00
|
|
|
void setKills();
|
2017-06-27 05:27:14 +00:00
|
|
|
void setBooks();
|
2017-07-03 06:28:27 +00:00
|
|
|
void setMapExplored();
|
2017-07-15 06:02:19 +00:00
|
|
|
void setShapeshift();
|
2016-07-17 09:53:55 +00:00
|
|
|
|
2016-09-30 05:59:58 +00:00
|
|
|
void sendClass();
|
2016-11-16 19:34:46 +00:00
|
|
|
void sendInventory();
|
2017-01-20 07:07:07 +00:00
|
|
|
void sendSpellbook();
|
2017-02-03 18:27:40 +00:00
|
|
|
void sendCellStates();
|
2016-11-21 04:07:29 +00:00
|
|
|
void sendSpellAddition(std::string id);
|
2016-12-29 13:19:26 +00:00
|
|
|
void sendSpellAddition(const ESM::Spell &spell);
|
2016-11-21 04:07:29 +00:00
|
|
|
void sendSpellRemoval(std::string id);
|
2016-12-29 13:19:26 +00:00
|
|
|
void sendSpellRemoval(const ESM::Spell &spell);
|
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-10 11:04:19 +00:00
|
|
|
void sendKill(const std::string& refId, int number);
|
2017-06-27 05:27:14 +00:00
|
|
|
void sendBook(const std::string& bookId);
|
2017-07-15 06:02:19 +00:00
|
|
|
void sendShapeshift(bool isWerewolf);
|
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
|
|
|
|
|
|
|
void storeCellState(ESM::Cell cell, int stateType);
|
2017-10-07 20:33:36 +00:00
|
|
|
void storeCurrentContainer(const MWWorld::Ptr& container);
|
2017-02-03 18:27:40 +00:00
|
|
|
|
2016-01-12 03:41:44 +00:00
|
|
|
private:
|
2016-11-15 19:54:06 +00:00
|
|
|
Networking *getNetworking();
|
|
|
|
MWWorld::Ptr getPlayerPtr();
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_LOCALPLAYER_HPP
|