public void RemoveSpectator(PlayerMobile pm, bool teleport) { if (!IsSpectator(pm)) { return; } Spectators.Remove(pm); if (teleport) { var bounce = BounceInfo.GetValue(pm); if (bounce != null && !bounce.InternalOrZero) { Teleport(pm, bounce, bounce); BounceInfo.Remove(pm); } else { Teleport(pm, Options.Locations.Eject, Options.Locations.Eject); } } OnSpectatorRemoved(pm); }
public DashboardModel() { SendTransactionSummaryCollection = new SendTransactionSummaryCollection(); Waiting = 0; BounceInfo = new BounceInfo[] { }; RabbitMqInbound = 0; RabbitMqTotalOutbound = 0; }
/// <summary> /// Creates a BounceInfo object and fills it with data from the data record. /// </summary> /// <param name="record">Where to get the data from.</param> /// <returns>BounceInfo filled with data from the data record.</returns> private static BounceInfo CreateAndFillBounceInfo(IDataRecord record) { BounceInfo bounceInfo = new BounceInfo(); bounceInfo.Count = record.GetInt64("Count"); bounceInfo.LocalHostname = record.GetString("ip_ipAddress_hostname"); bounceInfo.LocalIpAddress = record.GetString("ip_ipAddress_ipAddress"); bounceInfo.Message = record.GetString("mta_transaction_serverResponse"); bounceInfo.RemoteHostname = record.GetStringOrEmpty("mta_transaction_serverHostname"); bounceInfo.TransactionStatus = (TransactionStatus)record.GetInt64("mta_transactionStatus_id"); bounceInfo.LastOccurred = record.GetDateTime("LastOccurred"); return(bounceInfo); }
public static T SplitItem <T>(T i, int amount) where T : Item { T item = Activator.CreateInstance <T>(); if (item != null) { BounceInfo bi = i.GetBounce(); if (bi.m_Parent is Container) { ((Container)bi.m_Parent).AddItem(item); } item.Location = bi.m_Location; item.Map = bi.m_Map; item.Amount = i.Amount - amount; i.Amount = amount; } return(item); }