2016-08-02 22:11:05 +00:00
|
|
|
#include "networked_multiplayer_peer.h"
|
|
|
|
|
|
|
|
|
|
|
|
void NetworkedMultiplayerPeer::_bind_methods() {
|
|
|
|
|
2017-01-03 02:03:46 +00:00
|
|
|
ClassDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode );
|
|
|
|
ClassDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer );
|
2016-08-02 22:11:05 +00:00
|
|
|
|
2017-01-03 02:03:46 +00:00
|
|
|
ClassDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer );
|
2016-08-02 22:11:05 +00:00
|
|
|
|
2017-01-03 02:03:46 +00:00
|
|
|
ClassDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll );
|
2016-08-02 22:11:05 +00:00
|
|
|
|
2017-01-03 02:03:46 +00:00
|
|
|
ClassDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status );
|
|
|
|
ClassDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id );
|
2016-08-19 19:48:08 +00:00
|
|
|
|
2017-01-03 02:03:46 +00:00
|
|
|
ClassDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections );
|
|
|
|
ClassDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections );
|
2016-08-02 22:11:05 +00:00
|
|
|
|
|
|
|
BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE );
|
2016-08-20 01:54:02 +00:00
|
|
|
BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE_ORDERED );
|
2016-08-02 22:11:05 +00:00
|
|
|
BIND_CONSTANT( TRANSFER_MODE_RELIABLE );
|
|
|
|
|
2016-08-14 17:06:51 +00:00
|
|
|
BIND_CONSTANT( CONNECTION_DISCONNECTED );
|
|
|
|
BIND_CONSTANT( CONNECTION_CONNECTING );
|
|
|
|
BIND_CONSTANT( CONNECTION_CONNECTED );
|
|
|
|
|
2016-08-19 19:48:08 +00:00
|
|
|
BIND_CONSTANT( TARGET_PEER_BROADCAST );
|
|
|
|
BIND_CONSTANT( TARGET_PEER_SERVER );
|
|
|
|
|
|
|
|
|
|
|
|
ADD_SIGNAL( MethodInfo("peer_connected",PropertyInfo(Variant::INT,"id")));
|
|
|
|
ADD_SIGNAL( MethodInfo("peer_disconnected",PropertyInfo(Variant::INT,"id")));
|
|
|
|
ADD_SIGNAL( MethodInfo("server_disconnected"));
|
|
|
|
ADD_SIGNAL( MethodInfo("connection_succeeded") );
|
|
|
|
ADD_SIGNAL( MethodInfo("connection_failed") );
|
2016-08-02 22:11:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NetworkedMultiplayerPeer::NetworkedMultiplayerPeer() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|