mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-28 20:15:32 +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.
100 lines
4.1 KiB
C++
100 lines
4.1 KiB
C++
#ifndef OPENMW_OBJECTLIST_HPP
|
|
#define OPENMW_OBJECTLIST_HPP
|
|
|
|
#include <components/openmw-mp/Base/BaseObject.hpp>
|
|
#include "../mwworld/worldimp.hpp"
|
|
#include <RakNetTypes.h>
|
|
|
|
namespace mwmp
|
|
{
|
|
class Networking;
|
|
class ObjectList : public BaseObjectList
|
|
{
|
|
public:
|
|
|
|
ObjectList();
|
|
virtual ~ObjectList();
|
|
|
|
void reset();
|
|
|
|
void addObject(BaseObject baseObject);
|
|
BaseObject getBaseObject(const MWWorld::Ptr& ptr);
|
|
void addContainerItem(mwmp::BaseObject& baseObject, const MWWorld::Ptr& itemPtr, int actionCount);
|
|
void addEntireContainer(const MWWorld::Ptr& ptr);
|
|
|
|
void editContainers(MWWorld::CellStore* cellStore);
|
|
|
|
void activateObjects(MWWorld::CellStore* cellStore);
|
|
void placeObjects(MWWorld::CellStore* cellStore);
|
|
void spawnObjects(MWWorld::CellStore* cellStore);
|
|
void deleteObjects(MWWorld::CellStore* cellStore);
|
|
void lockObjects(MWWorld::CellStore* cellStore);
|
|
void triggerTrapObjects(MWWorld::CellStore* cellStore);
|
|
void scaleObjects(MWWorld::CellStore* cellStore);
|
|
void setObjectStates(MWWorld::CellStore* cellStore);
|
|
void moveObjects(MWWorld::CellStore* cellStore);
|
|
void rotateObjects(MWWorld::CellStore* cellStore);
|
|
void animateObjects(MWWorld::CellStore* cellStore);
|
|
void activateDoors(MWWorld::CellStore* cellStore);
|
|
void setDoorDestinations(MWWorld::CellStore* cellStore);
|
|
void runConsoleCommands(MWWorld::CellStore* cellStore);
|
|
|
|
void setLocalShorts(MWWorld::CellStore* cellStore);
|
|
void setLocalFloats(MWWorld::CellStore* cellStore);
|
|
void setMemberShorts();
|
|
|
|
void playMusic();
|
|
void playVideo();
|
|
|
|
mwmp::BaseObject getObjectFromPtr(const MWWorld::Ptr& ptr);
|
|
|
|
void addAllContainers(MWWorld::CellStore* cellStore);
|
|
void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector<BaseObject>& requestObjects);
|
|
|
|
void addObjectActivate(const MWWorld::Ptr& ptr, const MWWorld::Ptr& activatingActor);
|
|
void addObjectHit(const MWWorld::Ptr& ptr, const MWWorld::Ptr& hittingActor);
|
|
void addObjectHit(const MWWorld::Ptr& ptr, const MWWorld::Ptr& hittingActor, const Attack hitAttack);
|
|
void addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer = false);
|
|
void addObjectSpawn(const MWWorld::Ptr& ptr);
|
|
void addObjectSpawn(const MWWorld::Ptr& ptr, const MWWorld::Ptr& master, std::string spellId, int effectId, float duration);
|
|
void addObjectDelete(const MWWorld::Ptr& ptr);
|
|
void addObjectLock(const MWWorld::Ptr& ptr, int lockLevel);
|
|
void addObjectTrap(const MWWorld::Ptr& ptr, const ESM::Position& pos, bool isDisarmed);
|
|
void addObjectScale(const MWWorld::Ptr& ptr, float scale);
|
|
void addObjectState(const MWWorld::Ptr& ptr, bool objectState);
|
|
void addObjectAnimPlay(const MWWorld::Ptr& ptr, std::string group, int mode);
|
|
|
|
void addDoorState(const MWWorld::Ptr& ptr, MWWorld::DoorState state);
|
|
void addMusicPlay(std::string filename);
|
|
void addVideoPlay(std::string filename, bool allowSkipping);
|
|
void addConsoleCommandObject(const MWWorld::Ptr& ptr);
|
|
void addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int shortVal);
|
|
void addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal);
|
|
void addScriptMemberShort(std::string refId, int index, int shortVal);
|
|
|
|
void sendObjectActivate();
|
|
void sendObjectHit();
|
|
void sendObjectPlace();
|
|
void sendObjectSpawn();
|
|
void sendObjectDelete();
|
|
void sendObjectLock();
|
|
void sendObjectTrap();
|
|
void sendObjectScale();
|
|
void sendObjectState();
|
|
void sendObjectAnimPlay();
|
|
void sendDoorState();
|
|
void sendMusicPlay();
|
|
void sendVideoPlay();
|
|
void sendScriptLocalShort();
|
|
void sendScriptLocalFloat();
|
|
void sendScriptMemberShort();
|
|
void sendContainer();
|
|
void sendConsoleCommand();
|
|
|
|
private:
|
|
Networking *getNetworking();
|
|
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_OBJECTLIST_HPP
|