Skip to content

Http server

Niklas Krieger requested to merge HttpServer into master

Overview

  • Client
    • Uses operations to communicate with the server via TCP
    • Informs the server about status changes (canUndo / canRedo / mode ... changed)
    • Transforms all changes on the Territory into deltas which are sent to the server
    • Registers a RemoteInputListener and subscribes for new input messages
  • Server
    • Provides a HTTP api
    • Supports connections to n clients
    • UI clients can ask for the current state and new deltas
    • The connection to the client is kept alive as long as http requests arrive
    • Is terminated if all connections to clients are terminated
  • SimpleHamsterGame starts creates a client (and starts the server if necessary) if the OUTPUT_INTERFACE environmental variable is set to HTTP

Breaking changes

  • None 🎉

Possible future additions

  • Event sourcing for deltas
  • WebSocket Api
  • Use of java records (currently, record classes are still a preview feature, but this probably changes in the future)

Merge request reports

Loading