| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifdef WITH_LUA |
| 20 |
#ifndef JUST_NEED_TYPES |
| 21 |
#ifndef INCLUDED_LUAINTERFACE_PROTOS |
| 22 |
#define INCLUDED_LUAINTERFACE_PROTOS |
| 23 |
|
| 24 |
#ifdef WIN32 |
| 25 |
#pragma comment(lib, "lua5.1.lib") |
| 26 |
#endif |
| 27 |
|
| 28 |
#define JUST_NEED_TYPES |
| 29 |
#include "connection.h" |
| 30 |
#include "luawrapper.h" |
| 31 |
#include <stdio.h> |
| 32 |
#undef JUST_NEED_TYPES |
| 33 |
|
| 34 |
namespace pvpgn |
| 35 |
{ |
| 36 |
|
| 37 |
namespace bnetd |
| 38 |
{ |
| 39 |
typedef enum { |
| 40 |
luaevent_command, |
| 41 |
luaevent_command_before, |
| 42 |
|
| 43 |
luaevent_game_create, |
| 44 |
luaevent_game_report, |
| 45 |
luaevent_game_end, |
| 46 |
luaevent_game_destroy, |
| 47 |
luaevent_game_changestatus, |
| 48 |
luaevent_game_userjoin, |
| 49 |
luaevent_game_userleft, |
| 50 |
|
| 51 |
luaevent_channel_message, |
| 52 |
luaevent_channel_userjoin, |
| 53 |
luaevent_channel_userleft, |
| 54 |
|
| 55 |
luaevent_user_whisper, |
| 56 |
luaevent_user_login, |
| 57 |
luaevent_user_disconnect, |
| 58 |
|
| 59 |
luaevent_server_start, |
| 60 |
luaevent_server_rehash, |
| 61 |
luaevent_server_mainloop, |
| 62 |
|
| 63 |
} t_luaevent_type; |
| 64 |
|
| 65 |
|
| 66 |
extern void lua_load(char const * scriptdir); |
| 67 |
extern void lua_unload(); |
| 68 |
|
| 69 |
extern int lua_handle_command(t_connection * c, char const * text, t_luaevent_type luaevent); |
| 70 |
extern void lua_handle_game(t_game * game, t_connection * c, t_luaevent_type luaevent); |
| 71 |
extern std::vector<t_game*> lua_handle_game_list(t_connection * c); |
| 72 |
|
| 73 |
extern int lua_handle_channel(t_channel * channel, t_connection * c, char const * message_text, t_message_type message_type, t_luaevent_type luaevent); |
| 74 |
extern int lua_handle_user(t_connection * c, t_connection * c_dst, char const * message_text, t_luaevent_type luaevent); |
| 75 |
extern const char * lua_handle_user_icon(t_connection * c, const char * iconinfo); |
| 76 |
extern void lua_handle_server(t_luaevent_type luaevent); |
| 77 |
|
| 78 |
extern void lua_handle_client_readmemory(t_connection * c, int request_id, std::vector<int> data); |
| 79 |
extern void lua_handle_client_extrawork(t_connection * c, int gametype, int length, const char * data); |
| 80 |
|
| 81 |
} |
| 82 |
|
| 83 |
} |
| 84 |
|
| 85 |
#endif |
| 86 |
#endif |
| 87 |
#endif |