Its set so this thread runs every 500ms. Im aware here arent any Try/Catch blocks. They didnt catch anything.
After some jumping, or just waiting the thread stops. I cant figure out where the problem is at... Its not a dead loop, not a dead lock,...
Edit: This way seems to work... atleast works since now but idk why.. Im just scared itll crash at one point tho
After some jumping, or just waiting the thread stops. I cant figure out where the problem is at... Its not a dead loop, not a dead lock,...
PHP Code:
public static void CharThread()
{
lock (Kernel.AllChars)
{
foreach (KeyValuePair<uint, Character> Charr in Kernel.AllChars)
{
Character MyChar = Charr.Value;
if (MyChar.DoubleEXP)
{
DoubleExp.Handle(MyChar);
}
if (MyChar.Attacking)
{
HandleAttack.Attack(MyChar);
}
if (MyChar.CastingPray || MyChar.Praying)
{
LuckyTime.Handle(MyChar);
}
GeneralHandling.Handle(MyChar);
}
Thread.Sleep(1);
}
}
PHP Code:
public static void CharThread()
{
lock (Kernel.AllChars)
{
IDictionaryEnumerator DE = Kernel.AllChars.GetEnumerator();
try
{
while (DE.MoveNext())
{
Character MyChar = (Character)DE.Value;
if (MyChar.DoubleEXP)
{
DoubleExp.Handle(MyChar);
}
if (MyChar.Attacking)
{
HandleAttack.Attack(MyChar);
}
if (MyChar.CastingPray || MyChar.Praying)
{
LuckyTime.Handle(MyChar);
}
GeneralHandling.Handle(MyChar);
}
}
finally
{
IDisposable disposable = DE as IDisposable;
if (disposable != null)
disposable.Dispose();
}
Thread.Sleep(1);
}
}