mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-24 06:53:50 +00:00
e6c626f127
ClientScriptGlobal is a new Worldstate packet that handles short, long and float values for global variables in clientside scripts. Previously, short values were handled by the ScriptGlobalShort packet, while a partially implemented ScriptGlobalFloat packet also existed, but both of those packets were Object packets because they were added near the end of 2016 when only Player and Object packets existed (with the latter actually being called WorldEvent packets at the time). Both ScriptGlobalShort and ScriptGlobalFloat have now been removed. The serverside script functions previously used to interact with ScriptGlobalShort have, however, been kept so they can be adjusted to work with local variables in clientside scripts instead in a future commit.
49 lines
1.5 KiB
C++
49 lines
1.5 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);
|
|
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);
|
|
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
|