Skip to content

Roadmap to server switching #44

@regenerativep

Description

@regenerativep
  • Dummy join and disconnect server

  • Main player and dummy can switch

  • Duplicate packets client->server, send dummy packets (only the packets that we need; ex. no duplicate chunk loading) server->client

  • Synchronization plugin: ensure dummy matches primary's position

  • Count references to usages of entity ids, store ids in use by each player for ref. count decrement on disconnect

  • Handle a player seeing both another player's main player and the other player's dummy player

  • Basic form of zoning or chunk ownership, at least for testing

Related parts that may be better put in separate issues:

  • High quality zoning and load balancing
  • Transferal of resources like entities as different servers take over other server's resources
  • Allow non-player entities to see into adjacent servers

old post:

(Written in the context of #43's version of the project)

Stage 1: Extremely basic server switch
Scenario can be two servers with matching worlds, one player starting in one of the servers. No chunk sharing or entity ownership in this stage. This is probably the bare minimum for server switching.

- [x] Basic dummy
  1. Start a second dummy connection to other server
  2. Teleport dummy player to primary player's position
  3. Switch player's primary connection to secondary connection.
  4. Close previously-primary-now-dummy connection.
  - [x] Swap connections in other direction as well
- [ ] Server plugin to listen for teleport command from proxy. Can use plugin channels

Stage 2: Basic server switch with world synchronization
Scenario can be two or more servers all with matching seeds, one player starting in one server.

- [ ] A way for servers to connect to each other (NATs? plugin channels with proxy as router?)
- [ ] Chunk sharing
  - [ ] Find out what other servers are using a chunk
  - [ ] Listen to and mirror changes in other server's instances of the shared chunk

Stage 3: Server switch with world sync and entity sync

- [ ] Entity mirroring
  - [ ] Chunk ownership system (in proxy? in database?)
  - [ ] Find out what other server listens to a chunk
  - [ ] Transfer chunk ownership to another listener when no longer using chunk
  - [ ] Mirror entities in chunk

Stage 4: Server switch
Scenario can be multiple worlds with matching seeds, multiple players in various servers.

- [ ] Mirror primary player in dummy, ex. movements, effects, animations
- [ ] Relay input from non-primary server sources, such the dummy being damaged in the server it's in
- [ ] Transfer player stats and inventory
- [ ] Loading of existing chunks from shared world data (database?)

None of this is set in stone nor a required order nor the best order and it is possible I've missed things. This is just a potential roadmap that can be followed and may function more like a general checklist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions