[wesnoth-commits] [wesnoth/wesnoth] 6a0e63: addon/validation: Cheeky reindent

Iris Morelle noreply at github.com
Mon Nov 9 16:24:11 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 6a0e63038ec4b61217ad32bc01aae8c11e6a7eda
      https://github.com/wesnoth/wesnoth/commit/6a0e63038ec4b61217ad32bc01aae8c11e6a7eda
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/addon/validation.cpp

  Log Message:
  -----------
  addon/validation: Cheeky reindent


  Commit: c214487d41107b53913a5ed6a8d4d81655d30941
      https://github.com/wesnoth/wesnoth/commit/c214487d41107b53913a5ed6a8d4d81655d30941
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/server/campaignd/server.cpp
    M src/server/campaignd/server.hpp

  Log Message:
  -----------
  campaignd: Add mark_dirty() method


  Commit: 7c52e9752713597e5e213d5e6c7166daffe18972
      https://github.com/wesnoth/wesnoth/commit/7c52e9752713597e5e213d5e6c7166daffe18972
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/addon/validation.cpp
    M src/addon/validation.hpp

  Log Message:
  -----------
  addon/validation: Add add-on validation status messages

This implements a status message table for all currently possible add-on
validation statuses.

The idea is to aid making campaignd's side of the validation cleaner and
less data-laden, and to provide a path for implementing translation of
these messages on the client side without running into issues where
minor changes to strings on the server side forcefully fuzzy them until
the next release.

This is not used yet since the relevant code is part of a major
refactoring of the [upload] request handler.


  Commit: 7a38142c745d36f09e127a70595bbf21734dc21c
      https://github.com/wesnoth/wesnoth/commit/7a38142c745d36f09e127a70595bbf21734dc21c
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/server/campaignd/server.cpp
    M src/server/campaignd/server.hpp

  Log Message:
  -----------
  campaignd: Whole-sale refactor of [upload] handler

This splits the entirety of the pre-upload validation checks at the
start of campaignd::server::handle_upload() into a new validate_addon()
method, which delivers information about the validation outcome through
its own interface, including the ADDON_CHECK_STATUS enum type.

It also largely changes code to avoid multiple invariant WML attribute
reads that, shifts further away from the 'campaign' term internally, and
more importantly, avoids making extra copies of the WML payload (which
can be as large as 100 MB in production) by modifying the request body
directly if necessary. This last part is very much not elegant, but it
will do for now.

Some code has also been reordered, reformatted, or replaced with
equivalent syntax for clarity.

There's still some work to be done here, especially with regards to
delta uploads. At least the handler itself should be more
straightforward and readable now. Additionally, this opens up the
possibility of implementing a mechanism to "pre-validate" an add-on
before uploading the full thing. The jury's still out on whether this
would be a good use of my time or not, though.

Also, as part of this commit, the send_error() and send_message()
methods (and all of their overload) escape their input for simple_wml
themselves instead of leaving it up to the caller to figure out and sort
out the most ridiculous API design decision in the entire history of
Wesnoth.


  Commit: 06625a2797463bacd5d863491e8ae5f1a88a41dd
      https://github.com/wesnoth/wesnoth/commit/06625a2797463bacd5d863491e8ae5f1a88a41dd
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/server/campaignd/server.cpp

  Log Message:
  -----------
  campaignd: Avoid using config::remove_children() during loops on ranges

There are no obvious guarantees made with regards to the validity of
iterators returned by config::child_range() after a deletion. As far as
I can tell, it's very likely that holding an iterator to an element,
then deleting that element, then advancing that iterator could result in
UB. It could even result in items being skipped.


  Commit: 2a96d87bf8b65564d964284c6a3ac3378975e66e
      https://github.com/wesnoth/wesnoth/commit/2a96d87bf8b65564d964284c6a3ac3378975e66e
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M src/addon/client.cpp
    M src/addon/validation.cpp
    M src/addon/validation.hpp

  Log Message:
  -----------
  campaignd: Make validation statuses translatable on the client


Compare: https://github.com/wesnoth/wesnoth/compare/0cf5c8d7f069...2a96d87bf8b6



More information about the Commits mailing list