aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Expand)AuthorAge
...
* On-demand item meshes and texturesPerttu Ahola2012-12-02
* Modify some client log message levelsPerttu Ahola2012-12-02
* New elements in formspec, item_image and item_image_button.RealBadAngel2012-12-01
* Merge support for anaglyph stereoPilzAdam2012-12-01
|\
| * Default anaglyph to 0.1MirceaKitsune2012-11-13
| * Anaglyph stereo support, created by xyzMirceaKitsune2012-11-13
* | Add the ability for client to check if image existsPerttu Ahola2012-11-30
* | Make dragged itemstack following the mouse cursor much smootherJürgen Doser2012-11-30
* | Ignore directories beginning with a "." when searching for modsMatthew I2012-11-30
* | Run scriptapi_on_shutdown() thread-safely and remove some old crapPerttu Ahola2012-11-30
* | Add shutdown hook interface to Lua APIMatthew I2012-11-30
* | Add congestion control settings to minetest.confPerttu Ahola2012-11-29
* | Full protocol 13 compatibility on server sidePerttu Ahola2012-11-29
* | Make strict and non-strict protocol version checking to work more like expectedPerttu Ahola2012-11-29
* | Allow server to accept protocol 13 clients altough they don't work too wellPerttu Ahola2012-11-29
* | Ranged support of protocol version on server sidePerttu Ahola2012-11-29
* | Support serialization of protocol 13 ContentFeaturesPerttu Ahola2012-11-29
* | unit test: TestNodedefSerializationPerttu Ahola2012-11-29
* | Modify new ObjectProperties format to such that 0.4.3 will eat itPerttu Ahola2012-11-29
* | Fix Taoki's messed up generic object command idsPerttu Ahola2012-11-29
* | Fix head shifting downards in glass, nodeboxes...Calinou2012-11-28
* | Fix mesh glitches on MapBlock boundariesPerttu Ahola2012-11-27
* | Fix forgotten material properties for meshes (also seems to have been forgott...MirceaKitsune2012-11-27
* | Default server step to 0.1s and sync object/player update intervals to itPerttu Ahola2012-11-26
* | Remove unnecessary util/serialize.h from content_mapblock.cppPerttu Ahola2012-11-26
* | Const-correct SharedBuffer::SharedBuffer(const T *t, unsigned int size)Perttu Ahola2012-11-26
* | Move util/serialize.h out from staticobject.h for smaller header dependenciesPerttu Ahola2012-11-26
* | Move a function from clientserver.h to clientserver.cppPerttu Ahola2012-11-26
* | Proper versioning of new network-serialized stuffPerttu Ahola2012-11-26
* | New PROTOCOL_VERSION scheme (allow client to support a range of versions)Perttu Ahola2012-11-26
* | Fix LuaEntitySAO::getClientInitializationData() and bump the related versionPerttu Ahola2012-11-26
* | Update ContentFeatures serialization format now as PROTOCOL_VERSION was changedPerttu Ahola2012-11-25
* | RealBadAngel's patch which allows the lua api to read pressed player keys. Th...MirceaKitsune2012-11-25
* | A bunch of fixesMirceaKitsune2012-11-25
* | Allow Vanessa's texture filtering / mipmap patch to work on models, as well a...MirceaKitsune2012-11-25
* | Fix more things I forgot for attached players. Such players will now properly...MirceaKitsune2012-11-25
* | Update attachments at the ending of the addToScene function for parents. And ...MirceaKitsune2012-11-25
* | Send animations, bone overrides and attachments in entity initialization. Cli...MirceaKitsune2012-11-25
* | Enable client-side attachments, add detachment codeMirceaKitsune2012-11-25
* | Fix some remaining issues with attachments, now they work. Tested with object...MirceaKitsune2012-11-25
* | Complete the attachment framework.MirceaKitsune2012-11-25
* | Framework for the attachment system, new object property which allows changin...MirceaKitsune2012-11-25
* | Get the new animation framework properly workingMirceaKitsune2012-11-25
* | Joint positioning and rotation code, and fix a problem related to their lua APIMirceaKitsune2012-11-25
* | Allow the LUA API to set animations to meshes as well as the animation speed....MirceaKitsune2012-11-25
* | Get the mesh working through the memory cache properly. Most credit goes to c...MirceaKitsune2012-11-25
* | Add a subfolder for models and transfer models from server to clientMirceaKitsune2012-11-25
* | Fix material properties and allow lighting. Models should now be affected by ...MirceaKitsune2012-11-25
* | Properly read the mesh from LUA.MirceaKitsune2012-11-25
* | 3D model support for players using Irrlicht. Also ready the basis for mesh su...MirceaKitsune2012-11-25
hl opt">; httpfetch_sync(fetch_request, fetch_result); if (!fetch_result.succeeded) { return Json::Value(); } Json::Value root; Json::Reader reader; std::istringstream stream(fetch_result.data); if (!reader.parse(stream, root)) { errorstream << "URL: " << url << std::endl; errorstream << "Failed to parse json data " << reader.getFormattedErrorMessages(); errorstream << "data: \"" << fetch_result.data << "\"" << std::endl; return Json::Value(); } return root; } std::vector<ModStoreMod> readModStoreList(Json::Value& modlist) { std::vector<ModStoreMod> retval; if (modlist.isArray()) { for (unsigned int i = 0; i < modlist.size(); i++) { ModStoreMod toadd; toadd.valid = true; //id if (modlist[i]["id"].asString().size()) { std::string id_raw = modlist[i]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } else { errorstream << "readModStoreList: missing id" << std::endl; toadd.valid = false; } } else { errorstream << "readModStoreList: missing id" << std::endl; toadd.valid = false; } //title if (modlist[i]["title"].asString().size()) { toadd.title = modlist[i]["title"].asString(); } else { errorstream << "readModStoreList: missing title" << std::endl; toadd.valid = false; } //basename if (modlist[i]["basename"].asString().size()) { toadd.basename = modlist[i]["basename"].asString(); } else { errorstream << "readModStoreList: missing basename" << std::endl; toadd.valid = false; } //author //rating //version if (toadd.valid) { retval.push_back(toadd); } } } return retval; } ModStoreModDetails readModStoreModDetails(Json::Value& details) { ModStoreModDetails retval; retval.valid = true; //version set if (details["version_set"].isArray()) { for (unsigned int i = 0; i < details["version_set"].size(); i++) { ModStoreVersionEntry toadd; if (details["version_set"][i]["id"].asString().size()) { std::string id_raw = details["version_set"][i]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } } else { errorstream << "readModStoreModDetails: missing version_set id" << std::endl; retval.valid = false; } //date if (details["version_set"][i]["date"].asString().size()) { toadd.date = details["version_set"][i]["date"].asString(); } //file if (details["version_set"][i]["file"].asString().size()) { toadd.file = details["version_set"][i]["file"].asString(); } else { errorstream << "readModStoreModDetails: missing version_set file" << std::endl; retval.valid = false; } //approved //mtversion if( retval.valid ) { retval.versions.push_back(toadd); } else { break; } } } if (retval.versions.size() < 1) { infostream << "readModStoreModDetails: not a single version specified!" << std::endl; retval.valid = false; } //categories if (details["categories"].isObject()) { for (unsigned int i = 0; i < details["categories"].size(); i++) { ModStoreCategoryInfo toadd; if (details["categories"][i]["id"].asString().size()) { std::string id_raw = details["categories"][i]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } } else { errorstream << "readModStoreModDetails: missing categories id" << std::endl; retval.valid = false; } if (details["categories"][i]["title"].asString().size()) { toadd.name = details["categories"][i]["title"].asString(); } else { errorstream << "readModStoreModDetails: missing categories title" << std::endl; retval.valid = false; } if( retval.valid ) { retval.categories.push_back(toadd); } else { break; } } } //author if (details["author"].isObject()) { if (details["author"]["id"].asString().size()) { std::string id_raw = details["author"]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { retval.author.id = numbervalue; } else { errorstream << "readModStoreModDetails: missing author id (convert)" << std::endl; retval.valid = false; } } else { errorstream << "readModStoreModDetails: missing author id" << std::endl; retval.valid = false; } if (details["author"]["username"].asString().size()) { retval.author.username = details["author"]["username"].asString(); } else { errorstream << "readModStoreModDetails: missing author username" << std::endl; retval.valid = false; } } else { errorstream << "readModStoreModDetails: missing author" << std::endl; retval.valid = false; } //license if (details["license"].isObject()) { if (details["license"]["id"].asString().size()) { std::string id_raw = details["license"]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { retval.license.id = numbervalue; } } else { errorstream << "readModStoreModDetails: missing license id" << std::endl; retval.valid = false; } if (details["license"]["short"].asString().size()) { retval.license.shortinfo = details["license"]["short"].asString(); } else { errorstream << "readModStoreModDetails: missing license short" << std::endl; retval.valid = false; } if (details["license"]["link"].asString().size()) { retval.license.url = details["license"]["link"].asString(); } } //titlepic if (details["titlepic"].isObject()) { if (details["titlepic"]["id"].asString().size()) { std::string id_raw = details["titlepic"]["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { retval.titlepic.id = numbervalue; } } if (details["titlepic"]["file"].asString().size()) { retval.titlepic.file = details["titlepic"]["file"].asString(); } if (details["titlepic"]["desc"].asString().size()) { retval.titlepic.description = details["titlepic"]["desc"].asString(); } if (details["titlepic"]["mod"].asString().size()) { std::string mod_raw = details["titlepic"]["mod"].asString(); char* endptr = 0; int numbervalue = strtol(mod_raw.c_str(),&endptr,10); if ((mod_raw != "") && (*endptr == 0)) { retval.titlepic.mod = numbervalue; } } } //id if (details["id"].asString().size()) { std::string id_raw = details["id"].asString(); char* endptr = 0; int numbervalue = strtol(id_raw.c_str(),&endptr,10); if ((id_raw != "") && (*endptr == 0)) { retval.id = numbervalue; } } else { errorstream << "readModStoreModDetails: missing id" << std::endl; retval.valid = false; } //title if (details["title"].asString().size()) { retval.title = details["title"].asString(); } else { errorstream << "readModStoreModDetails: missing title" << std::endl; retval.valid = false; } //basename if (details["basename"].asString().size()) { retval.basename = details["basename"].asString(); } else { errorstream << "readModStoreModDetails: missing basename" << std::endl; retval.valid = false; } //description if (details["desc"].asString().size()) { retval.description = details["desc"].asString(); } //repository if (details["replink"].asString().size()) { retval.repository = details["replink"].asString(); } //value if (details["rating"].asString().size()) { std::string id_raw = details["rating"].asString(); char* endptr = 0; float numbervalue = strtof(id_raw.c_str(),&endptr); if ((id_raw != "") && (*endptr == 0)) { retval.rating = numbervalue; } } else { retval.rating = 0.0; } //depends if (details["depends"].isArray()) { //TODO } //softdepends if (details["softdep"].isArray()) { //TODO } //screenshot url if (details["screenshot_url"].asString().size()) { retval.screenshot_url = details["screenshot_url"].asString(); } return retval; }