Skip to content

4. Migrating From RunUO

Kamron Batman edited this page Nov 13, 2025 · 2 revisions

Migrating from RunUO to ModernUO

Migrating an existing shard from RunUO to ModernUO is an enormous but rewarding project.

ModernUO takes advantage of over 20 years of improvements in technology β€” offering better performance, security, scalability, and a cleaner codebase for future growth.

While migrating an active server is possible (and has been done!), it can be daunting.
If you get stuck, please join our Discord and ask for help!


βš™οΈ Technology Differences

Feature RunUO ModernUO
Language C# 4 (.NET Framework 1.1) C# 14 (.NET 10)
Supported OS 32/64-bit Windows, Mono 64-bit Windows, MacOS, Linux

🧠 Key Migration Concepts

πŸ“¦ Serialization

Tip

Build new entities using the Serialization Source Generator

Serialize new systems using GenericPersistence or GenericEntityPersistence so they are saved properly and in parallel!

πŸ‘‰ See: Serialization Guide

ModernUO has significantly improved the serialization code:

GenericReader and GenericWriter have changed to interfaces:

  • Use the IGenericReader interface:

    βœ… Valid

    public override void Deserialize(IGenericReader reader)

    ❌ Not valid

    public override void Deserialize(GenericReader reader)
  • Use the IGenericWriter interface:

    βœ… Valid

    public override void Serialize(IGenericWriter writer)

    ❌ Not valid

    public override void Serialize(GenericWriter writer)

πŸ“œ Gumps

Tip

Build new gumps using the Gump Builder API

πŸ‘‰ See: Gump Builder Guide

ModernUO improves gump performance significantly and streamlined the code:

RelayInfo has been changed to a struct and streamlined

  • OnResponse requires the in keyword:

    βœ… Valid

    public override void OnResponse(NetState sender, in RelayInfo info)

    ❌ Not valid

    public override void OnResponse(NetState sender, RelayInfo info)
  • TextRelay was removed and RelayInfo is used directly:

    βœ… Valid

    info.GetTextEntry(index)

    ❌ Not valid

    info.GetTextEntry(index).Text

πŸ“œ Object Property Lists

ModernUO significantly improved and streamlined object property lists.

πŸ‘‰ See: Object Property List Guide for details.


⏳ Timers

Caution

Timers are NOT thread-safe.

DO NOT start/stop timers inside Serialize() or other threaded functions. Use THREADGUARD and DEBUG_TIMERS to debug timers.

ModernUO improved the timer system significantly:

TimerPriority was removed:

There is no replacement for TimerPriority since it isn't needed.

❌ Not valid

Priority = TimerPriority.OneSecond;

πŸ“‹ Logging

ModernUO uses Serilog for async console logging:

Console.WriteLine and Console.ReadLine can cause corruption:

  • Use logger.Information instead of Console.WriteLine

    βœ… Recommended

    private static readonly ILogger logger = LogFactory.GetLogger(typeof(YourClass));
    //.. farther down the file where you need to use the logger
    logger.Information("Something happened {Mobile}", from);

    ❌ Not Recommended

    Console.WriteLine($"Something happened {from}");
  • Use ConsoleInputHandler.ReadLine instead of Console.ReadLine

    βœ… Recommended

    if (!ConsoleInputHandler.ReadLine().InsensitiveEquals("y"))
    {
        throw new Exception("You didn't press Y!");
    }

    ❌ Not Recommended

    if (!Console.ReadLine().InsensitiveEquals("y"))
    {
        throw new Exception("You didn't press Y!");
    }

🌐 Networking

Caution

Sending/Receiving packets is NOT thread-safe.

DO NOT send/receive packets from other threads. Use THREADGUARD to debug threading issues with packets.

ModernUO has significantly improved and streamlined networking and sending/receiving packets.

The Packet class has been replaced with NetState extension methods.

πŸ‘‰ See: Networking API Guide for more details.


πŸ“ EventSink System

Many old EventSink events are now generated automatically for better performance:

Converted to Generated Events:

  • CharacterCreated
  • CreatureDeath
  • PlayerLogin
  • PlayerDeath
  • PlayerDeleted
  • GameServerLogin
  • ServerList
  • TargetByResourceMacro

πŸ‘‰ See: Code Generated Events Guide


⏰ Time and Date

ModernUO has improved gathering the current date and time.

Added Core.Now for getting the date and time now.

  • Use Core.Now exclusively:

    βœ… Recommended

    var now = Core.Now;

    ❌ Not Recommended

    var now = DateTime.UtcNow;

🧩 Spawners

Spawner system upgrades:

  • New Commands:

    • [ExportSpawners
    • [ImportSpawners
    • [spawn
    • [EditSpawner
  • Exported spawners now use GUIDs for better matching.


✨ New Features in ModernUO

  • IPv6 support
  • Automatic parallel serialization
  • Hourly/daily/weekly/monthly backup & archiving using Z-Standard.
  • Client version detection (including CUO) for easy configuration.
  • Improved localization (Cliloc) support
  • Packet throttling per connection and globally
  • Owner account protection

πŸ—‘οΈ Removed or Deprecated Features

  • Reporting system
  • Remote Admin
  • MyRunUO
  • Event Log
  • DocsGen command