mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Implemented BasicEvent type.
This commit is contained in:
parent
6ed02d0fd4
commit
20a78ab268
@ -201,7 +201,6 @@ template < class T > class Ent;
|
||||
template < class T > class EntMan;
|
||||
template < class T > class Reference;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CBlip;
|
||||
class CCheckpoint;
|
||||
@ -217,10 +216,17 @@ class CVehicle;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
struct CAutomobile;
|
||||
struct CModel;
|
||||
struct CPlayerImmunity;
|
||||
struct CRadio;
|
||||
struct CSkin;
|
||||
struct CSound;
|
||||
struct CVehicleImmunity;
|
||||
struct CWastedSettings;
|
||||
struct CWeapon;
|
||||
struct CWorldBounds;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
@ -298,8 +304,10 @@ struct CModel;
|
||||
#define _SCU32(v) static_cast<Uint32>(v)
|
||||
#define _SCI64(v) static_cast<Int64>(v)
|
||||
#define _SCU64(v) static_cast<Uint64>(v)
|
||||
#define _SCSQI(v) static_cast<SQInteger>(v)
|
||||
#define _SCF32(v) static_cast<Float32>(v)
|
||||
#define _SCF64(v) static_cast<Float64>(v)
|
||||
#define _SCSQF(v) static_cast<SQFloat>(v)
|
||||
|
||||
// Short notation for getting the minimum and maxmimum value of primitives
|
||||
#define _NLMIN(t) std::numeric_limits<t>::min()
|
||||
|
@ -70,6 +70,7 @@ Core::Pointer Core::Inst() noexcept
|
||||
{
|
||||
return Pointer(new Core(), &Core::_Finalizer);
|
||||
}
|
||||
|
||||
return Pointer(nullptr, &Core::_Finalizer);
|
||||
}
|
||||
|
||||
@ -362,7 +363,11 @@ bool Core::CreateVM() noexcept
|
||||
|
||||
void Core::DestroyVM() noexcept
|
||||
{
|
||||
if (m_VM) sq_close(m_VM);
|
||||
if (m_VM != nullptr)
|
||||
{
|
||||
sq_close(m_VM);
|
||||
m_VM = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1427,7 +1432,7 @@ void Core::OnSphereExited(SQInt32 sphere, SQInt32 player) noexcept
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Core::OnServerFrame(SQFloat delta) noexcept
|
||||
{
|
||||
|
||||
ServerFrame.Emit(std::forward< SQFloat >(delta));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -613,6 +613,12 @@ public:
|
||||
// --------------------------------------------------------------------------------------------
|
||||
EWorldOption WorldOption;
|
||||
EWorldToggle WorldToggle;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
EScriptReload ScriptReload;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
ELogMessage LogMessage;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -1317,7 +1317,8 @@ public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Counts the number of persistent references for this entity
|
||||
*/ SQUint32 CountPersistentRefs() const noexcept
|
||||
*/
|
||||
SQUint32 CountPersistentRefs() const noexcept
|
||||
{
|
||||
SQUint32 refs = 0;
|
||||
// Make sure the reference is valid
|
||||
@ -1379,9 +1380,8 @@ private:
|
||||
if (RefType::Verify(id))
|
||||
{
|
||||
RefType * ref = 0, bkp = 0;
|
||||
|
||||
// Get the pointer to the first backward reference
|
||||
ref = RefType::s_Instances[id].Root->m_Prev;
|
||||
|
||||
// Deactivate backward references
|
||||
while (ref)
|
||||
{
|
||||
@ -1402,9 +1402,8 @@ private:
|
||||
bkp->RemoveFromChain();
|
||||
}
|
||||
}
|
||||
|
||||
// Get the pointer to the first forward reference
|
||||
ref = RefType::s_Instances[id].Root->m_Next;
|
||||
|
||||
// Deactivate forward references
|
||||
while (ref)
|
||||
{
|
||||
@ -1459,10 +1458,12 @@ private:
|
||||
// See if there's any persistent references to activate
|
||||
if (RefType::s_Instances[id].Root)
|
||||
{
|
||||
// @TODO Remove the reference from the chain, if somehow
|
||||
// is present there without being persistent
|
||||
|
||||
// Resurect backward references
|
||||
for (RefType * ref = RefType::s_Instances[id].Root->m_Prev; ref; ref = ref->m_Prev)
|
||||
{
|
||||
// Unnecessary check, but just to be sure
|
||||
if (ref->m_Persistent)
|
||||
{
|
||||
ref->m_ID = id;
|
||||
@ -1471,7 +1472,6 @@ private:
|
||||
// Resurect forward references
|
||||
for (RefType * ref = RefType::s_Instances[id].Root->m_Next; ref; ref = ref->m_Next)
|
||||
{
|
||||
// Unnecessary check, but just to be sure
|
||||
if (ref->m_Persistent)
|
||||
{
|
||||
ref->m_ID = id;
|
||||
|
1920
source/Event/Basic.cpp
Normal file
1920
source/Event/Basic.cpp
Normal file
File diff suppressed because it is too large
Load Diff
788
source/Event/Basic.hpp
Normal file
788
source/Event/Basic.hpp
Normal file
@ -0,0 +1,788 @@
|
||||
#ifndef _SQMOD_EVENT_BASIC_HPP_
|
||||
#define _SQMOD_EVENT_BASIC_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "Shared.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <chrono>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
class BasicEvent
|
||||
{
|
||||
protected:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
typedef std::chrono::time_point<std::chrono::steady_clock> TimePoint;
|
||||
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent(SQInt32 type) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent(SQInt32 type, bool suspended) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent(const BasicEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent(BasicEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~BasicEvent();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent & operator = (const BasicEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
BasicEvent & operator = (BasicEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator == (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator != (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator < (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator > (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator <= (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator >= (const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator bool () const noexcept
|
||||
{
|
||||
return (m_Type == EVT_UNKNOWN || m_Type >= EVT_COUNT);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator ! () const noexcept
|
||||
{
|
||||
return (m_Type == EVT_COUNT || m_Type >= EVT_COUNT);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 Cmp(const BasicEvent & o) const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
const SQChar * GetName() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetType() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
const SQChar * GetTag() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetTag(const SQChar * tag) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SqObj & GetData() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetData(SqObj & data) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger GetIdle() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetIdle(SQInteger millis) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool IsIdle() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetStride() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetStride(SQInt32 stride) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetIgnore() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetIgnore(SQInt32 ignore) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetPrimary() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetPrimary(SQInt32 subset) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetSecondary() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetSecondary(SQInt32 subset) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetSuspended() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetSuspended(bool toggle) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
Function GetOnTrigger() const noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetOnTrigger(const Function & func) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void BlipCreated(SQInt32 blip, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CheckpointCreated(SQInt32 checkpoint, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void KeybindCreated(SQInt32 keybind, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ObjectCreated(SQInt32 object, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupCreated(SQInt32 pickup, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerCreated(SQInt32 player, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SphereCreated(SQInt32 sphere, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SpriteCreated(SQInt32 sprite, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void TextdrawCreated(SQInt32 textdraw, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleCreated(SQInt32 vehicle, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void BlipDestroyed(SQInt32 blip, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CheckpointDestroyed(SQInt32 checkpoint, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void KeybindDestroyed(SQInt32 keybind, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ObjectDestroyed(SQInt32 object, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupDestroyed(SQInt32 pickup, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerDestroyed(SQInt32 player, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SphereDestroyed(SQInt32 sphere, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SpriteDestroyed(SQInt32 sprite, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void TextdrawDestroyed(SQInt32 textdraw, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleDestroyed(SQInt32 vehicle, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void BlipCustom(SQInt32 blip, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CheckpointCustom(SQInt32 checkpoint, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void KeybindCustom(SQInt32 keybind, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ObjectCustom(SQInt32 object, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupCustom(SQInt32 pickup, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerCustom(SQInt32 player, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SphereCustom(SQInt32 sphere, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SpriteCustom(SQInt32 sprite, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void TextdrawCustom(SQInt32 textdraw, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleCustom(SQInt32 vehicle, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerAway(SQInt32 player, bool status) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerGameKeys(SQInt32 player, SQInt32 previous, SQInt32 current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerRename(SQInt32 player, const SQChar * previous, const SQChar * current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerRequestClass(SQInt32 player, SQInt32 offset) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerRequestSpawn(SQInt32 player) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerSpawn(SQInt32 player) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerStartTyping(SQInt32 player) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerStopTyping(SQInt32 player) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerChat(SQInt32 player, const SQChar * message) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerCommand(SQInt32 player, const SQChar * command) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerMessage(SQInt32 player, SQInt32 receiver, const SQChar * message) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerHealth(SQInt32 player, SQFloat previous, SQFloat current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerArmour(SQInt32 player, SQFloat previous, SQFloat current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerWeapon(SQInt32 player, SQInt32 previous, SQInt32 current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerMove(SQInt32 player, const Vector3 & previous, const Vector3 & current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerWasted(SQInt32 player, SQInt32 reason) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerKilled(SQInt32 player, SQInt32 killer, SQInt32 reason, SQInt32 body_part) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerTeamKill(SQInt32 player, SQInt32 killer, SQInt32 reason, SQInt32 body_part) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerSpectate(SQInt32 player, SQInt32 target) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerCrashreport(SQInt32 player, const SQChar * report) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerBurning(SQInt32 player, bool state) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerCrouching(SQInt32 player, bool state) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerState(SQInt32 player, SQInt32 previous, SQInt32 current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PlayerAction(SQInt32 player, SQInt32 previous, SQInt32 current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateNone(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateNormal(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateShooting(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateDriver(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StatePassenger(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateEnterDriver(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateEnterPassenger(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateExitVehicle(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void StateUnspawned(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionNone(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionNormal(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionAiming(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionShooting(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionJumping(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionLieDown(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionGettingUp(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionJumpVehicle(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionDriving(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionDying(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionWasted(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionEmbarking(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ActionDisembarking(SQInt32 player, SQInt32 previous) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleRespawn(SQInt32 vehicle) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleExplode(SQInt32 vehicle) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleHealth(SQInt32 vehicle, SQFloat previous, SQFloat current) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleMove(SQInt32 vehicle, const Vector3 & previous, const Vector3 ¤t) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupRespawn(SQInt32 pickup) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void KeybindKeyPress(SQInt32 player, SQInt32 keybind) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void KeybindKeyRelease(SQInt32 player, SQInt32 keybind) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleEmbarking(SQInt32 player, SQInt32 vehicle, SQInt32 slot) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleEmbarked(SQInt32 player, SQInt32 vehicle, SQInt32 slot) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void VehicleDisembark(SQInt32 player, SQInt32 vehicle) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupClaimed(SQInt32 player, SQInt32 pickup) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void PickupCollected(SQInt32 player, SQInt32 pickup) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ObjectShot(SQInt32 player, SQInt32 object, SQInt32 weapon) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ObjectBump(SQInt32 player, SQInt32 object) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CheckpointEntered(SQInt32 player, SQInt32 checkpoint) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CheckpointExited(SQInt32 player, SQInt32 checkpoint) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SphereEntered(SQInt32 player, SQInt32 sphere) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SphereExited(SQInt32 player, SQInt32 sphere) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ServerFrame(SQFloat delta) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ServerStartup() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ServerShutdown() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void InternalCommand(SQInt32 type, const SQChar * text) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void LoginAttempt(const SQChar * name, const SQChar * pass, const SQChar * addr) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void CustomEvent(SQInt32 group, SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void WorldOption(SQInt32 option, Object & value) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void WorldToggle(SQInt32 option, bool value) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void ScriptReload(SQInt32 header, Object & payload) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void LogMessage(SQInt32 type, const SQChar * message) noexcept;
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool Trigger() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Attach(EventType evt) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Detach(EventType evt) noexcept;
|
||||
|
||||
private:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
EventType m_Type;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
SQInt32 m_Stride;
|
||||
SQInt32 m_Ignore;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
SQInt32 m_Primary;
|
||||
SQInt32 m_Secondary;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
TimePoint m_Idle;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
Function m_OnTrigger;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
SqTag m_Tag;
|
||||
SqObj m_Data;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
bool m_Suspended;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _SQMOD_EVENT_BASIC_HPP_
|
70
source/Event/Global.cpp
Normal file
70
source/Event/Global.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include "Event/Global.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::GlobalEvent() noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::GlobalEvent(SQInt32 type) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::GlobalEvent(SQInt32 type, bool suspended) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::GlobalEvent(const GlobalEvent & o) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::GlobalEvent(GlobalEvent && o) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent::~GlobalEvent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent & GlobalEvent::operator = (const GlobalEvent & o) noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
GlobalEvent & GlobalEvent::operator = (GlobalEvent && o) noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_GlobalEvent(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <GlobalEvent> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("GlobalEvent"), Sqrat::Class< GlobalEvent >(vm, _SC("GlobalEvent"))
|
||||
.Ctor()
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CAutomobile> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
78
source/Event/Global.hpp
Normal file
78
source/Event/Global.hpp
Normal file
@ -0,0 +1,78 @@
|
||||
#ifndef _SQMOD_EVENT_GLOBAL_HPP_
|
||||
#define _SQMOD_EVENT_GLOBAL_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "Shared.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <chrono>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
class GlobalEvent
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent(SQInt32 type) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent(SQInt32 type, bool suspended) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent(const GlobalEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent(GlobalEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~GlobalEvent();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent & operator = (const GlobalEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
GlobalEvent & operator = (GlobalEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _SQMOD_EVENT_GLOBAL_HPP_
|
73
source/Event/Local.cpp
Normal file
73
source/Event/Local.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
#include "Event/Local.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::LocalEvent() noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::LocalEvent(SQInt32 type) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::LocalEvent(SQInt32 type, bool suspended) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::LocalEvent(const LocalEvent & o) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::LocalEvent(LocalEvent && o) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent::~LocalEvent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent & LocalEvent::operator = (const LocalEvent & o) noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LocalEvent & LocalEvent::operator = (LocalEvent && o) noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_LocalEvent(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <LocalEvent> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("LocalEvent"), Sqrat::Class< LocalEvent >(vm, _SC("LocalEvent"))
|
||||
.Ctor()
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CAutomobile> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
78
source/Event/Local.hpp
Normal file
78
source/Event/Local.hpp
Normal file
@ -0,0 +1,78 @@
|
||||
#ifndef _SQMOD_EVENT_LOCAL_HPP_
|
||||
#define _SQMOD_EVENT_LOCAL_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "Shared.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <chrono>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
class LocalEvent
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent() noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent(SQInt32 type) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent(SQInt32 type, bool suspended) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent(const LocalEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent(LocalEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~LocalEvent();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent & operator = (const LocalEvent & o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
LocalEvent & operator = (LocalEvent && o) noexcept;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _SQMOD_EVENT_LOCAL_HPP_
|
0
source/Event/Routine.cpp
Normal file
0
source/Event/Routine.cpp
Normal file
0
source/Event/Routine.hpp
Normal file
0
source/Event/Routine.hpp
Normal file
128
source/Event/Shared.cpp
Normal file
128
source/Event/Shared.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Event/Shared.hpp"
|
||||
#include "Register.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * GetEventName(EventType evt)
|
||||
{
|
||||
switch (evt)
|
||||
{
|
||||
case EVT_BLIPCREATED: return _SC("Blip Created");
|
||||
case EVT_CHECKPOINTCREATED: return _SC("Checkpoint Created");
|
||||
case EVT_KEYBINDCREATED: return _SC("Keybind Created");
|
||||
case EVT_OBJECTCREATED: return _SC("Object Created");
|
||||
case EVT_PICKUPCREATED: return _SC("Pickup Created");
|
||||
case EVT_PLAYERCREATED: return _SC("Player Created");
|
||||
case EVT_SPHERECREATED: return _SC("Sphere Created");
|
||||
case EVT_SPRITECREATED: return _SC("Sprite Created");
|
||||
case EVT_TEXTDRAWCREATED: return _SC("Textdraw Created");
|
||||
case EVT_VEHICLECREATED: return _SC("Vehicle Created");
|
||||
case EVT_BLIPDESTROYED: return _SC("Blip Destroyed");
|
||||
case EVT_CHECKPOINTDESTROYED: return _SC("Checkpoint Destroyed");
|
||||
case EVT_KEYBINDDESTROYED: return _SC("Keybind Destroyed");
|
||||
case EVT_OBJECTDESTROYED: return _SC("Object Destroyed");
|
||||
case EVT_PICKUPDESTROYED: return _SC("Pickup Destroyed");
|
||||
case EVT_PLAYERDESTROYED: return _SC("Player Destroyed");
|
||||
case EVT_SPHEREDESTROYED: return _SC("Sphere Destroyed");
|
||||
case EVT_SPRITEDESTROYED: return _SC("Sprite Destroyed");
|
||||
case EVT_TEXTDRAWDESTROYED: return _SC("Textdraw Destroyed");
|
||||
case EVT_VEHICLEDESTROYED: return _SC("Vehicle Destroyed");
|
||||
case EVT_BLIPCUSTOM: return _SC("Blip Custom");
|
||||
case EVT_CHECKPOINTCUSTOM: return _SC("Checkpoint Custom");
|
||||
case EVT_KEYBINDCUSTOM: return _SC("Keybind Custom");
|
||||
case EVT_OBJECTCUSTOM: return _SC("Object Custom");
|
||||
case EVT_PICKUPCUSTOM: return _SC("Pickup Custom");
|
||||
case EVT_PLAYERCUSTOM: return _SC("Player Custom");
|
||||
case EVT_SPHERECUSTOM: return _SC("Sphere Custom");
|
||||
case EVT_SPRITECUSTOM: return _SC("Sprite Custom");
|
||||
case EVT_TEXTDRAWCUSTOM: return _SC("Textdraw Custom");
|
||||
case EVT_VEHICLECUSTOM: return _SC("Vehicle Custom");
|
||||
case EVT_PLAYERAWAY: return _SC("Player Away");
|
||||
case EVT_PLAYERGAMEKEYS: return _SC("Player Game Keys");
|
||||
case EVT_PLAYERRENAME: return _SC("Player Rename");
|
||||
case EVT_PLAYERREQUESTCLASS: return _SC("Player Request Class");
|
||||
case EVT_PLAYERREQUESTSPAWN: return _SC("Player Request Spawn");
|
||||
case EVT_PLAYERSPAWN: return _SC("Player Spawn");
|
||||
case EVT_PLAYERSTARTTYPING: return _SC("Player Start Typing");
|
||||
case EVT_PLAYERSTOPTYPING: return _SC("Player Stop Typing");
|
||||
case EVT_PLAYERCHAT: return _SC("Player Chat");
|
||||
case EVT_PLAYERCOMMAND: return _SC("Player Command");
|
||||
case EVT_PLAYERMESSAGE: return _SC("Player Message");
|
||||
case EVT_PLAYERHEALTH: return _SC("Player Health");
|
||||
case EVT_PLAYERARMOUR: return _SC("Player Armour");
|
||||
case EVT_PLAYERWEAPON: return _SC("Player Weapon");
|
||||
case EVT_PLAYERMOVE: return _SC("Player Move");
|
||||
case EVT_PLAYERWASTED: return _SC("Player Wasted");
|
||||
case EVT_PLAYERKILLED: return _SC("Player Killed");
|
||||
case EVT_PLAYERTEAMKILL: return _SC("Player Team Kill");
|
||||
case EVT_PLAYERSPECTATE: return _SC("Player Spectate");
|
||||
case EVT_PLAYERCRASHREPORT: return _SC("Player Crash Report");
|
||||
case EVT_PLAYERBURNING: return _SC("Player Burning");
|
||||
case EVT_PLAYERCROUCHING: return _SC("Player Crouching");
|
||||
case EVT_PLAYERSTATE: return _SC("Player State");
|
||||
case EVT_PLAYERACTION: return _SC("Player Action");
|
||||
case EVT_STATENONE: return _SC("State None");
|
||||
case EVT_STATENORMAL: return _SC("State Normal");
|
||||
case EVT_STATESHOOTING: return _SC("State Shooting");
|
||||
case EVT_STATEDRIVER: return _SC("State Driver");
|
||||
case EVT_STATEPASSENGER: return _SC("State Passenger");
|
||||
case EVT_STATEENTERDRIVER: return _SC("State Enter Driver");
|
||||
case EVT_STATEENTERPASSENGER: return _SC("State Enter Passenger");
|
||||
case EVT_STATEEXITVEHICLE: return _SC("State Exit Vehicle");
|
||||
case EVT_STATEUNSPAWNED: return _SC("State Unspawned");
|
||||
case EVT_ACTIONNONE: return _SC("Action None");
|
||||
case EVT_ACTIONNORMAL: return _SC("Action Normal");
|
||||
case EVT_ACTIONAIMING: return _SC("Action Aiming");
|
||||
case EVT_ACTIONSHOOTING: return _SC("Action Shooting");
|
||||
case EVT_ACTIONJUMPING: return _SC("Action Jumping");
|
||||
case EVT_ACTIONLIEDOWN: return _SC("Action Lie Down");
|
||||
case EVT_ACTIONGETTINGUP: return _SC("Action Getting Up");
|
||||
case EVT_ACTIONJUMPVEHICLE: return _SC("Action Jump Vehicle");
|
||||
case EVT_ACTIONDRIVING: return _SC("Action Driving");
|
||||
case EVT_ACTIONDYING: return _SC("Action Dying");
|
||||
case EVT_ACTIONWASTED: return _SC("Action Wasted");
|
||||
case EVT_ACTIONEMBARKING: return _SC("Action Embarking");
|
||||
case EVT_ACTIONDISEMBARKING: return _SC("Action Disembarking");
|
||||
case EVT_VEHICLERESPAWN: return _SC("Vehicle Respawn");
|
||||
case EVT_VEHICLEEXPLODE: return _SC("Vehicle Explode");
|
||||
case EVT_VEHICLEHEALTH: return _SC("Vehicle Health");
|
||||
case EVT_VEHICLEMOVE: return _SC("Vehicle Move");
|
||||
case EVT_PICKUPRESPAWN: return _SC("Pickup Respawn");
|
||||
case EVT_KEYBINDKEYPRESS: return _SC("Keybind Key Press");
|
||||
case EVT_KEYBINDKEYRELEASE: return _SC("Keybind Key Release");
|
||||
case EVT_VEHICLEEMBARKING: return _SC("Vehicle Embarking");
|
||||
case EVT_VEHICLEEMBARKED: return _SC("Vehicle Embarked");
|
||||
case EVT_VEHICLEDISEMBARK: return _SC("Vehicle Disembark");
|
||||
case EVT_PICKUPCLAIMED: return _SC("Pickup Claimed");
|
||||
case EVT_PICKUPCOLLECTED: return _SC("Pickup Collected");
|
||||
case EVT_OBJECTSHOT: return _SC("Object Shot");
|
||||
case EVT_OBJECTBUMP: return _SC("Object Bump");
|
||||
case EVT_CHECKPOINTENTERED: return _SC("Checkpoint Entered");
|
||||
case EVT_CHECKPOINTEXITED: return _SC("Checkpoint Exited");
|
||||
case EVT_SPHEREENTERED: return _SC("Sphere Entered");
|
||||
case EVT_SPHEREEXITED: return _SC("Sphere Exited");
|
||||
case EVT_SERVERFRAME: return _SC("Server Frame");
|
||||
case EVT_SERVERSTARTUP: return _SC("Server Startup");
|
||||
case EVT_SERVERSHUTDOWN: return _SC("Server Shutdown");
|
||||
case EVT_INTERNALCOMMAND: return _SC("Internal Command");
|
||||
case EVT_LOGINATTEMPT: return _SC("Login Attempt");
|
||||
case EVT_CUSTOMEVENT: return _SC("Custom Event");
|
||||
case EVT_WORLDOPTION: return _SC("World Option");
|
||||
case EVT_WORLDTOGGLE: return _SC("World Toggle");
|
||||
case EVT_SCRIPTRELOAD: return _SC("Script Reload");
|
||||
case EVT_LOGMESSAGE: return _SC("Log Message");
|
||||
default: return _SC("Unknown");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_Event(HSQUIRRELVM vm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
15
source/Event/Shared.hpp
Normal file
15
source/Event/Shared.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _SQMOD_EVENT_SHARED_HPP_
|
||||
#define _SQMOD_EVENT_SHARED_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Signal.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * GetEventName(EventType evt);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _SQMOD_EVENT_SHARED_HPP_
|
@ -69,7 +69,12 @@ bool RegisterAPI(HSQUIRRELVM vm) noexcept
|
||||
_Log->cFtl(!Register_CWastedSettings(vm), "Unable to register: CWastedSettings") || \
|
||||
_Log->cFtl(!Register_CWeapon(vm), "Unable to register: CWeapon") || \
|
||||
_Log->cFtl(!Register_CWorldBounds(vm), "Unable to register: CWorldBounds") || \
|
||||
_Log->cFtl(!Register_Misc(vm), "Unable to register: Misc")
|
||||
_Log->cFtl(!Register_Misc(vm), "Unable to register: Misc") || \
|
||||
|
||||
_Log->cFtl(!Register_BasicEvent(vm), "Unable to register: BasicEvent") || \
|
||||
_Log->cFtl(!Register_GlobalEvent(vm), "Unable to register: GlobalEvent") || \
|
||||
_Log->cFtl(!Register_LocalEvent(vm), "Unable to register: LocalEvent") || \
|
||||
_Log->cFtl(!Register_Event(vm), "Unable to register: Event")
|
||||
) return false;
|
||||
|
||||
return true;
|
||||
|
@ -98,6 +98,12 @@ bool Register_SSprite(HSQUIRRELVM vm);
|
||||
bool Register_STextdraw(HSQUIRRELVM vm);
|
||||
bool Register_Selector(HSQUIRRELVM vm);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_BasicEvent(HSQUIRRELVM vm);
|
||||
bool Register_GlobalEvent(HSQUIRRELVM vm);
|
||||
bool Register_LocalEvent(HSQUIRRELVM vm);
|
||||
bool Register_Event(HSQUIRRELVM vm);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_Utility(HSQUIRRELVM vm);
|
||||
|
||||
|
@ -92,9 +92,12 @@ protected:
|
||||
{
|
||||
if (node->m_This == t && node->m_Exec == e)
|
||||
{
|
||||
if (prev) {
|
||||
if (prev)
|
||||
{
|
||||
prev->m_Next = node->m_Next;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Head = m_Head->m_Next;
|
||||
}
|
||||
delete node;
|
||||
@ -108,7 +111,7 @@ protected:
|
||||
{
|
||||
for (Node * node = m_Head, * next = 0; node; node = next)
|
||||
{
|
||||
next = node->m_Next ? node->m_Next : 0;
|
||||
next = node->m_Next;
|
||||
delete node;
|
||||
}
|
||||
m_Head = 0;
|
||||
@ -461,8 +464,8 @@ using EPlayerSpectate = Signal< void (SQInt32 /* player */, SQInt32 /* tar
|
||||
using EPlayerCrashreport = Signal< void (SQInt32 /* player */, const SQChar * /* report */), EVT_PLAYERCRASHREPORT >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EPlayerBurning = Signal< void (SQInt32 /* player */, bool /* state */ ), EVT_PLAYERBURNING >;
|
||||
using EPlayerCrouching = Signal< void (SQInt32 /* player */, bool /* state */ ), EVT_PLAYERCROUCHING >;
|
||||
using EPlayerBurning = Signal< void (SQInt32 /* player */, bool /* state */), EVT_PLAYERBURNING >;
|
||||
using EPlayerCrouching = Signal< void (SQInt32 /* player */, bool /* state */), EVT_PLAYERCROUCHING >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EPlayerState = Signal< void (SQInt32 /* player */, SQInt32 /* previous */, SQInt32 /* current */), EVT_PLAYERSTATE >;
|
||||
@ -480,27 +483,27 @@ using EStateExitVehicle = Signal< void (SQInt32 /* player */, SQInt32 /* pre
|
||||
using EStateUnspawned = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_STATEUNSPAWNED >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EActionNone = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONNONE >;
|
||||
using EActionNormal = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONNORMAL >;
|
||||
using EActionAiming = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONAIMING >;
|
||||
using EActionShooting = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONSHOOTING >;
|
||||
using EActionJumping = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONJUMPING >;
|
||||
using EActionLieDown = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONLIEDOWN >;
|
||||
using EActionGettingUp = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONGETTINGUP >;
|
||||
using EActionJumpVehicle = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONJUMPVEHICLE >;
|
||||
using EActionDriving = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONDRIVING >;
|
||||
using EActionDying = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONDYING >;
|
||||
using EActionWasted = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONWASTED >;
|
||||
using EActionEmbarking = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONEMBARKING >;
|
||||
using EActionDisembarking = Signal< void (SQInt32 /* player */, SQInt32 /* previous */ ), EVT_ACTIONDISEMBARKING >;
|
||||
using EActionNone = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONNONE >;
|
||||
using EActionNormal = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONNORMAL >;
|
||||
using EActionAiming = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONAIMING >;
|
||||
using EActionShooting = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONSHOOTING >;
|
||||
using EActionJumping = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONJUMPING >;
|
||||
using EActionLieDown = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONLIEDOWN >;
|
||||
using EActionGettingUp = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONGETTINGUP >;
|
||||
using EActionJumpVehicle = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONJUMPVEHICLE >;
|
||||
using EActionDriving = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONDRIVING >;
|
||||
using EActionDying = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONDYING >;
|
||||
using EActionWasted = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONWASTED >;
|
||||
using EActionEmbarking = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONEMBARKING >;
|
||||
using EActionDisembarking = Signal< void (SQInt32 /* player */, SQInt32 /* previous */), EVT_ACTIONDISEMBARKING >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EVehicleRespawn = Signal< void (SQInt32 /* vehcle */), EVT_VEHICLERESPAWN >;
|
||||
using EVehicleExplode = Signal< void (SQInt32 /* vehcle */), EVT_VEHICLEEXPLODE >;
|
||||
using EVehicleRespawn = Signal< void (SQInt32 /* vehicle */), EVT_VEHICLERESPAWN >;
|
||||
using EVehicleExplode = Signal< void (SQInt32 /* vehicle */), EVT_VEHICLEEXPLODE >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EVehicleHealth = Signal< void (SQInt32 /* vehcle */, SQFloat, SQFloat), EVT_VEHICLEHEALTH >;
|
||||
using EVehicleMove = Signal< void (SQInt32 /* vehcle */, const Vector3 &, const Vector3 &), EVT_VEHICLEMOVE >;
|
||||
using EVehicleHealth = Signal< void (SQInt32 /* vehicle */, SQFloat /* previous */, SQFloat /* current */), EVT_VEHICLEHEALTH >;
|
||||
using EVehicleMove = Signal< void (SQInt32 /* vehicle */, const Vector3 & /* previous */, const Vector3 &/* current */), EVT_VEHICLEMOVE >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EPickupRespawn = Signal< void (SQInt32 /* pickup */), EVT_PICKUPRESPAWN >;
|
||||
@ -510,9 +513,9 @@ using EKeybindKeyPress = Signal< void (SQInt32 /* player */, SQInt32 /* key
|
||||
using EKeybindKeyRelease = Signal< void (SQInt32 /* player */, SQInt32 /* keybind */), EVT_KEYBINDKEYRELEASE >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EVehicleEmbarking = Signal< void (SQInt32 /* player */, SQInt32 /* vehcle */, SQInt32 /* slot */), EVT_VEHICLEEMBARKING >;
|
||||
using EVehicleEmbarked = Signal< void (SQInt32 /* player */, SQInt32 /* vehcle */, SQInt32 /* slot */), EVT_VEHICLEEMBARKED >;
|
||||
using EVehicleDisembark = Signal< void (SQInt32 /* player */, SQInt32 /* vehcle */), EVT_VEHICLEDISEMBARK >;
|
||||
using EVehicleEmbarking = Signal< void (SQInt32 /* player */, SQInt32 /* vehicle */, SQInt32 /* slot */), EVT_VEHICLEEMBARKING >;
|
||||
using EVehicleEmbarked = Signal< void (SQInt32 /* player */, SQInt32 /* vehicle */, SQInt32 /* slot */), EVT_VEHICLEEMBARKED >;
|
||||
using EVehicleDisembark = Signal< void (SQInt32 /* player */, SQInt32 /* vehicle */), EVT_VEHICLEDISEMBARK >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EPickupClaimed = Signal< void (SQInt32 /* player */, SQInt32 /* pickup */), EVT_PICKUPCLAIMED >;
|
||||
@ -548,6 +551,9 @@ using ECustomEvent = Signal< void (SQInt32 /* group */, SQInt32 /* head
|
||||
using EWorldOption = Signal< void (SQInt32 /* option */, Object & /* value */), EVT_WORLDOPTION >;
|
||||
using EWorldToggle = Signal< void (SQInt32 /* option */, bool /* value */), EVT_WORLDTOGGLE >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using EScriptReload = Signal< void (SQInt32 /* header */, Object & /* payload */), EVT_SCRIPTRELOAD >;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using ELogMessage = Signal< void (SQInt32 /* type */, const SQChar * /* message */), EVT_LOGMESSAGE >;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user