Repository navigation
feat: server list as JSON with a Server List editor window #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+3,143
−146
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
dd8a78c
fix(server-list): a server of a group the list does not have no longe…
Mosch0512 99541e6
feat(server-list): the login screen's server groups come from ServerL…
Mosch0512 de59075
chore(server-list): remove ServerList.bmd and its one-time comparison
Mosch0512 d3d360d
feat(editor): a Server List window for the login screen's server groups
Mosch0512 7a07304
docs: the server list file and its editor window
Mosch0512 959096b
fix(editor): the Server List window's undo keys only while the keyboa…
Mosch0512 be743f2
fix(editor): Save stays off after the server list was read with errors
Mosch0512 13f2a43
fix(editor): the server select window lets go of a group the editor r…
Mosch0512 f86a535
fix(editor): the login screen keeps its open group when the Server Li…
Mosch0512 ff0d39b
fix(server-list): name and description limits count UTF-16 units
Mosch0512 0a3a37f
docs(server-list): a test server group stays at its place in the list
Mosch0512 e2be005
fix(editor): a "##" in a group name shows in the Server List window
Mosch0512 7f9d274
test(server-list): the login screen's groups as CServerListManager bu…
Mosch0512 5dbfd65
refactor(server-list): one function for the channel suffixes of the l…
Mosch0512 e8638af
refactor(server-list): the group name is copied with wcsncpy_s
Mosch0512 50d4b48
perf(editor): the Server List window maps the connect server's channe…
Mosch0512 f8fe9cd
feat(editor): the editor bar's Undo and Redo also undo the Server Lis…
Mosch0512 c4286d7
docs(server-list): Save stays off after the file was read with errors
Mosch0512 aaaeb87
refactor(editor): the Server List window's long functions in smaller …
Mosch0512 d8f4da0
refactor(server-list): the group header is ServerListGroup.h
Mosch0512 d60a5cf
style(server-list): clang-format ReadText's parameters
Mosch0512 f8b374e
fix(editor): a closed tool leaves the bar's Undo and Redo to the item…
Mosch0512 42de110
feat(editor): the bar's Undo and Redo tooltips name the Server List step
Mosch0512 f9f5b94
docs(editor): the bar's Undo and Redo act on the tool used last
Mosch0512 f96eca0
style(ui): SyncRmlModel's comment sits above SyncRmlModel again
Mosch0512 487c7cd
docs(server-list): wrap the comparison with the original client
Mosch0512 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # Server List | ||
|
|
||
| The server groups on the login screen (Valhalla, Helheim, ...) and the names | ||
| and colors of their channels come from `Data/Local/ServerList.json`. It | ||
| replaced the encrypted `Data/Local/ServerList.bmd` of the original client. The | ||
| game reads it at start; with errors in it the game shows them and stops, as it | ||
| does for broken item data. All problems are also written to the log. | ||
|
|
||
| ## How the login screen uses it | ||
|
|
||
| The connect server sends the IDs of its game servers and their load. The | ||
| client splits each ID into a group and a channel: | ||
|
|
||
| - group = server ID / 20 | ||
| - channel = server ID % 20 + 1 | ||
|
|
||
| So servers 0 to 19 are the channels 1 to 20 of group 0, servers 20 to 39 those | ||
| of group 1, and so on. On OpenMU the ID is the game server's *Server ID* in the | ||
| admin panel; to put a server into a second group, give it an ID from 20 to 39. | ||
|
|
||
| - **Groups:** one button per group, in the order of the list. A server whose | ||
| group is not in the list is not shown at all. | ||
| - **Test server:** of the groups marked as test server, the login screen | ||
| shows only the first, at its place in the list; the others are hidden. | ||
| - **Channels:** each channel is shown as `<group name>-<channel>`, followed by | ||
| its type: | ||
|
|
||
| | Type | Shown as | Button | | ||
| |-----------|------------------------|---------| | ||
| | `normal` | `Valhalla-1` | gray | | ||
| | `nonPvp` | `Valhalla-1(Non-PVP)` | default | | ||
| | `goldPvp` | `Valhalla-1(Gold PVP)` | orange | | ||
| | `gold` | `Valhalla-1(Gold)` | orange | | ||
|
|
||
| The type only names and colors the channel; whether PvP is on is decided by | ||
| the server. | ||
| - **PvP notice:** the warning about crowded PvP servers is shown for a group | ||
| that has no `nonPvp` and no `gold` channel. | ||
| - **Description:** shown below the channels while the group is selected. | ||
|
|
||
| ## The file | ||
|
|
||
| ```json | ||
| { | ||
| "formatVersion": 1, | ||
| "groups": [ | ||
| { | ||
| "id": 0, | ||
| "name": "Valhalla", | ||
| "channels": {"1": "gold", "5": "goldPvp", "6": "nonPvp"} | ||
| }, | ||
| { | ||
| "id": 1, | ||
| "name": "Helheim", | ||
| "description": "PvP everywhere" | ||
| }, | ||
| { | ||
| "id": 9, | ||
| "name": "Test", | ||
| "testServer": true | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| | Field | Meaning | | ||
| |---------------|--------------------------------------------------------------------------| | ||
| | `id` | The group: server ID / 20, from 0 to 3276. Each group once. | | ||
| | `name` | The button text and the start of each channel name; up to 32 characters. | | ||
| | `description` | Optional; up to 254 characters. | | ||
| | `testServer` | Optional; `true` marks a test server group: only the first is shown. | | ||
| | `channels` | Optional; the type of a channel by its number (1 to 20). Channels not listed are `normal`. | | ||
|
|
||
| A name or description that is too long is cut (a warning in the log). Most | ||
| emoji count as two characters, as the client stores them on Windows. | ||
|
|
||
| ## Editing in MU Editor | ||
|
|
||
| **Windows → Server List** shows the groups in their order on the left and the | ||
| selected group on the right: its ID (with the server IDs it covers), name, | ||
| description, the test server mark, and a type for each of the 20 channels with | ||
| the name the login screen gives it. | ||
|
|
||
| - The login screen shows each change right away, while the window is open. | ||
| - **Add**, **Remove**, **Move up** and **Move down** change the list. | ||
| - When the connect server sent servers of groups the list does not have, the | ||
| window lists them with their server IDs; **Add** there adds a group with that | ||
| ID. The channel table shows which channels the connect server sent, with | ||
| their load. | ||
| - **Save** writes `Data/Local/ServerList.json` in the folder the game runs | ||
| from. It refuses a list with errors (a group without a name, an ID used | ||
| twice) and lists them. When the file itself had errors as it was read | ||
| (changed by hand while the game ran), the window has only the groups that | ||
| could be read: Save stays off then, so it cannot remove the others, until | ||
| the file is fixed and **Revert** reads it again. | ||
| - **Revert** reads the file again. | ||
| - **Undo** and **Redo** in the editor bar (or Ctrl+Z and Ctrl+Y in the window) | ||
| work through the changes of the session. The bar's buttons act on the tool | ||
| used last: after a click into the Server List window they undo server list | ||
| changes, after a click into an item tool item edits. | ||
|
|
||
| ## Compared to the original client | ||
|
|
||
| `ServerList.bmd` held the same groups, encrypted, with channel types for the | ||
| first 15 channels only and a left, right or center position for each button. | ||
| The original screen drew the center one, a test server, as a button of its own; | ||
| the login screen now lists all groups in one column in the list's order, so | ||
| only "test server" is kept, for the rule that only the first is shown. The | ||
| original loader read each group's description but never kept it, so the login | ||
| screen showed none; the JSON description is shown. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking. This describes the shared Undo and Redo, but docs/dev-editor.md:47 (outside the diff) still says the editor window's bar has "Undo and Redo of the item tools", and item-data.md:823 points there for the bar's Undo. Since f8fe9cd they act on the tool used last, the item tools or the Server List window. One sentence there, like the last one of this item, would match. Rule 11 of docs/CODING_RULES.md: "New, changed, or removed systems get a docs update".