Repository navigation
Conversation
The server keeps the potion keys (Q, W, E, R), auto attack, whisper sound, slide help and the chat box size and transparency with the key configuration. The client sent them only at an exit (menu, window close, a map server change), so a crash, a killed game or a lost connection dropped every change since the last exit. Skill keys were already saved as they change; the other settings now are too, through SaveOptionsIfInGame(), which sends only in game and after the server's configuration arrived. Setting a potion key that is already set sends nothing.
A warp saved the key configuration only for warps the code knew to lead to another game server (warps 24 and 44, or leaving Battle Castle or the United Market Place). A server with another layout lost the changes since the last save when the warp ended the session. The warp window, the warp chat command and the control socket's warp now save before every warp, and IsTheMapInDifferentServer is gone.
The M window's warp list (and /move, the warp chat command) came from
Data/Local/<lang>/movereq_<lang>.bmd, one file per data language. It now comes
from Data/Maps/Warps.json, one list with the names per language
({"en", "es", "pt"}), "command" (the old sub name /move takes), level, zen
and gate, in the order the M window shows them. The file has a reader,
writer and checks (an index two warps have is fatal, a name longer than the
game holds a warning), a table (g_WarpDatabase) and Load/Save/Revert, as the
map object sounds have.
The names follow the data language, as the bmd files did (Eng -> en,
Por -> pt, Spn -> es; English for one the client doesn't know). Max level is
dropped: nothing read it. OpenMU's WarpListExtended merge works as before on
the entries built from the file.
A one-time test compares the list of the old bmd reader with the one built
from the JSON for en, pt and es: every warp in order with its index, name,
sub name, level, zen and gate.
The warp list comes from Data/Maps/Warps.json since the last commit, which the one-time comparison test showed to give the same list in every language. The bmd files (Eng, Por, Spn and the Japanese Data/Local/Movereq.bmd, which nothing read), their reader and the comparison test are gone, with the files' entries in Data/Maps/Files/Shared.json. Left out of the old code because it changes nothing: - BuxConvert (the files' XOR) and the 84-byte entry layout; - the max level of each warp (MOVEREQINFO::m_iReqMaxLevel), which nothing read; - Script_Movereq, an unused copy of the entry.
What a character needs to warp was code that matched warps by their translated names: the 2/3 level of Magic Gladiators, Dark Lords and Rage Fighters except for a level of 400, wings or a flying mount for Icarus, no Horn of Uniria or Dinorant for Atlans, Vulcanus closed on non-PvP servers and warp 42 for Gens members on PvP servers. Data/Maps/Warps.json has them now: - "classLevelDiscount" (top level): the classes that need less level, as numerator/denominator, computed in float and cut as before; - per warp "noClassDiscount" (warp 33), "pvpServersOnly" and "gensOnly" (warp 42), "needsOneOf" and "notWith" (lists of items, item tags with an "except" tag, or any wings; Icarus 23, Atlans 11-13) and "blockedMessage", the key of the game text the chat shows when the equipment blocks a warp; empty is the new general text "You can't warp there with your equipment.", in every language of the game texts; - "minMasterLevel" and "minResets" (0 = none; no warp sets them): the M window's level column adds " ML n" / " R n" when set. One evaluation (GameLogic/Warps/WarpRules) serves the M window (the strife mark, the warps it greys out and the shown level), the chat's /move and warp word, and the control socket's warp (which uses the window's check). A warp takes its rules from the data entry with its index; a warp only the server sends has none, as no name rule matched those. A needed item counts when it is not broken (durability above 0), as the flight check did; an item of a rule matches in any equipment slot, which gives the same results because the item data puts every flying mount and horn in the pet slot and every transformation ring in the ring slots (a test checks this). The game texts have no lookup by key, so the texts a warp may name are listed in Data/GameData/MapData/WarpMessages (the two old messages and the general one); an unknown key or item tag is a warning for now. Kept as it was in the chat check (IsIllegalMovementByUsingMsg): - the warp a text names is the first of the list whose shown name is in the text, or whose /move name is in it in any case; - the warp word is searched in the text in capitals, so a warp word in small letters (English "/warp") never triggers the check; - only the equipment rules apply there (level, zen and the others are the server's), and an "except" of a rule does not: the chat blocked Icarus with the panda and skeleton rings too, the M window doesn't. A one-time test runs a copy of the old code against the rules with the shipped items and warps, English texts and names: every warp of the data list and of a merged server list x every class x level and zen limits x PK x PvP or not x Gens or not, every pet, wing and ring (also broken), and /move and warp word texts with horns, wings and rings: no difference in 3.5 million cases.
The M window, the chat's /move and warp word and the control socket's warp use the rules of Data/Maps/Warps.json since the last commit, which the one-time comparison test showed to give what the old code gave. The test (with its copy of the old code) and CChangeRingManager's CheckBanMoveIcarusMap, which only the old Icarus check used, are gone. Left out of the old code because it changes nothing: - the matching of warps by their translated names (I18N::Game::Icarus, Atlans as a prefix, Vulcanus): the rules belong to the warp's index; - the fixed strife index 42 and the level 400 that had no class discount: "gensOnly" and "noClassDiscount" in the data; - the per-slot item checks (helper type, CheckBanMoveIcarusMap's two ring slots, HasFlightEquipment's helper and wing slot): the rules look at every equipment slot, and the item data allows these items in only one; - the chat check's three flags (can't fly, can't swim, transformation ring), worked out for every text even without /move; - the unused local "a = gMapManager.WorldActive" of SettingCanMoveMap.
The M window named the warps in the data language (Eng, Por, Spn), as the
movereq files did, so a German or Polish UI showed English names and a
Portuguese UI with English data English ones. The names now follow the UI
language, as the monster names do: the language of I18N::GetCurrentLocale()
when the list loads, and again whenever it changes (a locale observer), with
the English name where a warp has none in that language (Warps.json has
en, es and pt).
A change renames the list the window shows at once: the warps of the data
files, and of a server's list (OpenMU) the ones it has from the data files,
with the server's levels and costs; a warp only the server has keeps the
server's name. /warp and /move take the shown name and the English /move
name ("command") as before.
CMoveCommandData::GetWarpNameLocale (data language -> locale) is gone with
its test; nothing else used it.
…tems The checks of Data/Maps/Warps.json (ValidateWarps) warn now also about what the reader takes but is probably wrong: - a name or /move name with a space (/move takes the name as one word); - a class level discount with numerator 0 (no level needed) or above its denominator (more level than the warp asks); - an entry of "needsOneOf" or "notWith" that the list has before, and a tag entry whose "except" is its own tag (it matches no item); - a blocked message of a warp without equipment rules (never shown). An item a rule names that the item list does not have is an error (ValidateWarpItems, with the game's item list ValidateWarpItemsInGame): the entry matches no item. The game logs it at start, after the item list. The largest level, gate and discount part the reader takes are named in WarpsJson.h for the editor's fields.
Windows > Warp List shows the warps of the M window in its order: a search
and the list ("index name") on the left, the picked warp on the right with
its index, its names in every language of the UI (English required, the
others falling back to it), /move name, level, zen, gate (the server's
landing spot, which the client doesn't use), no class discount, master
level and resets (0 = none) and its rules: Needs one of and Not with
(items with their names, item tags with the number of items they match,
listed on hover, and "except" for Not with, or any wings), PvP servers
only, Gens members only and the blocked message (the general one or a
warp message, with its text). The class level discount of all warps is
the collapsing section at the bottom.
The game takes each change at once (the warp table and the M window's
list); Save writes the file through WarpStorage, the same text the file
has when nothing changed, Revert reads it again. Add warp, Copy, Remove,
Move up and Move down and every field are steps of the editor bar's Undo
and Redo ("Add Warp7", "Icarus: Level"), as in the Server List window. An
index another warp has stays with that warp.
Data Checks has an area for the warps: the list as the game and the
window have it, read back as the file would be (unknown item tags and
message keys, an index two warps have, a missing English name, a name or
/move name with a space), and its items checked against the item list; a
click opens the Warp List.
The editor texts are in English, German and Polish, as the other tools'.
The chat's check of /move and the warp word (CheckChatWarp) left out the "except" of a rule entry, as the old code did: wings with a Panda or Skeleton transformation ring could not /move to Icarus although the M window allowed it. The check now applies the same equipment rules as the M window, and IsEquipmentAllowed lost its applyExcept parameter, which only the chat used.
…st window docs/warp-list.md describes the warp list file now: every key with Icarus (23), Swamp of Calmness (33) and Vulcanus (42) as examples, the order, the names per UI language with the English fallback and the live rename, the /move name, the gate as information, the class level discount and noClassDiscount, needsOneOf/notWith (item, tag with except, wings), pvpServersOnly, gensOnly, minMasterLevel/minResets with the " ML n" and " R n" column text, the blocked message keys and the general text, how OpenMU's WarpListExtended still overrides the list, the chat's /move check and the quirks it keeps, the key configuration saved before every warp and as it changes, the file's problems, the Warp List window and its Data Checks area. The editor guide lists the Warp List window, its Undo and Redo and its Data Checks area; the map data, item data (flight equipment) and translation docs link the page.
…its warp list OpenMU sends WarpRequirementsExtended (C2 F5 0B) right after WarpListExtended (F5 09): the minimum master level and resets of the listed warps which need one of them, and nothing when no warp does. The client reads it next to the warp list and applies it to the server's list. Like level and zen, the master level and resets are the server's while its list applies: a warp of the server's list without an entry needs neither, even if Data/Maps/Warps.json sets minMasterLevel or minResets for it. Because the message is left out when no warp has a requirement, the data file's values can't be kept until it arrives: a new F5 09 starts at 0/0 and F5 0B sets the values of its entries. An F5 0B without a server list is ignored (its indexes are the ones of that list), an entry for a warp the list doesn't have changes nothing, and of entries with the same index the first counts, as with the warps. RestoreDataFileWarpList goes back to the data file's values, together with its list. The list entry (MOVEREQINFO) now carries the master level and resets like level and zen, so EvaluateWarp and GetRequiredLevelText take the entry: the M window greys out a warp and adds " ML n" / " R n" from the list's values, which also gives a warp only the server has its requirements.
The warp names of all UI languages move to a Translations tab of the Warp List window, the names grid of the Monster Translations window: one column per language, search, Missing in. The warp details keep the English name. A name edit is an undo step and reaches the M window at once.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The M window's warp list (and
/move,/warp) is data now:src/bin/Data/Maps/Warps.jsonreplaces themovereq_<lang>.bmdfiles, the move rules that were hard-coded are fields of each warp, and MuEditor gets a Warp List window. The client also saves the key configuration as it changes and before every warp.What it does
/movename, level, zen and gate. The four movereq bmd files are removed (also the unused JapaneseData/Local/Movereq.bmd). The max level is dropped: neither the client nor OpenMU checks it./moveand the control socket):noClassDiscounton Swamp of Calmness (33) replaces the old "level 400" check;needsOneOf/notWith: single items, item tags (withexcept) or any wings. Icarus (23) needs wings or aflyingmount and not Horn of Uniria or a transformation ring except panda/skeleton; Atlans (11-13) not Horn of Uniria or Dinorant;pvpServersOnlyandgensOnly(Vulcanus 42);blockedMessage: which text a blocked/moveshows; the two old messages stay, a new general text covers other warps;minMasterLevelandminResets(0 = none); the Level column adds "ML n" / "R n" when set./move), unknown message keys, odd values.IsTheMapInDifferentServeris removed.docs/warp-list.mdrewritten; links from dev-editor, map-data, item-data, translation-system.OpenMU's
WarpListExtendedstill overrides level and zen, as before; a warp that is also in the data file keeps its rules. The newWarpRequirementsExtended(C2 F5 0B, MUnique/OpenMU#1547) also sets master level and resets for the server's warps; the server's list wins for them like for level and zen.How it was checked
map_data_tests40/40 in Release (reader/writer, rules, master level and resets, UI-language rename, the Warp List window, Data Checks); every new test fails under a mutation.What players see change (each in its own commit)
/move Icaruswith wings and a Panda or Skeleton ring works, as the M window already allowed.Decided by me
Data/Maps/Warps.json; the key isnameper language, as Monsters.json.{"item": {"group": 13, "number": 2}}.needsOneOfcounts only items that are not broken.WarpMessages): the game texts have no lookup by key.Not done here
map_file_lists_testsfails on main already (OptionRules.json missing in Shared.json); not touched.Size
About 5.3k added lines in 13 commits.