Networks Refactor
Thorinwasher opened this issue · 8 comments
In the current version of stargate: if the name of a the terminal and central network changes, any portal contained within those will convert into a custom network.
It would be better if the portals would stay in the central or terminal network, when the network changes names in the setting.
I think the easiest way to do this is to make the presence of the DEFAULT_NETWORK and TERMINAL_NETWORK flags be the decider of which portals are on the default network or not. The network names of those portals should probably be updated with the new network names on startup.
What happens if there is a portal on the potato network, and then the default network is set to potato. Does the existing portal become a portal on the default network, do we keep it separate somehow, or do we force a name change?
To allow the proposed changes on network creation, the scripts similar to the following will need to be implemented
Case ""
IF(sg.default NODE)[!]
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
IF( sg.personal NODE)
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
Case Name
IF GATE HAS FLAG "T"
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
IF NAME == OWN NAME
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
IF {NAME} == Default
IF HAS PERMISSION
DEAL WITH SELECTION OR CREATION AND RETURN
ELSE
User.Error.Warn
IF {NAME} == CurrentPlayerName
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
Case {NAME}
IF NAME == OWN NAME
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
ELSE IF NAME == CurrentPlayerName
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
ELSE
User.Error.Warn
Case [NAME]
IF {NAME} == Default
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
ELSE
User.Error.Warn
Case (NAME)
IF {CUSTOM.<NAME> NODE}
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
ELSE
User.Error.Warn
Case <NAME> OR «NAME»
IF {TERMINAL.NAME.USE NODE}
IF HAS PERMISSION, DEAL WITH SELECTION OR CREATION AND RETURN
ELSE
User.Error.Warn
From yesterdays talk, the conclusion was to add « » as pointers for default/terminal networks. I have one issue with that, how would this display for interserver default/terminal networks work?
Solution: use §l for interserver network like §l[§r Name §l]
Where
«» = Terminal Networks
[] = Default Networks
{} = Personal Networks
() = Custom Networks
<> = Vacant
This solution also allows personal interserver networks :).
Default/terminal network for interserver should connect to the default/terminal network of another server regardless of the setting of name for those networks between servers.
About implementation, there's having special hardcoded uuids for the two different types of networks (default/terminal), probably the best solution. There's two ways of storing these, either store it only as a flag and have an empty networkname (done kinda in legacy), or we store the uuid as well as a flag.
Currently, we have a similar problem for username/custom networks.
I think we solved that with bracket types or something.
Having said that, a terminal/default network is much more important than a custom network.
It also opens up potential security implications.
I think the best way here is just to rename the existing network potato1 or something to that effect.