summaryrefslogtreecommitdiff
path: root/modules/enet
diff options
context:
space:
mode:
Diffstat (limited to 'modules/enet')
-rw-r--r--modules/enet/SCsub4
-rw-r--r--modules/enet/doc_classes/NetworkedMultiplayerENet.xml20
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp7
-rw-r--r--modules/enet/networked_multiplayer_enet.h2
-rw-r--r--modules/enet/register_types.cpp1
-rw-r--r--modules/enet/register_types.h1
6 files changed, 18 insertions, 17 deletions
diff --git a/modules/enet/SCsub b/modules/enet/SCsub
index 4790c5099f..7caeafa1d6 100644
--- a/modules/enet/SCsub
+++ b/modules/enet/SCsub
@@ -3,10 +3,10 @@
Import('env')
Import('env_modules')
-# Thirdparty source files
-
env_enet = env_modules.Clone()
+# Thirdparty source files
+
if env['builtin_enet']:
thirdparty_dir = "#thirdparty/enet/"
thirdparty_sources = [
diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
index 25d17542ea..23ee327cc5 100644
--- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
+++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0-beta">
+<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0-stable">
<brief_description>
PacketPeer implementation using the ENet library.
</brief_description>
@@ -47,12 +47,6 @@
Create server that listens to connections via [code]port[/code].
</description>
</method>
- <method name="get_compression_mode" qualifiers="const">
- <return type="int" enum="NetworkedMultiplayerENet.CompressionMode">
- </return>
- <description>
- </description>
- </method>
<method name="set_bind_ip">
<return type="void">
</return>
@@ -61,15 +55,11 @@
<description>
</description>
</method>
- <method name="set_compression_mode">
- <return type="void">
- </return>
- <argument index="0" name="mode" type="int" enum="NetworkedMultiplayerENet.CompressionMode">
- </argument>
- <description>
- </description>
- </method>
</methods>
+ <members>
+ <member name="compression_mode" type="int" setter="set_compression_mode" getter="get_compression_mode" enum="NetworkedMultiplayerENet.CompressionMode">
+ </member>
+ </members>
<constants>
<constant name="COMPRESS_NONE" value="0" enum="CompressionMode">
</constant>
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index 2b5dd67938..f3f4acd768 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "networked_multiplayer_enet.h"
#include "io/marshalls.h"
#include "os/os.h"
@@ -35,6 +36,10 @@ void NetworkedMultiplayerENet::set_transfer_mode(TransferMode p_mode) {
transfer_mode = p_mode;
}
+NetworkedMultiplayerPeer::TransferMode NetworkedMultiplayerENet::get_transfer_mode() const {
+
+ return transfer_mode;
+}
void NetworkedMultiplayerENet::set_target_peer(int p_peer) {
@@ -658,6 +663,8 @@ void NetworkedMultiplayerENet::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_compression_mode"), &NetworkedMultiplayerENet::get_compression_mode);
ClassDB::bind_method(D_METHOD("set_bind_ip", "ip"), &NetworkedMultiplayerENet::set_bind_ip);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "compression_mode", PROPERTY_HINT_ENUM, "None,Range Coder,FastLZ,ZLib,ZStd"), "set_compression_mode", "get_compression_mode");
+
BIND_ENUM_CONSTANT(COMPRESS_NONE);
BIND_ENUM_CONSTANT(COMPRESS_RANGE_CODER);
BIND_ENUM_CONSTANT(COMPRESS_FASTLZ);
diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h
index d6644aed2d..440e9b5400 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef NETWORKED_MULTIPLAYER_ENET_H
#define NETWORKED_MULTIPLAYER_ENET_H
@@ -109,6 +110,7 @@ protected:
public:
virtual void set_transfer_mode(TransferMode p_mode);
+ virtual TransferMode get_transfer_mode() const;
virtual void set_target_peer(int p_peer);
virtual int get_packet_peer() const;
diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp
index 94d0eaa43f..cabaeb692a 100644
--- a/modules/enet/register_types.cpp
+++ b/modules/enet/register_types.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "register_types.h"
#include "error_macros.h"
#include "networked_multiplayer_enet.h"
diff --git a/modules/enet/register_types.h b/modules/enet/register_types.h
index 03cc2c8525..bcf0893ae4 100644
--- a/modules/enet/register_types.h
+++ b/modules/enet/register_types.h
@@ -27,5 +27,6 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
void register_enet_types();
void unregister_enet_types();