feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
Import("env")
Import("env_modules")
@ -12,7 +13,7 @@ thirdparty_obj = []
if env["builtin_enet"]:
thirdparty_dir = "#thirdparty/enet/"
thirdparty_sources = [
"godot.cpp",
"enet_godot.cpp",
"callbacks.c",
"compress.c",
"host.c",

View file

@ -18,6 +18,12 @@
Returns the number of channels allocated for communication with peer.
</description>
</method>
<method name="get_packet_flags" qualifiers="const">
<return type="int" />
<description>
Returns the ENet flags of the next packet in the received queue. See [code]FLAG_*[/code] constants for available packet flags. Note that not all flags are replicated from the sending peer to the receiving peer.
</description>
</method>
<method name="get_remote_address" qualifiers="const">
<return type="String" />
<description>

View file

@ -113,7 +113,7 @@ Ref<ENetPacketPeer> ENetConnection::connect_to_host(const String &p_address, int
if (peer == nullptr) {
return nullptr;
}
out = Ref<ENetPacketPeer>(memnew(ENetPacketPeer(peer)));
out.instantiate(peer);
peers.push_back(out);
return out;
}
@ -277,7 +277,7 @@ Error ENetConnection::dtls_server_setup(const Ref<TLSOptions> &p_options) {
#ifdef GODOT_ENET
ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
ERR_FAIL_COND_V(p_options.is_null() || !p_options->is_server(), ERR_INVALID_PARAMETER);
return enet_host_dtls_server_setup(host, const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
return enet_host_dtls_server_setup(host, p_options.ptr()) ? FAILED : OK;
#else
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "ENet DTLS support not available in this build.");
#endif
@ -296,7 +296,7 @@ Error ENetConnection::dtls_client_setup(const String &p_hostname, const Ref<TLSO
#ifdef GODOT_ENET
ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
ERR_FAIL_COND_V(p_options.is_null() || p_options->is_server(), ERR_INVALID_PARAMETER);
return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), p_options.ptr()) ? FAILED : OK;
#else
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "ENet DTLS support not available in this build.");
#endif

View file

@ -30,10 +30,6 @@
#include "enet_multiplayer_peer.h"
#include "core/io/ip.h"
#include "core/io/marshalls.h"
#include "core/os/os.h"
void ENetMultiplayerPeer::set_target_peer(int p_peer) {
target_peer = p_peer;
}
@ -305,6 +301,7 @@ void ENetMultiplayerPeer::close() {
}
for (KeyValue<int, Ref<ENetConnection>> &E : hosts) {
E.value->flush();
E.value->destroy();
}
active_mode = MODE_NONE;

View file

@ -175,6 +175,11 @@ int ENetPacketPeer::get_channels() const {
return peer->channelCount;
}
int ENetPacketPeer::get_packet_flags() const {
ERR_FAIL_COND_V(packet_queue.is_empty(), 0);
return packet_queue.front()->get()->flags;
}
void ENetPacketPeer::_on_disconnect() {
if (peer) {
peer->data = nullptr;
@ -206,6 +211,7 @@ void ENetPacketPeer::_bind_methods() {
ClassDB::bind_method(D_METHOD("send", "channel", "packet", "flags"), &ENetPacketPeer::_send);
ClassDB::bind_method(D_METHOD("throttle_configure", "interval", "acceleration", "deceleration"), &ENetPacketPeer::throttle_configure);
ClassDB::bind_method(D_METHOD("set_timeout", "timeout", "timeout_min", "timeout_max"), &ENetPacketPeer::set_timeout);
ClassDB::bind_method(D_METHOD("get_packet_flags"), &ENetPacketPeer::get_packet_flags);
ClassDB::bind_method(D_METHOD("get_remote_address"), &ENetPacketPeer::get_remote_address);
ClassDB::bind_method(D_METHOD("get_remote_port"), &ENetPacketPeer::get_remote_port);
ClassDB::bind_method(D_METHOD("get_statistic", "statistic"), &ENetPacketPeer::get_statistic);

View file

@ -113,6 +113,7 @@ public:
double get_statistic(PeerStatistic p_stat);
PeerState get_state() const;
int get_channels() const;
int get_packet_flags() const;
// Extras
IPAddress get_remote_address() const;