In normal mode, the server on start up checks for the existence of ./save and,
on success, reads all commands from it. If no save file exists, commands from
-./confserver/world are read instead – and written to the file ./record_save.
-Afterwards, the command "MAKE_WORLD" with the current Unix time as argument is
-interpreted (and also written to ./record_save).
+./confserver/world (or any file defined with the -w argument) are read instead
+– and written to the file ./record_save. Afterwards, the command "MAKE_WORLD"
+with the current Unix time as argument is interpreted (and also written to
+./record_save).
In any case, from then on, further commands are read in from ./server_run/in.
New commands must be appended to the file – which is what the client does. All
if os.access(io_db["path_save"], os.F_OK):
obey_lines_in_file(io_db["path_save"], "save")
else:
- if not os.access(io_db["path_worldconf"], os.F_OK):
+ if not os.access(opts.worldconf, os.F_OK):
msg = "No world config file from which to start a new world."
raise SystemExit(msg)
- obey_lines_in_file(io_db["path_worldconf"], "world config ",
- do_record=True)
+ obey_lines_in_file(opts.worldconf, "world config ", do_record=True)
obey("MAKE_WORLD " + str(int(time.time())), "in file", do_record=True)
while True:
try_worldstate_update()
io_db = {
"path_save": "save",
"path_record": "record_save",
- "path_worldconf": "confserver/world",
"path_server": "server_run/",
"path_in": "server_run/in",
"path_out": "server_run/out",
action='store')
parser.add_argument('-l', nargs="?", const="save", dest='savefile',
action="store")
+ parser.add_argument('-w', type=str, default="confserver/world",
+ dest='worldconf', action='store')
parser.add_argument('-v', dest='verbose', action='store_true')
opts, unknown = parser.parse_known_args()
return opts