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 { } } }
public virtual void Deserialize(GenericReader reader) { int imax = 0; int version = reader.ReadInt(); switch (version) { case 2: m_jailorAC = (AccessLevel)reader.ReadInt(); goto case 1; case 1: freedBy = reader.ReadString().Trim(); goto case 0; case 0: m_name = reader.ReadString().Trim(); m_releaseTime = reader.ReadDateTime(); imax = reader.ReadInt(); for (int i = 0; i < imax; i++) { ReleaseLoc rl = new ReleaseLoc(); rl.map = reader.ReadMap(); rl.location = reader.ReadPoint3D(); rl.mobile = reader.ReadInt(); rl.returnToPoint = reader.ReadBool(); releasePoints.Add(rl.mobile, rl); } jailor = reader.ReadString().Trim(); reason = reader.ReadString().Trim(); break; ; default: break; } //System.Console.WriteLine("Loaded Jail object:{0} releases:{1}", m_name, imax); }