summaryrefslogtreecommitdiff
path: root/modules/enet/networked_multiplayer_enet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/enet/networked_multiplayer_enet.cpp')
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index c05c86d9ae..738bd27ed3 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -575,6 +575,9 @@ size_t NetworkedMultiplayerENet::enet_compress(void *context, const ENetBuffer *
case COMPRESS_ZLIB: {
mode = Compression::MODE_DEFLATE;
} break;
+ case COMPRESS_ZSTD: {
+ mode = Compression::MODE_ZSTD;
+ } break;
default: { ERR_FAIL_V(0); }
}
@@ -608,6 +611,10 @@ size_t NetworkedMultiplayerENet::enet_decompress(void *context, const enet_uint8
ret = Compression::decompress(outData, outLimit, inData, inLimit, Compression::MODE_DEFLATE);
} break;
+ case COMPRESS_ZSTD: {
+
+ ret = Compression::decompress(outData, outLimit, inData, inLimit, Compression::MODE_ZSTD);
+ } break;
default: {}
}
if (ret < 0) {
@@ -629,7 +636,8 @@ void NetworkedMultiplayerENet::_setup_compressor() {
enet_host_compress_with_range_coder(host);
} break;
case COMPRESS_FASTLZ:
- case COMPRESS_ZLIB: {
+ case COMPRESS_ZLIB:
+ case COMPRESS_ZSTD: {
enet_host_compress(host, &enet_compressor);
} break;
@@ -654,6 +662,7 @@ void NetworkedMultiplayerENet::_bind_methods() {
BIND_CONSTANT(COMPRESS_RANGE_CODER);
BIND_CONSTANT(COMPRESS_FASTLZ);
BIND_CONSTANT(COMPRESS_ZLIB);
+ BIND_CONSTANT(COMPRESS_ZSTD);
}
NetworkedMultiplayerENet::NetworkedMultiplayerENet() {