forked from otland/tfs-old-svn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.h
112 lines (97 loc) · 5.07 KB
/
commands.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#ifndef __OTSERV_COMMANDS_H__
#define __OTSERV_COMMANDS_H__
#include <string>
#include <map>
#include "creature.h"
struct Command;
struct s_defcommands;
class Commands
{
public:
Commands();
bool loadFromXml();
bool reload();
bool exeCommand(Creature* creature, const std::string& cmd);
protected:
bool loaded;
//commands
void placeNpc(Player* player, const std::string& cmd, const std::string& param);
void placeMonster(Player* player, const std::string& cmd, const std::string& param);
void placeSummon(Player* player, const std::string& cmd, const std::string& param);
void broadcastMessage(Player* player, const std::string& cmd, const std::string& param);
void banPlayer(Player* player, const std::string& cmd, const std::string& param);
void teleportMasterPos(Player* player, const std::string& cmd, const std::string& param);
void teleportHere(Player* player, const std::string& cmd, const std::string& param);
void teleportToTown(Player* player, const std::string& cmd, const std::string& param);
void teleportTo(Player* player, const std::string& cmd, const std::string& param);
void createItemById(Player* player, const std::string& cmd, const std::string& param);
void createItemByName(Player* player, const std::string& cmd, const std::string& param);
void subtractMoney(Player* player, const std::string& cmd, const std::string& param);
void reloadInfo(Player* player, const std::string& cmd, const std::string& param);
void getInfo(Player* player, const std::string& cmd, const std::string& param);
void closeServer(Player* player, const std::string& cmd, const std::string& param);
void openServer(Player* player, const std::string& cmd, const std::string& param);
void teleportNTiles(Player* player, const std::string& cmd, const std::string& param);
void kickPlayer(Player* player, const std::string& cmd, const std::string& param);
void setHouseOwner(Player* player, const std::string& cmd, const std::string& param);
void sellHouse(Player* player, const std::string& cmd, const std::string& param);
void getHouse(Player* player, const std::string& cmd, const std::string& param);
void serverInfo(Player* player, const std::string& cmd, const std::string& param);
void changeFloor(Player* player, const std::string& cmd, const std::string& param);
void whoIsOnline(Player* player, const std::string& cmd, const std::string& param);
void showPosition(Player* player, const std::string& cmd, const std::string& param);
void removeThing(Player* player, const std::string& cmd, const std::string& param);
void buyHouse(Player* player, const std::string& cmd, const std::string& param);
void newType(Player* player, const std::string& cmd, const std::string& param);
void forceRaid(Player* player, const std::string& cmd, const std::string& param);
void addSkill(Player* player, const std::string& cmd, const std::string& param);
void playerKills(Player* player, const std::string& cmd, const std::string& param);
void ban(Player* player, const std::string& cmd, const std::string& param);
void unban(Player* player, const std::string& cmd, const std::string& param);
void joinGuild(Player* player, const std::string& cmd, const std::string& param);
void createGuild(Player* player, const std::string& cmd, const std::string& param);
void clean(Player* player, const std::string& cmd, const std::string& param);
void serverDiag(Player* player, const std::string& cmd, const std::string& param);
void ghost(Player* player, const std::string& cmd, const std::string& param);
void multiClientCheck(Player* player, const std::string& cmd, const std::string& param);
//table of commands
static s_defcommands defined_commands[];
typedef std::map<std::string, Command*> CommandMap;
CommandMap commandMap;
};
typedef void (Commands::*CommandFunc)(Player*, const std::string&, const std::string&);
struct Command
{
CommandFunc f;
int32_t groupId;
AccountType_t accountType;
bool loadedGroupId;
bool loadedAccountType;
bool logged;
bool loadedLogging;
};
struct s_defcommands
{
const char *name;
CommandFunc f;
};
#endif