stargate-rewritten / Stargate-Bukkit

The original, and still the best, survival-friendly portal plugin.
https://sgrewritten.org/paper
GNU Lesser General Public License v3.0
33 stars 12 forks source link

Interserver Refactor #261

Open Pheotis opened 1 year ago

Pheotis commented 1 year ago

Currently, it is possible to make interserver networks that either do not integrate with, or outright conflict with, matching local networks. See issue #255.

The long-term solution to this should probably be to just extend local networks into interserver networks:

Take local custom network (foo). Also take interserver network ❪foo❫.

Given:

foo I

- Portal `Test2` on ❪foo❫ on Server2

Test2

foo I

- Portal `Test3` on (foo) on Server1

Test3

foo

- Portal `Test4` on (foo) on Server1

Test4

foo


The listed portals shown from interserver portal Test1 should look like this:

For the example test3, note that the interserver portal test1 would clearly be indicated as such by its colour.

As an exception to this rule, default networks should handled similar to how they already are.

Take local default network `<@@ DEFAULT @@>`.
For its interserver equivalent `❮ @@ DEFAULT @@❯`, the handling should work as follows.

Given:
- Portal `TestA` on local `[central]` on Server1

TestA

central

- Portal `TestB` on local `[central]` on Server1

TestB

central

- Portal `TestC` on interserver `【central】` on Server1

TestC

central I

- Portal `TestD` on interserver `【default】` on Server2

TestD

default I


The listed portals shown from interserver portal TestA should look like this:

For personal portals, the functionality should be identical to that described above for local custom networks. For terminal portals, the functionality is not yet defined, but should likely be identical to that described above for default networks.

The general conflict handling for duplicate network names (as identified by our conflict management diagram in #237) should be extended for all interserver network gates.

This likely reflects a sweeping change in how interserver networks are implemented. If this change is too extensive given the upcoming beta push, we can probably expand conflict management to treat the interserver scope as functionally independent for the interim.

Also, this change is probably expansive enough to require its own branch.

Thorinwasher commented 1 year ago

This is a great idea, here's some issues we would need to face for even trying to deal with interserver conflict management:

Thorinwasher commented 1 year ago

And, yes. This would require quite a refactor to work, including loads of testing. This should really not be in the parity update, but later on, so that we can release some kind of beta version

Also, when I think about it, conflict management could be exactly the same as for interserver portals, that is if we implement the same functionalities as I mentioned above.

The main logic behind this post is (when I think about it) whether to have network centered behavior, or portal centered behavior, generally portal centered behavior might make more sense, as it's easier to see the status of a portal, rather than that for a network.