]> git.lizzy.rs Git - dragonfireclient.git/blob - src/servercommand.h
Get rid of all the string format warnings caused by the DSTACK macro
[dragonfireclient.git] / src / servercommand.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2011 Ciaran Gultnieks <ciaran@ciarang.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef SERVERCOMMAND_HEADER
22 #define SERVERCOMMAND_HEADER
23
24 #include <vector>
25 #include <sstream>
26 #include "common_irrlicht.h"
27 #include "player.h"
28 #include "server.h"
29
30 struct ServerCommandContext
31 {
32
33         std::vector<std::wstring> parms;
34         Server* server;
35         ServerEnvironment *env;
36         Player* player;
37         // Effective privs for the player, which may be different to their
38         // stored ones - e.g. if they are named in the config as an admin.
39         u64 privs;
40         u32 flags;
41
42         ServerCommandContext(
43                 std::vector<std::wstring> parms,
44                 Server* server,
45                 ServerEnvironment *env,
46                 Player* player,
47                 u64 privs)
48                 : parms(parms), server(server), env(env), player(player), privs(privs)
49         {
50         }
51
52 };
53
54 // Process a command sent from a client. The environment and connection
55 // should be locked when this is called.
56 // Returns a response message, to be dealt with according to the flags set
57 // in the context.
58 std::wstring processServerCommand(ServerCommandContext *ctx);
59
60 #endif
61
62