2021-09-10 19:13:42 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include "Library/DPP.hpp"
|
2021-09-12 16:53:57 +02:00
|
|
|
#include "Library/DPP/Cluster.hpp"
|
2021-09-10 19:13:42 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include <sqratConst.h>
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void TerminateDPP()
|
|
|
|
{
|
|
|
|
// Go over all clusters and try to terminate them
|
|
|
|
for (DpCluster * inst = DpCluster::sHead; inst && inst->mNext != DpCluster::sHead; inst = inst->mNext)
|
|
|
|
{
|
|
|
|
inst->Terminate(); // Terminate() the cluster
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void ProcessDPP()
|
|
|
|
{
|
|
|
|
// Go over all clusters and allow them to process data
|
|
|
|
for (DpCluster * inst = DpCluster::sHead; inst && inst->mNext != DpCluster::sHead; inst = inst->mNext)
|
|
|
|
{
|
|
|
|
inst->Process();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-09-12 16:53:57 +02:00
|
|
|
extern void Register_DPP_Channel(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Client(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Cluster(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Command(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Constants(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Events(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Guild(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Integration(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Message(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Other(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_Role(HSQUIRRELVM vm, Table & ns);
|
|
|
|
extern void Register_DPP_User(HSQUIRRELVM vm, Table & ns);
|
2021-09-10 19:13:42 +02:00
|
|
|
|
|
|
|
// ================================================================================================
|
|
|
|
void Register_DPP(HSQUIRRELVM vm)
|
|
|
|
{
|
|
|
|
Table ns(vm);
|
|
|
|
// --------------------------------------------------------------------------------------------
|
2021-09-12 16:53:57 +02:00
|
|
|
Register_DPP_Constants(vm, ns);
|
|
|
|
Register_DPP_Client(vm, ns);
|
|
|
|
Register_DPP_Integration(vm, ns);
|
|
|
|
Register_DPP_Command(vm, ns);
|
|
|
|
Register_DPP_Message(vm, ns);
|
|
|
|
Register_DPP_Channel(vm, ns);
|
|
|
|
Register_DPP_Other(vm, ns);
|
|
|
|
Register_DPP_Role(vm, ns);
|
|
|
|
Register_DPP_User(vm, ns);
|
|
|
|
Register_DPP_Guild(vm, ns);
|
2021-09-10 19:13:42 +02:00
|
|
|
{
|
|
|
|
Table ens(vm);
|
2021-09-12 16:53:57 +02:00
|
|
|
Register_DPP_Events(vm, ens);
|
2021-09-10 19:13:42 +02:00
|
|
|
ns.Bind(_SC("Events"), ens);
|
|
|
|
}
|
2021-09-12 16:53:57 +02:00
|
|
|
Register_DPP_Cluster(vm, ns);
|
2021-09-10 19:13:42 +02:00
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
ns.Func(_SC("HasVoice"), dpp::utility::has_voice);
|
2021-09-12 16:53:57 +02:00
|
|
|
// --------------------------------------------------------------------------------------------
|
2021-09-10 19:13:42 +02:00
|
|
|
RootTable(vm).Bind(_SC("SqDiscord"), ns);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|