MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / add

Method add

modules/multiplayer/multiplayer_debugger.cpp:138–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void MultiplayerDebugger::BandwidthProfiler::add(const Array &p_data) {
139 ERR_FAIL_COND(p_data.size() < 3);
140 const String inout = p_data[0];
141 int time = p_data[1];
142 int size = p_data[2];
143 if (inout == "in") {
144 bandwidth_in.write[bandwidth_in_ptr].timestamp = time;
145 bandwidth_in.write[bandwidth_in_ptr].packet_size = size;
146 bandwidth_in_ptr = (bandwidth_in_ptr + 1) % bandwidth_in.size();
147 } else if (inout == "out") {
148 bandwidth_out.write[bandwidth_out_ptr].timestamp = time;
149 bandwidth_out.write[bandwidth_out_ptr].packet_size = size;
150 bandwidth_out_ptr = (bandwidth_out_ptr + 1) % bandwidth_out.size();
151 }
152}
153
154void MultiplayerDebugger::BandwidthProfiler::tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time) {
155 uint64_t pt = OS::get_singleton()->get_ticks_msec();

Calls 3

SyncInfoClass · 0.85
sizeMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected