| 70 | } |
| 71 | |
| 72 | Error MultiplayerDebugger::_capture(void *p_user, const String &p_msg, const Array &p_args, bool &r_captured) { |
| 73 | if (p_msg == "cache") { |
| 74 | Array out; |
| 75 | for (int i = 0; i < p_args.size(); i++) { |
| 76 | ObjectID id = p_args[i].operator ObjectID(); |
| 77 | Object *obj = ObjectDB::get_instance(id); |
| 78 | ERR_CONTINUE(!obj); |
| 79 | if (Object::cast_to<SceneReplicationConfig>(obj)) { |
| 80 | out.push_back(id); |
| 81 | out.push_back(obj->get_class()); |
| 82 | out.push_back(((SceneReplicationConfig *)obj)->get_path()); |
| 83 | } else if (Object::cast_to<Node>(obj)) { |
| 84 | out.push_back(id); |
| 85 | out.push_back(obj->get_class()); |
| 86 | out.push_back(String(((Node *)obj)->get_path())); |
| 87 | } else { |
| 88 | ERR_FAIL_V(FAILED); |
| 89 | } |
| 90 | } |
| 91 | EngineDebugger::get_singleton()->send_message("multiplayer:cache", out); |
| 92 | return OK; |
| 93 | } |
| 94 | ERR_FAIL_V(FAILED); |
| 95 | } |
| 96 | |
| 97 | // BandwidthProfiler |
| 98 | |