feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -24,7 +24,7 @@ if env["builtin_enet"]:
|
|||
]
|
||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||
|
||||
env_enet.Prepend(CPPPATH=[thirdparty_dir])
|
||||
env_enet.Prepend(CPPEXTPATH=[thirdparty_dir])
|
||||
env_enet.Append(CPPDEFINES=["GODOT_ENET"])
|
||||
|
||||
env_thirdparty = env_enet.Clone()
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ Error ENetConnection::create_host(int p_max_peers, int p_max_channels, int p_in_
|
|||
|
||||
void ENetConnection::destroy() {
|
||||
ERR_FAIL_NULL_MSG(host, "Host already destroyed.");
|
||||
for (List<Ref<ENetPacketPeer>>::Element *E = peers.front(); E; E = E->next()) {
|
||||
E->get()->_on_disconnect();
|
||||
for (const Ref<ENetPacketPeer> &peer : peers) {
|
||||
peer->_on_disconnect();
|
||||
}
|
||||
peers.clear();
|
||||
enet_host_destroy(host);
|
||||
|
|
@ -320,14 +320,10 @@ Error ENetConnection::_create(ENetAddress *p_address, int p_max_peers, int p_max
|
|||
}
|
||||
|
||||
Array ENetConnection::_service(int p_timeout) {
|
||||
Array out;
|
||||
Event event;
|
||||
Ref<ENetPacketPeer> peer;
|
||||
EventType ret = service(p_timeout, event);
|
||||
out.push_back(ret);
|
||||
out.push_back(event.peer);
|
||||
out.push_back(event.data);
|
||||
out.push_back(event.channel_id);
|
||||
Array out = { ret, event.peer, event.data, event.channel_id };
|
||||
if (event.packet && event.peer.is_valid()) {
|
||||
event.peer->_queue_packet(event.packet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef ENET_CONNECTION_H
|
||||
#define ENET_CONNECTION_H
|
||||
#pragma once
|
||||
|
||||
#include "enet_packet_peer.h"
|
||||
|
||||
|
|
@ -140,5 +139,3 @@ public:
|
|||
VARIANT_ENUM_CAST(ENetConnection::CompressionMode);
|
||||
VARIANT_ENUM_CAST(ENetConnection::EventType);
|
||||
VARIANT_ENUM_CAST(ENetConnection::HostStatistic);
|
||||
|
||||
#endif // ENET_CONNECTION_H
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ Error ENetMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_si
|
|||
Error ENetMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
|
||||
ERR_FAIL_COND_V_MSG(!_is_active(), ERR_UNCONFIGURED, "The multiplayer instance isn't currently active.");
|
||||
ERR_FAIL_COND_V_MSG(connection_status != CONNECTION_CONNECTED, ERR_UNCONFIGURED, "The multiplayer instance isn't currently connected to any server or client.");
|
||||
ERR_FAIL_COND_V_MSG(target_peer != 0 && !peers.has(ABS(target_peer)), ERR_INVALID_PARAMETER, vformat("Invalid target peer: %d", target_peer));
|
||||
ERR_FAIL_COND_V_MSG(target_peer != 0 && !peers.has(Math::abs(target_peer)), ERR_INVALID_PARAMETER, vformat("Invalid target peer: %d", target_peer));
|
||||
ERR_FAIL_COND_V(active_mode == MODE_CLIENT && !peers.has(1), ERR_BUG);
|
||||
|
||||
int packet_flags = 0;
|
||||
|
|
@ -394,7 +394,7 @@ Error ENetMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size
|
|||
|
||||
} else {
|
||||
if (target_peer <= 0) {
|
||||
int exclude = ABS(target_peer);
|
||||
int exclude = Math::abs(target_peer);
|
||||
for (KeyValue<int, Ref<ENetPacketPeer>> &E : peers) {
|
||||
if (E.key == exclude) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef ENET_MULTIPLAYER_PEER_H
|
||||
#define ENET_MULTIPLAYER_PEER_H
|
||||
#pragma once
|
||||
|
||||
#include "enet_connection.h"
|
||||
|
||||
|
|
@ -132,5 +131,3 @@ public:
|
|||
ENetMultiplayerPeer();
|
||||
~ENetMultiplayerPeer();
|
||||
};
|
||||
|
||||
#endif // ENET_MULTIPLAYER_PEER_H
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef ENET_PACKET_PEER_H
|
||||
#define ENET_PACKET_PEER_H
|
||||
#pragma once
|
||||
|
||||
#include "core/io/packet_peer.h"
|
||||
|
||||
|
|
@ -128,5 +127,3 @@ public:
|
|||
|
||||
VARIANT_ENUM_CAST(ENetPacketPeer::PeerState);
|
||||
VARIANT_ENUM_CAST(ENetPacketPeer::PeerStatistic);
|
||||
|
||||
#endif // ENET_PACKET_PEER_H
|
||||
|
|
|
|||
|
|
@ -28,12 +28,9 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef ENET_REGISTER_TYPES_H
|
||||
#define ENET_REGISTER_TYPES_H
|
||||
#pragma once
|
||||
|
||||
#include "modules/register_module_types.h"
|
||||
|
||||
void initialize_enet_module(ModuleInitializationLevel p_level);
|
||||
void uninitialize_enet_module(ModuleInitializationLevel p_level);
|
||||
|
||||
#endif // ENET_REGISTER_TYPES_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue