summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_chat.cpp
blob: da45fd93e41a5c577ddddc3f95aaed7f62a50c63 (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
#include "stdafx.h"

static luaL_Reg chatApi[] =
{
	{ NULL, NULL }
};

LUAMOD_API int luaopen_m_chat(lua_State *L)
{
	luaL_newlib(L, chatApi);

	MT<GCEVENT>(L, "GCEVENT")
		.Field([](GCEVENT *gce) { return (void*)gce->pDest->pszModule; }, "Module", LUA_TSTRINGA)
		.Field([](GCEVENT *gce) { return (void*)gce->pDest->ptszID; }, "Id", LUA_TSTRINGW)
		.Field([](GCEVENT *gce) { return (void*)gce->pDest->iType; }, "Type", LUA_TINTEGER)
		.Field(&GCEVENT::time, "Timestamp", LUA_TINTEGER)
		.Field(&GCEVENT::time, "IsMe", LUA_TINTEGER)
		.Field(&GCEVENT::time, "Flags", LUA_TINTEGER)
		.Field(&GCEVENT::ptszNick, "Nick", LUA_TSTRINGW)
		.Field(&GCEVENT::ptszUID, "Uid", LUA_TSTRINGW)
		.Field(&GCEVENT::ptszStatus, "Status", LUA_TSTRINGW)
		.Field(&GCEVENT::ptszText, "Text", LUA_TSTRINGW);

	return 1;
}