-
Notifications
You must be signed in to change notification settings - Fork 6
/
LibM2.hpp
40 lines (39 loc) · 1.41 KB
/
LibM2.hpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
/* This file belongs to the LibM2 library (http://github.com/imermcmaps/LibM2)
* Copyright (c) 2013, iMer (www.imer.cc)
* All rights reserved.
* Licensed under the BSD 3-clause license (http://opensource.org/licenses/BSD-3-Clause)
*/
#ifndef __LIBM2_LIBM2_HPP
#define __LIBM2_LIBM2_HPP
#include "game/stdInclude.hpp"
#include "Command.hpp"
#include "lib/singleton.hpp"
#include "utils/detours.h"
#include "lib/hook.hpp"
#include "game/quest/CQuestManager.hpp"
#include "utils/lua.hpp"
#include "IQuest.hpp"
#include "lib/event.hpp"
extern char** environ;
namespace libm2{
typedef void(*tInterpretCommand)(LPCHARACTER,const char*, size_t);
class LibM2: public singleton<LibM2>{
protected:
std::map<std::string,ICommand*> m_map_command;
std::map<std::string,tQuestTable> m_map_quest;
MologieDetours::Detour<tInterpretCommand>*detour_interpretCommand;
MologieDetours::Detour<void(*)(void)>*detour_registerQuestTables;
public:
//events<CHARACTER*>* onDeath;
public:
LibM2();
static void interpretCommand(LPCHARACTER ch,const char* data, size_t len);
static void addCommand(std::string name,ICommand* cmd);
static void registerQuestTables();
static void addQuestFunction(std::string table,std::string name,lua_CFunction func);
static void addQuestTable(std::string table, tQuestTable);
static void addQuestTable(IQuest*);
static void removePRELOAD();
};
}
#endif // __LIBM2_LIBM2_HPP