Acentech Dev 3aa9815b10 feat(castle-siege): adopt the upstream Castle Siege data model and persistence
Brings in the database layer of upstream OpenMU PRs #754 and #860 without
touching AdaMu's working Castle Siege gameplay. This is purely additive: the
existing 5-phase implementation still runs exactly as before.

What is included:

- DataModel: CastleSiegeState (the original Season 6 values 0-9, which are
  exactly what the game client's CASTLESIEGE_STATE enum expects),
  CastleSiegeJoinSide, and the zone/NPC/upgrade definition types.
- Entities: CastleSiegeData, CastleSiegeGuildRegistration, CastleSiegeNpcState.
  These identify a guild by its persistent Guid rather than by name.
- Generated persistence: 8 BasicModel + 8 EntityFramework model classes,
  CastleSiegeExtensions, and the regenerated ExtendedTypeContext,
  MapsterConfigurator and GameConfiguration partials.
- Migrations: 20260730194321_AddCastleSiege and
  20260801162427_ConfigureCastleSiegePersistence, plus the model snapshot.
- EntityDataContext gains the two DbSets and the five model registrations.
- EntityFrameworkContextBase only publishes configuration changes for entities
  in the configuration schema, so siege state writes are no longer broadcast as
  configuration changes.

AdaMu-specific adaptations:

- UpdateVersion.AddCastleSiegeData is 105, not upstream's 100. AdaMu already
  ships 95-104, and the applied-update bookkeeping is keyed on this value, so a
  collision would skip or re-run updates on live databases.
- CastleSiegeInitializer does not seed a weekly StateSchedule. Upstream drives
  the cycle from a fixed Saturday schedule; AdaMu drives it manually from
  CastleSiegeEventPlugIn and the AdminPanel, so the schedule is left empty and
  nothing reads it.

The seeded NPC definitions match AdaMu's existing hard-coded coordinates
exactly (6 gates, the two crown switches and the crown), and additionally
provide 4 guardian statues, 6 guardsmen and real gate/statue hit point tables
that the current implementation does not have yet.

Two pre-existing migrations were restyled by upstream (copyright header, using
placement, trailing comma). No functional change.

Verified: full server build succeeds with 0 errors.
2026-08-04 03:28:10 +03:00
2026-07-27 01:16:10 +03:00

OpenMU Project

License Codacy Badge Ask DeepWiki Discord chat

Platform Build Status
Windows Windows Build Status
Linux (Docker) Docker Build Status
NuGet Packages
MUnique.OpenMU.Network NuGet Badge
MUnique.OpenMU.Network.Packets NuGet Badge

This project aims to create an easy to use, extendable and customizable server for a MMORPG called "MU Online". The server supports multiple versions of the game, but the main focus is version of Season 6 Episode 3 using the ENG (english) protocol. Additionally, the long-term focus is on the open source client which supports a slightly extended network protocol. However, parts of the software can also be suitable for the development of other games, even for other kind of games.

The code is a complete rewrite from scratch - it's not based on pre-existing projects, and it's also explicitly not based on decompiled server sources or their countless derivates.

There also exists a blog which may contain some valuable information about this development.

Current project state

This project is currently under development without any release. You can try the current state by using the available docker image, also mentioned in the quick start guide.

Licensing

This project is released under the MIT license (see LICENSE file).

Used technologies

The project is mainly written in C# and targets .NET 10.0.

The servers admin panel is hosted on an embedded ASP.NET Core webserver (Kestrel) and implemented as Blazor Server App.

At the moment the persistence layer uses the Entity Framework Core and PostgreSQL as database. Additionally, it's also possible to start it in a non-persistent in-memory mode.

The project is prepared to be hosted in a single process or distributed in multiple processes. For the communication between the processes, we use Dapr.

Deployment

We provide Docker images and docker-compose files for easy deployment. Please take a look at the deploy-folder of this project.

Contributions

Contributions are welcome if they meet the following criteria:

  • Language is english.

  • Code should be StyleCop compliant - this project uses the StyleCop.Analyzers for VS2022 so you should see issues directly as warnings.

  • Coding style (naming, etc.) and quality should fit to the current state.

  • No code copied/converted from the well-known decompiled source of the original server.

If you want to contribute, please create a new issue for the feature or bug (if the issue doesn't exist yet) so we can see who is working on something and can discuss possible solutions. If it's a small thing, you can also just send a pull request without adding an issue.

Apart of that, contributions from non-developers are welcome as well. You can test the server, submit issues or suggestions, packet descriptions or documentations about the concepts and mechanics of the game itself. Please use markdown files/syntax for this purpose.

If you have questions about that, don't hesitate to ask in our discord channel or by submitting an issue.

How to contribute code

If you want to contribute code, please do the following steps:

  1. fork this project from the original MUnique OpenMU Project.
  2. create a feature branch from the master branch
  3. commit your changes to your feature branch
  4. please test your changes, don't send AI generated code without testing it yourself
  5. submit a pull request to the original master branch
  6. wait for the code review and merge :)

How to use

Please have a look at the quick start guide.

Gameplay differences to the original server

This project doesn't have the goal to copy the original MU Online server behavior to 100 %. This is not entirely possible, because the original server is written in another programming language and has a completely different architecture. With some points we make our life easier in this project, with other points we try to improve the gameplay.

Calculations

The calculations of attribute values (like character damage decrement etc.) are done with 32 bit float numbers and without rounding off, like the original server does at some places. E.g. distributed stat points always have effect, while in the original server effects might get rounded down. For example, when 4 points of strength gives 1 base damage, the original server doesn't calculate a fraction of 1 damage for 3 points, while OpenMU calculates 0.75 damage. This damage has then an effect in further calculations.

Countdown when changing character or sub-server

The original server uses a five second countdown when a player wants to change his character or the sub-server. Maybe this was done for some performance reasons, as the original server would then save the character/account data. We think that's really annoying and see no real value in that, so we don't use a countdown.

Description
No description provided
Readme MIT 51 MiB
Languages
C# 95.6%
CSS 1.8%
HTML 1.3%
XSLT 0.6%
JavaScript 0.4%
Other 0.2%