Almost Working on Mono

There’s apparently a strange quirk to the XmlElementAttribute where you have to specify the data type for any type that isn’t a string (you’d think it would auto-detect an int property!)

So, with this:

///
/// The id number of the race.
///
[XmlElement("_number", typeof(int))]
public int Number
{
get { return _number; }
set { _number = value; }
}

Everything now loads, boots up, and characters can log in. However, when entering the game, there’s a NullReferenceException that happens on Mono (but not on the Windows version):

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at BasternaeMud.CharData.ResetStats () [0x00000]
at BasternaeMud.SocketConnection.ProcessMenuSelection (System.String argument) [0x00000]
at BasternaeMud.SocketConnection.ConnectionStateManager (System.String argument) [0x00000]
at BasternaeMud.SocketConnection.ProcessPlayerActions () [0x00000]
at BasternaeMud.SocketConnection.MainGameLoop (System.Net.Sockets.Socket control) [0x00000]
at BasternaeMud.Program.Main (System.String[] args) [0x00000]

So far it seems that this only happens for existing players. Creating a new player doesn’t cause this to happen. Might take quite a bit of effort to track down.