+ This was left to be done by the old system and it sends only the
nearest ones.
-Vim conversion regexpes for moving to extended content type storage:
-%s/\(\.\|->\)d \([!=]=\)/\1getContent() \2/g
-%s/content_features(\([^.]*\)\.d)/content_features(\1)/g
-%s/\(\.\|->\)d = \([^;]*\);/\1setContent(\2);/g
-%s/\(getNodeNoExNoEmerge([^)]*)\)\.d/\1.getContent()/g
-%s/\(getNodeNoExNoEmerge(.*)\)\.d/\1.getContent()/g
-%s/\.d;/.getContent();/g
-%s/\(content_liquid\|content_flowing_liquid\|make_liquid_flowing\|content_pointable\)(\([^.]*\).d)/\1(\2.getContent())/g
-Other things to note:
-- node.d = node.param0 (only in raw serialization; use getContent() otherwise)
-- node.param = node.param1
-- node.dir = node.param2
-- content_walkable(node.d) etc should be changed to
- content_features(node).walkable etc
-- Also check for lines that store the result of getContent to a 8-bit
- variable and fix them (result of getContent() must be stored in
- content_t, which is 16-bit)
-
NOTE: Seeds in 1260:6c77e7dbfd29:
5721858502589302589:
Spawns you on a small sand island with a surface dungeon
TODO: Protocol version field
TODO: Think about using same bits for material for fences and doors, for
example
-TODO: Move mineral to param2, increment map serialization version, add
- conversion
SUGG: Restart irrlicht completely when coming back to main menu from game.
- This gets rid of everything that is stored in irrlicht's caches.
#include "filesys.h"
#include "config.h"
#include "guiMainMenu.h"
-#include "mineral.h"
-#include "materials.h"
#include "game.h"
#include "keycode.h"
#include "tile.h"
#include "settings.h"
#include "profiler.h"
#include "log.h"
+#include "mods.h"
/*
Settings.
// List all allowed options
core::map<std::string, ValueSpec> allowed_options;
- allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG));
+ allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG,
+ "Show allowed options"));
allowed_options.insert("server", ValueSpec(VALUETYPE_FLAG,
"Run server directly"));
allowed_options.insert("config", ValueSpec(VALUETYPE_STRING,
"Load configuration from specified file"));
- allowed_options.insert("port", ValueSpec(VALUETYPE_STRING));
- allowed_options.insert("address", ValueSpec(VALUETYPE_STRING));
- allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG));
- allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG));
- allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG));
- allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING));
+ allowed_options.insert("port", ValueSpec(VALUETYPE_STRING,
+ "Set network port to connect to"));
+ allowed_options.insert("address", ValueSpec(VALUETYPE_STRING,
+ "Address to connect to"));
+ allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG,
+ "Enable random user input, for testing"));
+ allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG,
+ "Disable unit tests"));
+ allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG,
+ "Enable unit tests"));
+ allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING,
+ "Map directory (where everything in the world is stored)"));
#ifdef _WIN32
allowed_options.insert("dstream-on-stderr", ValueSpec(VALUETYPE_FLAG));
#endif
- allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG));
- allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG));
+ allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG,
+ "Run speed tests"));
+ allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG,
+ "Print debug information to console"));
Settings cmd_args;
porting::signal_handler_init();
bool &kill = *porting::signal_handler_killstatus();
- // Initialize porting::path_data and porting::path_userdata
porting::initializePaths();
// Create user data directory
- fs::CreateDir(porting::path_userdata);
+ fs::CreateDir(porting::path_user);
- init_gettext((porting::path_data+DIR_DELIM+".."+DIR_DELIM+"locale").c_str());
+ init_gettext((porting::path_share+DIR_DELIM+".."+DIR_DELIM+"locale").c_str());
// Initialize debug streams
#ifdef RUN_IN_PLACE
std::string debugfile = DEBUGFILE;
#else
- std::string debugfile = porting::path_userdata+DIR_DELIM+DEBUGFILE;
+ std::string debugfile = porting::path_user+DIR_DELIM+DEBUGFILE;
#endif
debugstreams_init(disable_stderr, debugfile.c_str());
// Initialize debug stacks
else
{
core::array<std::string> filenames;
- filenames.push_back(porting::path_userdata +
+ filenames.push_back(porting::path_user +
DIR_DELIM + "minetest.conf");
#ifdef RUN_IN_PLACE
- filenames.push_back(porting::path_userdata +
+ // Try also from a lower level (to aid having the same configuration
+ // for many RUN_IN_PLACE installs)
+ filenames.push_back(porting::path_user +
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
#endif
srand(time(0));
mysrand(time(0));
- /*
- Pre-initialize some stuff with a dummy irrlicht wrapper.
-
- These are needed for unit tests at least.
- */
-
- // Must be called before texturesource is created
- // (for texture atlas making)
- init_mineral();
-
/*
Run unit tests
*/
port = 30000;
// Map directory
- std::string map_dir = porting::path_userdata+DIR_DELIM+"world";
+ std::string map_dir = porting::path_user + DIR_DELIM + "server" + DIR_DELIM + "worlds" + DIR_DELIM + "world";
if(cmd_args.exists("map-dir"))
map_dir = cmd_args.get("map-dir");
else if(g_settings->exists("map-dir"))
map_dir = g_settings->get("map-dir");
+ else{
+ // No map-dir option was specified.
+ // Check if the world is found from the default directory, and if
+ // not, see if the legacy world directory exists.
+ std::string legacy_map_dir = porting::path_user+DIR_DELIM+".."+DIR_DELIM+"world";
+ if(!fs::PathExists(map_dir) && fs::PathExists(legacy_map_dir)){
+ errorstream<<"Warning: Using legacy world directory \""
+ <<legacy_map_dir<<"\""<<std::endl;
+ map_dir = legacy_map_dir;
+ }
+ }
// Run dedicated server if asked to
if(cmd_args.getFlag("server"))
g_timegetter = new SimpleTimeGetter();
// Create server
- Server server(map_dir.c_str(), configpath);
+ Server server(map_dir, configpath, "mesetint");
server.start(port);
// Run server
}
// Break out of menu-game loop to shut down cleanly
- if(device->run() == false)
+ if(device->run() == false || kill == true)
break;
/*
errorstream<<"Socket error (port already in use?)"<<std::endl;
error_message = L"Socket error (port already in use?)";
}
+ catch(ModError &e)
+ {
+ errorstream<<e.what()<<std::endl;
+ error_message = narrow_to_wide(e.what()) + L"\nCheck debug.txt for details.";
+ }
#ifdef NDEBUG
catch(std::exception &e)
{