Repository navigation
feat(warps): send the warp list to the open source client - #1504
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 34 |
| Duplication | 14 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
I think it would be maybe better to have a property in map like |
|
Thanks, good point. I'd put the flag on the warp entry instead of the map, though: a map can have several warps (Devias 1 to 4 all go to Devias, and the Season 6 data has two warps to LaCleon, 34 and 48, to the same gate), and a whole map can already be turned off with I'd keep it to the list, though. A hidden warp can still be used by its index, so "only for game masters" would be a separate feature (a check in If this gets merged, I'm planning a follow-up with a warp list page in the admin panel, instead of the generic grid:
I'd open an issue for it first, so the layout of the page can be discussed. |
6ccf573 to
a6caa19
Compare
But Crywolf is not a map the client can warp to (only walk)! The point is to keep that by default. If admins want to enable it, then they can do it in Admin Panel. I don't see the point of not showing a warp but still allowing it by index for a regular player. Anyway, this is just my view, maybe sven thinks differently. |
|
Before this PR, a regular player could already warp to Crywolf or Loren Market with So the intention of this PR was to let the warp window show, if wanted, the same warps which Restricting warps for regular players, both in the list and for
|
sven-n
left a comment
There was a problem hiding this comment.
This PR conflicts with current master, so I can't merge it. Please rebase it onto master. These files conflict:
src/GameLogic/Properties/PlugInResources.resx
Most of them are resource files (.resx / .Designer.cs) which other merged PRs also extended. When you resolve them, keep the entries of both sides, and regenerate the designer file instead of merging it by hand. I'll review it in full once it's rebased.
Generated by Claude Code
…e client The open source client takes its warp list from its data files, which follow Webzen's Season 6. Warps which OpenMU has and Webzen doesn't, like Crywolf and Loren Market, can't be selected there, and the client can't add them to its files because it's used with Webzen's servers, too. WarpListExtended (C2 F5 09) carries the warp list of the server: per warp the index, map, level requirement, costs and the name in the player's language.
When a character enters the game, the server sends its warp list to the open source client (WarpListExtended), so that its warp window offers the warps of the server instead of the ones of its data files. Original clients don't get it: the view plugin exists only for the open source client. The warps are ordered by index; warps without a map are left out, and of warps with the same index only the first one is sent, because it's the one which a warp request uses. Names which don't fit into the 32 bytes of the field are shortened to whole characters instead of failing the message. The mocked game configuration of the tests gets an empty warp list, like its other collections.
WarpInfo.IsShownInWarpList (default true) decides whether the warp is sent to the open source client. It only affects the list: a warp which isn't shown can still be used by its index. This allows to hide e.g. a second warp to the same place, like LaCleon (48) next to Raklion (34) in the season 6 data. The migration adds the column with true for the existing warps; the compiled model and the generated loader code include the new property.
…iginal warp window As suggested in the review, the flag is WarpInfo.IsWarpable, and it restricts the warp instead of only leaving it out of the list. Hiding a warp alone didn't keep players away from it: they could still use it by its index, e.g. with the move chat command. When it's off, the warp isn't sent to the open source client, and WarpAction refuses it for characters below game master status with a message. Bots warp through WarpAction like players, so they don't pick these warps either. A new season 6 configuration has it off for the warps which the original client doesn't offer in its warp window: Crywolf (26), reached by walking, Loren Market (44), reached through an NPC, and LaCleon (48), which the client offers as 34. The optional update RestrictWarpsOutsideOfOriginalWarpWindowPlugIn does the same for existing configurations; it's optional because it changes what the players of a running server can do. The migration replaces the one of IsShownInWarpList (not merged yet).
…e logic Regenerated from PlugInResources.resx after resolving the conflict with master, instead of merging the designer by hand. The properties are in the order of the generator, and the ones of CastleSiegeGuardsmanTalkPlugIn, which were in the resx but not in the designer, are added.
500668c to
224d294
Compare
|
Rebased onto current master. The conflict in I regenerated No migration was added on master in between, so |
sven-n
left a comment
There was a problem hiding this comment.
Thanks for the rebase. The open source client's warp list (WarpListExtended) is sent after entering the world. IsWarpable is enforced in WarpAction (game masters excepted) and respected by the bots. The migration adds the column with defaultValue: true, so existing warps stay usable, and the update which restricts Crywolf, Loren Market and the second LaCleon warp is optional. That's the right call, since it takes something away from running servers.
The fully regenerated GameLogic/Properties/PlugInResources.Designer.cs makes the diff big, but I checked it: it's the same set of strings (plus two which were missing on master), only in the generator's standard form, which is what the rules ask for.
I built it on current master and ran the tests, including Persistence.Initialization.Tests (858 passed): everything passes except the known flaky ControllerCreatedAfterDisposalIsDisposedAsync, which is unrelated.
Nit for later: RestrictWarpsOutsideOfOriginalWarpWindowPlugIn returns English constants for Name/Description, although the Display attribute already points to localized resources.
Generated by Claude Code
Closes #1503
The open source client takes its warp list from its data files, which follow Webzen's Season 6 (see #1503, sven-n/MuMain#1057), so it can't follow the warp list which the server is configured with. With this change the server sends its warp list to the open source client when a character enters the game; original clients don't get it.
Following the review,
WarpInfo.IsWarpabledecides which warps players can use. By default that's the warp window of the original client: Crywolf and Loren Market weren't in it, since Crywolf is reached by walking and Loren Market through an NPC, so they're game master only now. An admin who wants them in the warp window turns them on in the admin panel. Before this change, any player could already use them by their index, e.g. with/move Crywolf.Changes
WarpListExtended(C2 F5 09, server to client), in the XML with the generated code, docs and tests: a count, then per warp the index, map number, level requirement (as configured), costs and the name (32 bytes, UTF-8).IShowWarpListPlugIn, implemented only byShowWarpListExtendedPlugInwith[MinimumClient(106, 3, ClientLanguage.Invariant)], likeShowShopCurrenciesExtendedPlugIn. The name isWarpInfo.Namein the player's culture; a name which doesn't fit into the 32 bytes is shortened to whole characters instead of failing the message.ShowWarpListAfterEnterWorldPlugIn(IPlayerStateChangedPlugIn,CharacterSelection→EnteredWorld, so not on map changes): sends the warps ordered by index, without warps whose gate has no map, and of warps with the same index only the first one, because that's the oneWarpHandlerPlugInuses.WarpInfo.IsWarpable(default true), as suggested in the review. It only restricts players, and only when it's off: then the warp isn't sent to the client, andWarpActionrefuses it for characters below game master status, with a message (WarpOnlyForGameMasters, en/de/pt). Game masters can still use it. Bots warp throughWarpActionlike players, soBotNavigator.GetLegalWarpsleaves these warps out.RestrictWarpsOutsideOfOriginalWarpWindowPlugIndoes the same for existing configurations, for warps which still lead to their original map; it's optional because it changes what the players of a running server can do (today any player can use these warps, e.g./move Crywolf).AddWarpInfoIsWarpable(existing warps stay warpable), with the compiled model and the generated loader code updated; caption and description in English and German.PlayerTestHelper.CreateGameConfigurationsets up an empty warp list, like its other collections. Without it, the existing tests which enter the world with that mock failed on the new plugin.The client side is sven-n/MuMain#1110. It reads the message by hand, like the other F5 messages, so it doesn't need a new package version.
Testing
WarpListTests: the fields of the message (including the translated name), the shortened names, that only client 106.3 gets the view plugin, the selection and order of the warps, that warps which aren't warpable are left out (also when such a warp is the first of its index), that a player is refused such a warp (with the message, and without paying) while a game master isn't, and that the list is sent after entering the game but not after a map change. NewWarpableWarpsTest: a new season 6 database has exactly 26, 44 and 48 not warpable; the update does the same on a database which has them warpable, leaves a warp alone whose map was changed, and a second run changes nothing.dotnet build src/MUnique.OpenMU.sln, thendotnet test src/MUnique.OpenMU.sln --no-build: everything passed (MUnique.OpenMU.Tests 2899 passed, 2 skipped, includingCompiledModelTestsandGameConfigurationLoaderGeneratorTest; Persistence.Initialization.Tests 853 passed, 12 skipped; the other projects passed.MapComponentTests.ControllerCreatedAfterDisposalIsDisposedAsyncin the Web tests failed in two runs while the machine was busy with a docker build, and passed every time the project ran without load; it's about the live map, not this change).warp, which takes the entry by name) and with/warp LorenMarketin the chat box;/move Crywolfof a normal character is refused with the message and the character stays in Lorencia; the same/move Crywolfof a game master character warps to Crywolf;ShowWarpListExtendedPlugIndeactivated, the client falls back to its own list (no Crywolf), as with a server which doesn't know the message.Notes
C1-11-ObjectHit*_by-server.md,C1-48-ShowEffect_by-server.md); I left them out of this PR.