summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/environment.h
blob: 1c35c2073dfa5218b50d9112dd9add360fdc6d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

class CMLuaEnvironment : public CMPluginBase
{
private:
	std::map<HANDLE, int> m_hookRefs;
	std::map<HANDLE, int> m_serviceRefs;

	void CreateEnvironmentTable();

public:
	lua_State * L;

	CMLuaEnvironment(lua_State *L);
	virtual ~CMLuaEnvironment();

	static CMLuaEnvironment* GetEnvironment(lua_State *L);
	static int GetEnvironmentId(lua_State *L);

	HANDLE HookEvent(const char *name, int ref);
	int UnhookEvent(HANDLE hHook);

	HANDLE CreateServiceFunction(const char *name, int ref);
	void DestroyServiceFunction(HANDLE hService);

	int Load() override;
};