## Summary Adds comprehensive RunUO → ModernUO migration documentation and Claude AI skills to help shard owners and script authors convert RunUO 2.7 code to ModernUO. - **10 migration skills** (`dev-docs/claude-skills/migrate-from-runuo/`) — system-by-system conversion guides (foundation, serialization, timers, gumps, packets, property lists, commands/events, persistence, items/mobiles, systems/engines) - **12 reference docs** (`dev-docs/runuo-migration-docs/`) — deep-reference with before/after examples, API mapping tables, edge cases, and gotchas - **Updated existing skills** — `modernuo-timers`, `modernuo-serialization`, and `modernuo-threading` now document that `Serialize()` runs on background threads and timers are not thread-safe - **Updated `CLAUDE.md`** — added migration skill lookup table ### Key migration patterns covered - Manual `Serialize()`/`Deserialize()` → source-generated `[SerializableField]` - `Packet` class hierarchy → static `SpanWriter`/`SpanReader` methods - `Timer` subclasses → `TimerExecutionToken` fire-and-forget - `Gump` → `StaticGump<T>`/`DynamicGump` with builders - `EventSink.WorldSave` → `GenericPersistence` - `ObjectPropertyList` → `IPropertyList` with string hole rules - Universal changes: naming (`m_` → `_`), `[Constructable]` → `[Constructible]`, logging, spatial queries
2.2 KiB
2.2 KiB
| name | description |
|---|---|
| migrate-foundation | Trigger: when migrating ANY RunUO code to ModernUO. Always load this skill first. Covers: namespace changes, naming conventions, attribute renames, logging, threading, performance. |
RunUO -> ModernUO Foundation Migration
When This Activates
- Converting ANY RunUO 2.7 script to ModernUO
- Always apply these changes FIRST before system-specific migration
Universal Changes Checklist
- File-scoped namespace:
namespace X { ... }->namespace X; using ModernUO.Serialization;-- add for any serializable type- Rename fields:
m_FieldName->_fieldName [Constructable]->[Constructible]Console.WriteLine->LogFactory.GetLogger(typeof(X))->logger.Information(...)DateTime.UtcNow->Core.NowWorld.Mobiles/World.Itemsiteration -> spatial queries (map.GetMobilesInRange<T>())- Remove
lock,volatile,ConcurrentDictionary,Mutex-- server is single-threaded - Remove
Task.Run,new Thread-- useTimer.StartTimer()instead ArrayPool<T>.Shared->STArrayPool<T>.Sharednew List<T>()on hot paths ->PooledRefList<T>.Create()- Modernize property syntax:
{ get { return x; } }->{ get => x; } - Delete
MyType(Serial serial) : base(serial)constructor -- auto-generated Name = "text"in constructor ->public override string DefaultName => "text";
Quick Reference
| RunUO | ModernUO |
|---|---|
[Constructable] |
[Constructible] |
m_Field |
_field |
Console.WriteLine(...) |
logger.Information(...) |
DateTime.UtcNow |
Core.Now |
MyItem(Serial serial) : base(serial) |
DELETE |
lock (_obj) { } |
Remove entirely |
ConcurrentDictionary |
Dictionary |
ArrayPool<T>.Shared |
STArrayPool<T>.Shared |
Anti-Patterns
- Don't rename existing
m_fields in code you're not otherwise migrating - Don't add threading constructs -- everything is single-threaded
- Don't use allocating LINQ (
.ToList(),.GroupBy(), etc.) on hot paths
See Also
dev-docs/runuo-migration-docs/01-foundation-changes.md-- complete foundation changes referencedev-docs/code-standards.md-- ModernUO coding standards and LINQ tiersdev-docs/threading-model.md-- Why single-threaded, what's allowed