MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / save_internal

Method save_internal

launcher/ui/pages/instance/ServersPage.cpp:509–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507
508private slots:
509 void save_internal()
510 {
511 cancelSave();
512 QString path = serversPath();
513 qDebug() << "Server list about to be saved to" << path;
514
515 nbt::tag_compound out;
516 nbt::tag_list list;
517 for(auto & server: m_servers)
518 {
519 nbt::tag_compound serverNbt;
520 server.serialize(serverNbt);
521 list.push_back(std::move(serverNbt));
522 }
523 out.insert("servers", nbt::value(std::move(list)));
524
525 if(!serializeServerDat(path, &out))
526 {
527 qDebug() << "Failed to save server list:" << path << "Will try again.";
528 scheduleSave();
529 }
530 }
531
532private:
533 void scheduleSave()

Callers

nothing calls this directly

Calls 3

serializeServerDatFunction · 0.85
insertMethod · 0.80
serializeMethod · 0.45

Tested by

no test coverage detected