RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Small Main.cs fix

Ohms_Law

Wanderer
Small Main.cs fix

Here's a silly little fix that I just noticed that someone might be interested in.

In RunUO 1.0,
Main.cs Line 628, originally:
Code:
            timerThread.Join();
            Console.WriteLine( "done" );
now, if you compile and run the RunUO server without scripts, or simply fail it somehow, you'll receive a:
System.Threading.ThreadStateException was unhandled
Message="Thread has not been started."
Source="mscorlib"
StackTrace:
at System.Threading.Thread.JoinInternal()
at System.Threading.Thread.Join()
at Server.Core.HandleClosed()
at Server.Core.CurrentDomain_ProcessExit(Object sender, EventArgs e)

here's something that I came up with in five minutes to "fix" this little issue:
Code:
            if (timerThread.ThreadState == System.Threading.ThreadState.Running)
                timerThread.Join();
            else
                timerThread.Abort();
of course, the 2.0 version may have changed this all completely...
*shrug*

Takes care of the Exception at least.
 
Top