[wesnoth-commits] [wesnoth/wesnoth] 3933eb: Use coroutines via boost::asio::spawn to improve o...

Sergey Popov noreply at github.com
Wed Dec 30 16:08:48 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 3933ebab5ce54e63dddbbde2a230d6043328bece
      https://github.com/wesnoth/wesnoth/commit/3933ebab5ce54e63dddbbde2a230d6043328bece
  Author: Sergey Popov <loonycyborg at gmail.com>
  Date:   2020-12-30 (Wed, 30 Dec 2020)

  Changed paths:
    M .github/workflows/ci-main.yml
    M CMakeLists.txt
    M SConstruct
    M packaging/flatpak/org.wesnoth.Wesnoth.json
    M projectfiles/Xcode/The Battle for Wesnoth.xcodeproj/project.pbxproj
    M scons/boost.py
    M src/CMakeLists.txt
    M src/server/campaignd/server.cpp
    M src/server/campaignd/server.hpp
    R src/server/common/send_receive_wml_helpers.ipp
    M src/server/common/server_base.cpp
    M src/server/common/server_base.hpp
    M src/server/wesnothd/game.cpp
    M src/server/wesnothd/game.hpp
    M src/server/wesnothd/server.cpp
    M src/server/wesnothd/server.hpp

  Log Message:
  -----------
  Use coroutines via boost::asio::spawn to improve overall code structure in servers (#5341)

* Convert server_base class to use coroutine instead of handlers

* Rework wesnothd's client login to use coroutine

* Merge 3 player handling functions into a single coroutine

* update cmakelists too

* Implement send_doc_queued in terms of coroutine

* Use brace initialization for making asio buffers

* Implement campaignd's request handling in coroutine

* Brace-initialize entire vector

* Remove old handler based send/receive helpers

* Document coroutine send/receive helpers

* Made coro_send_doc() helper take wml doc by reference

In most cases there is no need to rely on shared pointers to ensure
object lifetime if using coroutines since even when coroutine is
suspended args are still kept alive by its context.

* Document coro_send_file()

* Silence deprecation warning to fix build on earlier versions of boost

* Explicitly check for boost.context to allow linking against static boost libs

* Add boost.coroutine to flatpak manifest

* Port winapi TransmitFile codepath to coroutines

* Exception safety fix

* Add boost.scope_exit to vcpkg

* Fix build with pre-1.66 boost

* Move coro_* helpers into server_base class

Those helpers were in .ipp solely because they were templated on handler
types, this is no longer true after coroutine based rework.

* Make server_base::coro_send_file non-inline

* CleanUp Xcode project

Co-authored-by: Martin Hrubý (hrubymar10) <hrubymar10 at gmail.com>





More information about the Commits mailing list