Commit graph

8 commits

Author SHA1 Message Date
Pentarctagon
b586e38e30 Move simple_wml unit test into the actual unit tests. 2022-07-30 00:07:46 -05:00
Pentarctagon
08bfe41b9e Move password hashing to server_base.
This is in preparation for adding the `forum_auth` option when uploading an add-on.
2021-06-01 13:47:48 -05:00
Pentarctagon
b974423e2e Add optional fuh to campaignd. 2021-03-12 16:12:09 -06:00
Iris Morelle
227738cb6f campaignd: Command line processing w/ Boost.program_options
This also adds a few utility switches which people are probably already
familiarized with from the game proper. Most notably this means I don't
need to alter and recompile campaignd any time I want different logging
settings.

There's some functionality commented out in this commit while I figure
out how to wire it into the campaignd server class.
2020-11-09 21:22:00 -03:00
Iris Morelle
cfa0342829 campaignd: Move auth functionality out of server.cpp 2020-11-01 16:11:20 -03:00
Pentarctagon
46f74f0ebb Move campaignd and wesnothd files into more descriptive locations.
Also fix a few cases of not specifying the full path to header files.
2020-08-06 12:16:18 -05:00
Ignacio R. Morelle
28c5179636 campaignd: Add wrapper for atomic commits of crucial files
As the 2016-10-07~09 downtime incident shows, it is paramount to take
further steps in guaranteeing that the server can't corrupt its own data
files (especially the add-ons database) when receiving
inappropriately-timed signals.

This commit adds and deploys an ostream wrapper that requires callers to
explicitly commit the results to disk when finished writing to the
stream, so that only then the real destination file is overwritten with
the working copy (a temporary in the same dir). This way, there should
never be a situation in which the destination is left in an inconsistent
state due to a signal or exception.

The temporary receives a predictable name right now in the interest of
simplicity, since we are more or less in control of the target directory
anyway. We definitely don't want it to be an unlinked file since that
would make it impossible for admins to inspect and compare the temporary
against the original afterwards.

The code makes some assumptions about the nature of the return value of
filesystem::ostream_file() which will never be broken in this stable
branch, which is why one helper function is in campaignd land rather
than in the global filesystem API for now. This should probably be
rectified when forward-porting to master. Maybe.

Nothing of this will work reliably on Windows but we don't care. There's
only one machine in the world where we support running campaignd at this
time and it runs Linux.
2017-09-14 20:14:08 -03:00
Pentarctagon
5b29805554 Have cmake and scons use same lists of source files (#882)
* Use separate files to build scons and to build lua for cmake

Move lists of source files into their own directory
Make scons use the lists of source files
Move lua build step to src/SConscript and delete src/lua/SConscript
Make cmake use the separate file with the list of lua sources to build

* Finish changing over to source lists

scons
  move source files from libraries that don't appear in cmake over to existing source lists - libcampaignd, libcutter, libdummy_video, libtest_utils
  add the defines FIFODIR and WESNOTH_PATH to all compiled source files, as cmake does, and move the single files those defines had previously been defined on into the source lists
  remove WESNOTH_PREFIX, as not used
  added schema_validator sources from cmake
  added OBJPREFIX to - cutter, exploder, campaignd, schema_generator, schema_validator
cmake
  change over to using the source lists
  move source files from libraries that don't appear in scons over to existing source lists - wesnoth-gui_types, wesnoth-gui_event, wesnoth-gui_iterator, wesnoth-gui_placer, wesnoth-gui_tooltip, wesnoth-gui_widget, wesnoth-gui_widget_definition, wesnoth-gui1_widgets, wesnoth-schema_validator
2016-12-15 15:51:29 -05:00