| 136 | } |
| 137 | |
| 138 | void 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 | |
| 154 | void 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(); |
no test coverage detected