Update: Translations from eints
[openttd-github.git] / src / script / api / script_admin.hpp
blobb168b3423bc206fe800c80596411dffcf145298b
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD 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, version 2.
4 * OpenTTD 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.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file script_admin.hpp Everything to communicate with the AdminPort. */
10 #ifndef SCRIPT_ADMIN_HPP
11 #define SCRIPT_ADMIN_HPP
13 #include "script_object.hpp"
15 /**
16 * Class that handles communication with the AdminPort.
17 * @api game
19 class ScriptAdmin : public ScriptObject {
20 public:
21 #ifndef DOXYGEN_API
22 /**
23 * Internal representation of the Send function.
25 static SQInteger Send(HSQUIRRELVM vm);
26 #else
27 /**
28 * Send information to the AdminPort. The information can be anything
29 * as long as it isn't a class or instance thereof.
30 * @param data The information to send, in a table. For example: { param = "param" }.
31 * @return True if and only if the data was successfully converted to JSON
32 * and send to the AdminPort.
33 * @note If the resulting JSON of your table is larger than 1450 bytes,
34 * nothing will be sent (and false will be returned).
36 static bool Send(table data);
37 #endif /* DOXYGEN_API */
40 #endif /* SCRIPT_ADMIN_HPP */