MCPcopy Create free account
hub / github.com/crownengine/crown / console_command_refresh_list

Function console_command_refresh_list

src/resource/data_compiler.cpp:232–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void console_command_refresh_list(ConsoleServer &cs, u32 client_id, const char *json, void *user_data)
233{
234 DataCompiler *dc = (DataCompiler *)user_data;
235
236 TempAllocator4096 ta;
237 StringStream ss(ta);
238 JsonObject obj(ta);
239 sjson::parse(obj, json);
240
241 const u32 revision = (u32)sjson::parse_int(obj["revision"]);
242
243 ss << "{\"type\":\"refresh_list\",\"list\":[";
244 auto cur = hash_map::begin(dc->_data_revisions);
245 auto end = hash_map::end(dc->_data_revisions);
246 for (; cur != end; ++cur) {
247 HASH_MAP_SKIP_HOLE(dc->_data_revisions, cur);
248
249 DynamicString deffault(ta);
250 if (cur->second > revision) {
251 ss << "\"";
252 ss << hash_map::get(dc->_data_index, cur->first, deffault).c_str();
253 ss << "\",";
254 }
255 }
256 ss << "]}";
257
258 cs.send(client_id, string_stream::c_str(ss));
259}
260
261static void parse_data_versions(HashMap<StringId64, u32> &versions
262 , Buffer &json

Callers

nothing calls this directly

Calls 7

getFunction · 0.85
sendMethod · 0.80
parseFunction · 0.70
parse_intFunction · 0.50
beginFunction · 0.50
endFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected