summaryrefslogtreecommitdiff
path: root/src/porting.cpp
Commit message (Expand)AuthorAge
* Fix android build using hardcoded path for data instead of using the one fetc...sapier2014-10-01
* Add support for Android 2.3+sapier2014-06-29
* OS X compatibility fixesMartin Doege2014-06-29
* Revert "Add daemon support for linux like operating systems"sapier2014-06-01
* Revert "Redirect stdin/stderr/stdout to /dev/null in daemon mode"sapier2014-06-01
* Redirect stdin/stderr/stdout to /dev/null in daemon modesapier2014-06-01
* Add daemon support for linux like operating systemssapier2014-05-31
* Add support for dpi based HUD scalingsapier2014-04-27
* Bunch of small fixes (coding style, very unlikely errors, warning messages)sapier2014-04-19
* Fix problem with newer MinGW runtimesSfan52014-04-14
* Include system info in the HTTP user agent on WindowsSfan52014-01-23
* Portability fixes for OpenBSD (and possibly NetBSD and others).Aaron Suen2013-11-02
* Tune queue limits, some other adjustmentskwolekr2013-02-25
* Add multi-Emerge thread supportkwolekr2013-02-25
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Fix assertion condition in initializePaths()kwolekr2013-02-06
* Fix msvc buildIlya Zhuravlev2013-01-22
* Proper RUN_IN_PLACE support for OSX and FreeBSDkwolekr2013-01-21
* Improve build configuration optionsPerttu Ahola2012-07-23
* Initially split utility.h to multiple files in util/Perttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* MSVC build directory autodetection at startupPerttu Ahola2012-03-25
* Flatten share/ and user/ in the source and for the RUN_IN_PLACE buildPerttu Ahola2012-03-20
* Attempt to fix RUN_IN_PLACE autodetection on LinuxPerttu Ahola2012-03-13
* Remove useless debug output (log at info level)Perttu Ahola2012-03-11
* Clean up log messages everywherePerttu Ahola2012-03-11
* Initial directory structure reworkPerttu Ahola2012-03-10
* Scripting WIPPerttu Ahola2011-11-29
* Move images to data/textures and fix some path stuff; hope that installation ...Perttu Ahola2011-11-29
* Command-line signal handling for WindowsConstantin Wenger2011-11-06
* Remove trailing / or \ in path_userdata (probably fixes world deletion on Win...Perttu Ahola2011-11-02
* Fix map delete on windows (concatenate paths correctly with / or \ depending ...Perttu Ahola2011-10-16
* fixed not finding data dir if installedConstantin Wenger2011-08-12
* Fix data paths for FreeBSDDmitry Marakasov2011-08-02
* Check the data path before usageGiuseppe Bilotta2011-07-20
* moved the mac include in porting.cpp out of namespacePerttu Ahola2011-06-20
* Hand-picked Mac OSX cursor and bundle path fixes from https://bitbucket.org/t...Perttu Ahola2011-06-18
* Get rid of ignored return value warningCiaran Gultnieks2011-05-16
* mainly work on object scripting apiPerttu Ahola2011-02-23
* Debug stacks will now be printed on Ctrl-C. Also client properly quits on Ctr...Perttu Ahola2011-02-16
* Fix for windowsPerttu Ahola2011-02-15
* Ctrl+C handling on POSIX, some commands for server and other tweakingPerttu Ahola2011-02-15
* bug-fixin'Perttu Ahola2011-02-08
* fixed data path in porting.cpp for normal linux builds to get data from /bina...Perttu Ahola2011-01-10
* CMake stuff works now on linux and windows... and should be possible to make ...Perttu Ahola2011-01-08
* Added a more flexible path system (and fixed some minor stuff)Perttu Ahola2011-01-07
t;\""); meta->setString("formspec","field[text;;${text}]"); return false; } else if(id == NODEMETA_CHEST) // ChestNodeMetadata { meta->getInventory()->deSerialize(is); // Rename inventory list "0" to "main" Inventory *inv = meta->getInventory(); if(!inv->getList("main") && inv->getList("0")){ inv->getList("0")->setName("main"); } assert(inv->getList("main") && !inv->getList("0")); meta->setString("formspec","size[8,9]" "list[current_name;main;0,0;8,4;]" "list[current_player;main;0,5;8,4;]"); return false; } else if(id == NODEMETA_LOCKABLE_CHEST) // LockingChestNodeMetadata { meta->setString("owner", deSerializeString(is)); meta->getInventory()->deSerialize(is); // Rename inventory list "0" to "main" Inventory *inv = meta->getInventory(); if(!inv->getList("main") && inv->getList("0")){ inv->getList("0")->setName("main"); } assert(inv->getList("main") && !inv->getList("0")); meta->setString("formspec","size[8,9]" "list[current_name;main;0,0;8,4;]" "list[current_player;main;0,5;8,4;]"); return false; } else if(id == NODEMETA_FURNACE) // FurnaceNodeMetadata { meta->getInventory()->deSerialize(is); int temp = 0; is>>temp; meta->setString("fuel_totaltime", ftos((float)temp/10)); temp = 0; is>>temp; meta->setString("fuel_time", ftos((float)temp/10)); temp = 0; is>>temp; //meta->setString("src_totaltime", ftos((float)temp/10)); temp = 0; is>>temp; meta->setString("src_time", ftos((float)temp/10)); meta->setString("formspec","size[8,9]" "list[current_name;fuel;2,3;1,1;]" "list[current_name;src;2,1;1,1;]" "list[current_name;dst;5,1;2,2;]" "list[current_player;main;0,5;8,4;]"); return true; } else { throw SerializationError("Unknown legacy node metadata"); } } static bool content_nodemeta_deserialize_legacy_meta( std::istream &is, NodeMetadata *meta) { // Read id s16 id = readS16(is); // Read data std::string data = deSerializeString(is); std::istringstream tmp_is(data, std::ios::binary); return content_nodemeta_deserialize_legacy_body(tmp_is, id, meta); } void content_nodemeta_deserialize_legacy(std::istream &is, NodeMetadataList *meta, NodeTimerList *timers, IGameDef *gamedef) { meta->clear(); timers->clear(); u16 version = readU16(is); if(version > 1) { infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported" <<std::endl; throw SerializationError(__FUNCTION_NAME); } u16 count = readU16(is); for(u16 i=0; i<count; i++) { u16 p16 = readU16(is); v3s16 p(0,0,0); p.Z += p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE; p16 -= p.Z * MAP_BLOCKSIZE * MAP_BLOCKSIZE; p.Y += p16 / MAP_BLOCKSIZE; p16 -= p.Y * MAP_BLOCKSIZE; p.X += p16; if(meta->get(p) != NULL) { infostream<<"WARNING: "<<__FUNCTION_NAME<<": " <<"already set data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; continue; } NodeMetadata *data = new NodeMetadata(gamedef); bool need_timer = content_nodemeta_deserialize_legacy_meta(is, data); meta->set(p, data); if(need_timer) timers->set(p, NodeTimer(1., 0.)); } } void content_nodemeta_serialize_legacy(std::ostream &os, NodeMetadataList *meta) { // Sorry, I was too lazy to implement this. --kahrl writeU16(os, 1); // version writeU16(os, 0); // count } // END