This concept applies to the option of integrating the map editor into the client. I haven't decided this yet.
Storing of maps: All map layouts are stored in the database. The database holds all past versions of each map. The most recent one is the one which is used.
Map editing: The mapper can change the layout of the current map on the client-side, but the server won't respect these before the changes are sent to the server using the
map save command.
Gloassary:
Local map version: The map on the client side. Identical to the current map version until the mapper starts mapping.
map version: A version of the map stored in the servers database for version control purposes
active map version: The latest non-wip version of a map. This version is used for gameplay
Mapping commands:
map create [name] [l] [r] [default tile]* creates a new map. The first and active version has the given size and is filled entirely with the default tile.
map versions request a list of all past versions of the current map with timestamp, author and if it is active or not
map save [data] creates a new version of the current map which is identical to the local map version. The new version is not active yet.
map activate* the latest version becomes the active version.
map load [time] loads a version as local version which doesn't necessarily needs to be the active version. Time can be omitted to load the latest version.
map copy [name_to]* creates a new map name_to. The first and active version of this map is identical to the local version of the current map.
map overwrite [name_to]* creates a new version of map name_to which is identical to the local version of the current map. The new version becomes the active version.
*It should be possible to limit the permissions for create, activate, copy and overwrite commands to specific namespaces to prevent mappers from creating a mess of garbage maps.
Workflow without QA:
The mapper teleports to the map which needs to be changed
- The mapper does the changes
The mapper uses map save to save the changes
- The mapper uses map activate to activate the changes
By restricting the activate and overwrite command to selected people a QA can be enforced. Workflow with QA:
The mapper teleports to the map which needs to be changed
The mapper does the changes
- The mapper uses map copy to create an active copy
- The QA teleports to the active copy and tests it
- The QA uses map overwrite to replace the production map
To restore a map to an earlier state:
- The mapper teleports to the map which needs to be changed
- The mapper uses map load to restore the version
- The mapper uses map save to create a new version identical to the past version
- The mapper uses map activate to re-activate the past version