Exemple #1
0
 public void StartTimer()
 {
     if (autoReleasor != null)
     {
         if (autoReleasor.Running) autoReleasor.Stop();
         autoReleasor = null;
     }
     if (!jailed)
     {
         release();
         return;
     }
     autoReleasor = new jailing(this);
     autoReleasor.Start();
 }
Exemple #2
0
        public void release(NetState ns)
        {
            try
            {
                try
                {
                    if (!(ns.Mobile.Region is Regions.Jail)) return;
                    ns.Mobile.SendLocalizedMessage(501659);
                }
                catch (Exception err)
                {
                    System.Console.WriteLine("{0}: {1} Mobile not released", JailSystem.JSName, err.ToString());
                    return;
                }

                if (autoReleasor != null)
                {
                    if (autoReleasor.Running) autoReleasor.Stop();
                    autoReleasor = null;
                }
                ReleaseLoc rl;
                try
                {
                    rl = (ReleaseLoc)releasePoints[ns.Mobile.Serial.Value];
                }
                catch
                {
                    rl = new ReleaseLoc();
                    rl.mobile = ns.Mobile.Serial.Value;
                    releasePoints.Add(ns.Mobile.Serial.Value, rl);
                }
                if (rl.release(this.freedBy))
                    releasePoints.Remove(ns.Mobile.Serial.Value);
            }
            catch (Exception err)
            {
                System.Console.WriteLine("{0}: {1}", JailSystem.JSName, err.ToString());
            }
            if (releasePoints.Count == 0)
            {
                System.Console.WriteLine("Jailing removed for account {0}", this.Name);
                try
                {
                    list.Remove(this.ID);
                }
                catch
                {
                }
            }
        }