I was bored so I thought I would release some easy shiz. Credits to Impulse for his Thread.cs
Goto Program.cs find
Code:
Console.WriteLine("The server is ready for connections.");
Code:
ServerThread = new ServerThread;
Code:
Main.Thread CompanionThread = new Main.Thread(100);
CompanionThread.Execute += new Action(CompanionThread_Execute);
Main.Thread ServerStuff = new Main.Thread(100);
ServerStuff.Execute += new Action(ServerStuff_Execute);
Main.Thread MobThread = new Main.Thread(100);
MobThread.Execute += new Action(MobThread_Execute);
GC.KeepAlive(CompanionThread); GC.KeepAlive(ServerStuff); GC.KeepAlive(MobThread);
Replace everything inside with
Code:
using System;
using System.Threading;
namespace COEmulator.Core
{
public class Thread
{
private readonly System.Threading.Thread _baseThread;
public event Action Execute;
public int LoopInterval { get; set; }
public ThreadPriority Priority { get { return _baseThread.Priority; } set { _baseThread.Priority = value; } }
public bool Close { get; set; }
public Thread(int loopInterval)
{
LoopInterval = loopInterval;
_baseThread = new System.Threading.Thread(Loop) { Priority = ThreadPriority.Normal };
_baseThread.Start();
}
private void Loop()
{
while (true)
{
if (Close)
return;
try
{
if (Execute != null)
Execute.Invoke();
}
catch (Exception exception)
{
Console.WriteLine(exception);
}
System.Threading.Thread.Sleep(LoopInterval);
}
}
}
}






