-
-
Notifications
You must be signed in to change notification settings - Fork 221
4. Migrating From RunUO
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!
| 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 |
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:
-
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)
ModernUO improves gump performance significantly and streamlined the code:
-
OnResponse requires the
inkeyword:β 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
ModernUO significantly improved and streamlined object property lists.
π See: Object Property List Guide for details.
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:
There is no replacement for TimerPriority since it isn't needed.
β Not valid
Priority = TimerPriority.OneSecond;ModernUO uses Serilog for async console logging:
-
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!"); }
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.
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
ModernUO has improved gathering the current date and time.
-
Use Core.Now exclusively:
β Recommended
var now = Core.Now;
β Not Recommended
var now = DateTime.UtcNow;
Spawner system upgrades:
-
New Commands:
[ExportSpawners[ImportSpawners[spawn[EditSpawner
-
Exported spawners now use GUIDs for better matching.
- 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
- Reporting system
- Remote Admin
- MyRunUO
- Event Log
- DocsGen command
Copyright Β© 2017-2025 Kamron Batman & ModernUO Dev Team, released under GPL 3.0