106 lines
3.6 KiB
C++
106 lines
3.6 KiB
C++
|
/*
|
||
|
Library to present all functions of NetworkConnectionCore (network)
|
||
|
|
||
|
Copyright (C) 2019 AleaJactaEst
|
||
|
|
||
|
This program 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, either version 3 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program 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. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
*/
|
||
|
|
||
|
#include "network_connection.h"
|
||
|
#include "network_connection_core.h"
|
||
|
|
||
|
void NetworkConnection::_bind_methods()
|
||
|
{
|
||
|
ClassDB::bind_method(D_METHOD("define_checksum_msg_xml", "checksum_msg_xml"), &NetworkConnection::define_checksum_msg_xml);
|
||
|
ClassDB::bind_method(D_METHOD("define_server", "host", "port"), &NetworkConnection::define_server);
|
||
|
ClassDB::bind_method(D_METHOD("define_user", "user_addr", "user_key", "user_id"), &NetworkConnection::define_user);
|
||
|
ClassDB::bind_method(D_METHOD("define_lang", "lang"), &NetworkConnection::define_lang);
|
||
|
ClassDB::bind_method(D_METHOD("send_system_login"), &NetworkConnection::send_system_login);
|
||
|
ClassDB::bind_method(D_METHOD("send_system_disconnect"), &NetworkConnection::send_system_disconnect);
|
||
|
ClassDB::bind_method(D_METHOD("send_system_quit"), &NetworkConnection::send_system_quit);
|
||
|
ClassDB::bind_method(D_METHOD("disconnect_server"), &NetworkConnection::disconnect_server);
|
||
|
ClassDB::bind_method(D_METHOD("process", "delta"), &NetworkConnection::process);
|
||
|
ClassDB::bind_method(D_METHOD("get_state"), &NetworkConnection::get_state);
|
||
|
//ClassDB::bind_method(D_METHOD("get_master_message_description_node"), &NetworkConnection::get_master_message_description_node);
|
||
|
}
|
||
|
|
||
|
NetworkConnection::NetworkConnection()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
NetworkConnection::~NetworkConnection()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
int NetworkConnection::get_state()
|
||
|
{
|
||
|
return NetworkConnectionCore::get_singleton()->get_state();
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::define_checksum_msg_xml(Array checksum_msg_xml)
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->define_checksum_msg_xml(checksum_msg_xml);
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::define_server(String host, int64_t port)
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->define_server(host, port);
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::define_user(String user_addr, String user_key, String user_id)
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->define_user(user_addr, user_key, user_id);
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::define_lang(String lang)
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->define_lang(lang);
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::send_system_login()
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->send_system_login();
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::send_system_disconnect()
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->send_system_disconnect();
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::send_system_quit()
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->send_system_quit();
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::disconnect_server()
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->disconnect_server();
|
||
|
}
|
||
|
|
||
|
void NetworkConnection::process(int delta)
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->process(delta);
|
||
|
}
|
||
|
/*
|
||
|
MessageDescriptionNode & NetworkConnection::get_master_message_description_node()
|
||
|
{
|
||
|
return NetworkConnectionCore::get_singleton()->get_master_message_description_node();
|
||
|
}
|
||
|
*/
|
||
|
void terminate_network_connection()
|
||
|
{
|
||
|
NetworkConnectionCore::get_singleton()->terminate_connexion();
|
||
|
}
|