/* core/core.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2. */ #include #include #include "core/core.h" #include "core/netclient.h" namespace core { GameInterface *game() { return GameInterface::instance(); } Application *application() { return Application::instance(); } void net_broadcast(std::ostringstream &osstream, int ignoreplayer) { if (!application()->netserver) return; application()->netserver->broadcast(osstream, ignoreplayer); } void net_send(Player &player, std::ostringstream &osstream) { if (!application()->netserver) return; NetClient *client = application()->netserver->find_client(player); if (client) application()->netserver->send(client, osstream); } void net_send(Player &player, std::string message) { if (!application()->netserver) return; NetClient *client = application()->netserver->find_client(player); if (client) application()->netserver->send(client, message); } }