## 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 KiB
2 KiB
| name | description |
|---|---|
| migrate-packets | Trigger: when converting RunUO Packet subclasses, PacketWriter/PacketReader, or packet handler registration to ModernUO span-based packets. Covers: outgoing packet conversion, incoming handler conversion, SpanWriter/SpanReader. |
RunUO -> ModernUO Packet Migration
When This Activates
- Converting
Packetsubclasses to static create methods - Converting
PacketHandlers.Register()toIncomingPackets.Register() - Converting
PacketWriter/PacketReadertoSpanWriter/SpanReader
Conversion Steps (Outgoing)
- Create static class:
public static class OutgoingMyPackets - Define length constant
- Convert constructor to
static void CreateXxx(Span<byte> buffer, ...) - Replace
m_Stream.Write(x)withwriter.Write(x) - Create
SendXxx(this NetState ns, ...)extension method - Check
ns.CannotSendPackets()at start - Use
stackalloc byte[length].InitializePacket()for buffer - Replace
ns.Send(new Packet(...))withns.SendXxx(...)
Conversion Steps (Incoming)
- Change
PacketHandlers.Register(id, len, ingame, new OnPacketReceive(H))toIncomingPackets.Register(id, len, ingame, &H)inunsafe Configure() - Change handler:
void H(NetState, PacketReader)->void H(NetState, SpanReader) - Replace read calls:
pvSrc.ReadString()->reader.ReadAsciiSafe()
Quick Mapping
| RunUO | ModernUO |
|---|---|
class X : Packet |
Static CreateX(Span<byte>) method |
m_Stream.Write(val) |
writer.Write(val) (SpanWriter) |
PacketWriter |
SpanWriter |
PacketReader / pvSrc |
SpanReader / reader |
ns.Send(new X(...)) |
ns.SendX(...) extension |
PacketHandlers.Register(...) |
IncomingPackets.Register(... &handler) |
new OnPacketReceive(H) |
&H (function pointer) |
See Also
dev-docs/runuo-migration-docs/05-packets-networking.md-- detailed migration referencedev-docs/networking-packets.md-- complete ModernUO networking systemdev-docs/claude-skills/modernuo-networking.md-- ModernUO networking skill