2017-12-21 02:13:23 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* register_types.cpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
2017-12-21 02:47:16 +00:00
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
2017-12-21 02:13:23 +00:00
|
|
|
/*************************************************************************/
|
2020-01-01 10:16:22 +00:00
|
|
|
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
2017-12-21 02:13:23 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2019-01-01 11:46:36 +00:00
|
|
|
|
2017-12-21 02:13:23 +00:00
|
|
|
#include "register_types.h"
|
2018-09-11 16:13:45 +00:00
|
|
|
#include "core/error_macros.h"
|
2018-11-03 04:46:38 +00:00
|
|
|
#include "core/project_settings.h"
|
2017-12-21 02:13:23 +00:00
|
|
|
#ifdef JAVASCRIPT_ENABLED
|
|
|
|
#include "emscripten.h"
|
|
|
|
#include "emws_client.h"
|
|
|
|
#include "emws_peer.h"
|
|
|
|
#include "emws_server.h"
|
|
|
|
#else
|
2019-06-24 13:46:24 +00:00
|
|
|
#include "wsl_client.h"
|
|
|
|
#include "wsl_server.h"
|
2017-12-21 02:13:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void register_websocket_types() {
|
|
|
|
#ifdef JAVASCRIPT_ENABLED
|
|
|
|
EMWSPeer::make_default();
|
|
|
|
EMWSClient::make_default();
|
|
|
|
EMWSServer::make_default();
|
|
|
|
#else
|
2019-07-01 16:14:26 +00:00
|
|
|
WSLPeer::make_default();
|
2019-06-24 13:46:24 +00:00
|
|
|
WSLClient::make_default();
|
|
|
|
WSLServer::make_default();
|
2017-12-21 02:13:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
ClassDB::register_virtual_class<WebSocketMultiplayerPeer>();
|
|
|
|
ClassDB::register_custom_instance_class<WebSocketServer>();
|
|
|
|
ClassDB::register_custom_instance_class<WebSocketClient>();
|
|
|
|
ClassDB::register_custom_instance_class<WebSocketPeer>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void unregister_websocket_types() {}
|