1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:53:51 +00:00
openmw-tes3mp/apps/openmw/mwmp/Worldstate.hpp
David Cernat e78503d5f3 [General] Include potion quantity in RecordDynamic packets
Don't spam the server with one RecordDynamic packet per potion created when brewing multiple potions at once. Instead, send a single RecordDynamic packet with the potion quantity included in it.

Add serverside script functions for getting the potion quantity.
2020-02-22 21:21:30 +02:00

49 lines
1.6 KiB
C++

#ifndef OPENMW_WORLDSTATE_HPP
#define OPENMW_WORLDSTATE_HPP
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
namespace mwmp
{
class Networking;
class Worldstate : public BaseWorldstate
{
public:
Worldstate();
virtual ~Worldstate();
void addRecords();
bool containsExploredMapTile(int cellX, int cellY);
void markExploredMapTile(int cellX, int cellY);
void setClientGlobals();
void setKills();
void setMapExplored();
void setWeather();
void sendClientGlobal(std::string varName, int value, mwmp::VARIABLE_TYPE variableType);
void sendClientGlobal(std::string varName, float value);
void sendMapExplored(int cellX, int cellY, const std::vector<char>& imageData);
void sendWeather(std::string region, int currentWeather, int nextWeather, int queuedWeather, float transitionFactor);
void sendEnchantmentRecord(const ESM::Enchantment* enchantment);
void sendPotionRecord(const ESM::Potion* potion, unsigned int quantity);
void sendSpellRecord(const ESM::Spell* spell);
void sendArmorRecord(const ESM::Armor* armor, std::string baseRefId = "");
void sendBookRecord(const ESM::Book* book, std::string baseRefId = "");
void sendClothingRecord(const ESM::Clothing* clothing, std::string baseRefId = "");
void sendWeaponRecord(const ESM::Weapon* weapon, std::string baseRefId = "");
private:
std::vector<MapTile> exploredMapTiles;
Networking *getNetworking();
};
}
#endif //OPENMW_WORLDSTATE_HPP