feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -150,9 +150,7 @@ void MultiplayerDebugger::BandwidthProfiler::tick(double p_frame_time, double p_
int incoming_bandwidth = bandwidth_usage(bandwidth_in, bandwidth_in_ptr);
int outgoing_bandwidth = bandwidth_usage(bandwidth_out, bandwidth_out_ptr);
Array arr;
arr.push_back(incoming_bandwidth);
arr.push_back(outgoing_bandwidth);
Array arr = { incoming_bandwidth, outgoing_bandwidth };
EngineDebugger::get_singleton()->send_message("multiplayer:bandwidth", arr);
}
}
@ -160,8 +158,7 @@ void MultiplayerDebugger::BandwidthProfiler::tick(double p_frame_time, double p_
// RPCProfiler
Array MultiplayerDebugger::RPCFrame::serialize() {
Array arr;
arr.push_back(infos.size() * 6);
Array arr = { infos.size() * 6 };
for (int i = 0; i < infos.size(); ++i) {
arr.push_back(uint64_t(infos[i].node));
arr.push_back(infos[i].node_path);
@ -198,7 +195,7 @@ void MultiplayerDebugger::RPCProfiler::init_node(const ObjectID p_node) {
}
rpc_node_data.insert(p_node, RPCNodeInfo());
rpc_node_data[p_node].node = p_node;
rpc_node_data[p_node].node_path = Object::cast_to<Node>(ObjectDB::get_instance(p_node))->get_path();
rpc_node_data[p_node].node_path = ObjectDB::get_instance<Node>(p_node)->get_path();
}
void MultiplayerDebugger::RPCProfiler::toggle(bool p_enable, const Array &p_opts) {
@ -270,8 +267,7 @@ bool MultiplayerDebugger::SyncInfo::read_from_array(const Array &p_arr, int p_of
}
Array MultiplayerDebugger::ReplicationFrame::serialize() {
Array arr;
arr.push_back(infos.size() * 7);
Array arr = { infos.size() * 7 };
for (const KeyValue<ObjectID, SyncInfo> &E : infos) {
E.value.write_to_array(arr);
}
@ -304,7 +300,7 @@ void MultiplayerDebugger::ReplicationProfiler::add(const Array &p_data) {
const String what = p_data[0];
const ObjectID id = p_data[1];
const uint64_t size = p_data[2];
MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(ObjectDB::get_instance(id));
MultiplayerSynchronizer *sync = ObjectDB::get_instance<MultiplayerSynchronizer>(id);
ERR_FAIL_NULL(sync);
if (!sync_data.has(id)) {
sync_data[id] = SyncInfo(sync);