class_networkedmultiplayerenet.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the NetworkedMultiplayerENet.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_NetworkedMultiplayerENet:
  5. NetworkedMultiplayerENet
  6. ========================
  7. **Inherits:** :ref:`NetworkedMultiplayerPeer<class_networkedmultiplayerpeer>` **<** :ref:`PacketPeer<class_packetpeer>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. PacketPeer implementation using the ENet library.
  12. Member Functions
  13. ----------------
  14. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`close_connection<class_NetworkedMultiplayerENet_close_connection>` **(** **)** |
  16. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`create_client<class_NetworkedMultiplayerENet_create_client>` **(** :ref:`String<class_string>` ip, :ref:`int<class_int>` port, :ref:`int<class_int>` in_bandwidth=0, :ref:`int<class_int>` out_bandwidth=0 **)** |
  18. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`create_server<class_NetworkedMultiplayerENet_create_server>` **(** :ref:`int<class_int>` port, :ref:`int<class_int>` max_clients=32, :ref:`int<class_int>` in_bandwidth=0, :ref:`int<class_int>` out_bandwidth=0 **)** |
  20. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_compression_mode<class_NetworkedMultiplayerENet_get_compression_mode>` **(** **)** const |
  22. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_bind_ip<class_NetworkedMultiplayerENet_set_bind_ip>` **(** :ref:`String<class_string>` ip **)** |
  24. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_compression_mode<class_NetworkedMultiplayerENet_set_compression_mode>` **(** :ref:`int<class_int>` mode **)** |
  26. +------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. Numeric Constants
  28. -----------------
  29. - **COMPRESS_NONE** = **0**
  30. - **COMPRESS_RANGE_CODER** = **1**
  31. - **COMPRESS_FASTLZ** = **2**
  32. - **COMPRESS_ZLIB** = **3**
  33. - **COMPRESS_ZSTD** = **4**
  34. Description
  35. -----------
  36. A connection (or a listening server) that should be passed to :ref:`SceneTree.set_network_peer<class_SceneTree_set_network_peer>`. Socket events can be handled by connecting to :ref:`SceneTree<class_scenetree>` signals.
  37. Member Function Description
  38. ---------------------------
  39. .. _class_NetworkedMultiplayerENet_close_connection:
  40. - void **close_connection** **(** **)**
  41. .. _class_NetworkedMultiplayerENet_create_client:
  42. - :ref:`int<class_int>` **create_client** **(** :ref:`String<class_string>` ip, :ref:`int<class_int>` port, :ref:`int<class_int>` in_bandwidth=0, :ref:`int<class_int>` out_bandwidth=0 **)**
  43. Create client that connects to a server at address ``ip`` using specified ``port``.
  44. .. _class_NetworkedMultiplayerENet_create_server:
  45. - :ref:`int<class_int>` **create_server** **(** :ref:`int<class_int>` port, :ref:`int<class_int>` max_clients=32, :ref:`int<class_int>` in_bandwidth=0, :ref:`int<class_int>` out_bandwidth=0 **)**
  46. Create server that listens to connections via ``port``.
  47. .. _class_NetworkedMultiplayerENet_get_compression_mode:
  48. - :ref:`int<class_int>` **get_compression_mode** **(** **)** const
  49. .. _class_NetworkedMultiplayerENet_set_bind_ip:
  50. - void **set_bind_ip** **(** :ref:`String<class_string>` ip **)**
  51. .. _class_NetworkedMultiplayerENet_set_compression_mode:
  52. - void **set_compression_mode** **(** :ref:`int<class_int>` mode **)**