networked_multiplayer_peer.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "networked_multiplayer_peer.h"
  2. void NetworkedMultiplayerPeer::_bind_methods() {
  3. ClassDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode );
  4. ClassDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer );
  5. ClassDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer );
  6. ClassDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll );
  7. ClassDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status );
  8. ClassDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id );
  9. ClassDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections );
  10. ClassDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections );
  11. BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE );
  12. BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE_ORDERED );
  13. BIND_CONSTANT( TRANSFER_MODE_RELIABLE );
  14. BIND_CONSTANT( CONNECTION_DISCONNECTED );
  15. BIND_CONSTANT( CONNECTION_CONNECTING );
  16. BIND_CONSTANT( CONNECTION_CONNECTED );
  17. BIND_CONSTANT( TARGET_PEER_BROADCAST );
  18. BIND_CONSTANT( TARGET_PEER_SERVER );
  19. ADD_SIGNAL( MethodInfo("peer_connected",PropertyInfo(Variant::INT,"id")));
  20. ADD_SIGNAL( MethodInfo("peer_disconnected",PropertyInfo(Variant::INT,"id")));
  21. ADD_SIGNAL( MethodInfo("server_disconnected"));
  22. ADD_SIGNAL( MethodInfo("connection_succeeded") );
  23. ADD_SIGNAL( MethodInfo("connection_failed") );
  24. }
  25. NetworkedMultiplayerPeer::NetworkedMultiplayerPeer() {
  26. }