/***************************************************************************** * Copyright (c) 2014-2023 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ #pragma once #ifdef ENABLE_SCRIPTING # include "../../Duktape.hpp" # include "ScPlayer.hpp" # include "ScPlayerGroup.hpp" # include "ScSocket.hpp" # include namespace OpenRCT2::Scripting { class ScNetwork { private: # ifdef __clang__ [[maybe_unused]] # endif duk_context* _context; public: ScNetwork(duk_context* ctx); std::string mode_get() const; int32_t numPlayers_get() const; int32_t numGroups_get() const; int32_t defaultGroup_get() const; void defaultGroup_set(int32_t value); std::vector> groups_get() const; std::vector> players_get() const; std::shared_ptr currentPlayer_get() const; std::shared_ptr getPlayer(int32_t index) const; DukValue stats_get() const; std::shared_ptr getGroup(int32_t index) const; void addGroup(); void removeGroup(int32_t index); void kickPlayer(int32_t index); void sendMessage(std::string message, DukValue players); # ifndef DISABLE_NETWORK std::shared_ptr createListener(); # else void createListener(); # endif # ifndef DISABLE_NETWORK std::shared_ptr createSocket(); # else void createSocket(); # endif static void Register(duk_context* ctx); }; } // namespace OpenRCT2::Scripting #endif