summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/multiplayer_api.cpp5
-rw-r--r--core/message_queue.cpp10
-rw-r--r--core/message_queue.h4
-rw-r--r--core/object.h1
-rw-r--r--core/project_settings.cpp2
5 files changed, 20 insertions, 2 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 30c5bfcaa7..7680d47620 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -122,6 +122,7 @@ void MultiplayerAPI::clear() {
connected_peers.clear();
path_get_cache.clear();
path_send_cache.clear();
+ packet_cache.clear();
last_send_cache_id = 1;
}
@@ -131,6 +132,8 @@ void MultiplayerAPI::set_root_node(Node *p_node) {
void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_peer) {
+ if (p_peer == network_peer) return; // Nothing to do
+
if (network_peer.is_valid()) {
network_peer->disconnect("peer_connected", this, "_add_peer");
network_peer->disconnect("peer_disconnected", this, "_del_peer");
@@ -857,6 +860,8 @@ void MultiplayerAPI::_bind_methods() {
}
MultiplayerAPI::MultiplayerAPI() {
+ rpc_sender_id = 0;
+ root_node = NULL;
clear();
}
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index 7c3bdfec53..c57bd4081c 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -271,6 +271,9 @@ void MessageQueue::flush() {
//using reverse locking strategy
_THREAD_SAFE_LOCK_
+ ERR_FAIL_COND(flushing); //already flushing, you did something odd
+ flushing = true;
+
while (read_pos < buffer_end) {
//lock on each iteration, so a call can re-add itself to the message queue
@@ -327,13 +330,20 @@ void MessageQueue::flush() {
}
buffer_end = 0; // reset buffer
+ flushing = false;
_THREAD_SAFE_UNLOCK_
}
+bool MessageQueue::is_flushing() const {
+
+ return flushing;
+}
+
MessageQueue::MessageQueue() {
ERR_FAIL_COND(singleton != NULL);
singleton = this;
+ flushing = false;
buffer_end = 0;
buffer_max_used = 0;
diff --git a/core/message_queue.h b/core/message_queue.h
index 696b8e2997..2515eb4a98 100644
--- a/core/message_queue.h
+++ b/core/message_queue.h
@@ -72,6 +72,8 @@ class MessageQueue {
static MessageQueue *singleton;
+ bool flushing;
+
public:
static MessageQueue *get_singleton();
@@ -87,6 +89,8 @@ public:
void statistics();
void flush();
+ bool is_flushing() const;
+
int get_max_buffer_usage() const;
MessageQueue();
diff --git a/core/object.h b/core/object.h
index 434cca0fec..a5bb6dea5d 100644
--- a/core/object.h
+++ b/core/object.h
@@ -118,6 +118,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_INTERNAL = 1 << 20,
PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE = 1 << 21, // If the object is duplicated also this property will be duplicated
PROPERTY_USAGE_HIGH_END_GFX = 1 << 22,
+ PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 23,
PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK,
PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED,
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index e325c828b8..8d05d7cc74 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -1163,8 +1163,6 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("input/ui_end", action);
input_presets.push_back("input/ui_end");
- //GLOBAL_DEF("display/window/handheld/orientation", "landscape");
-
custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::STRING, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor");
custom_prop_info["rendering/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
custom_prop_info["physics/2d/thread_model"] = PropertyInfo(Variant::INT, "physics/2d/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");