protected virtual int GetProgress(ConquestState state, LogoutEventArgs args)
		{
            if (state.User == null)
                return 0;

            if (args == null || args.Mobile is PlayerMobile && args.Mobile.Account != state.User.Account)
			{
				return 0;
			}

			if (Map != null && Map != Map.Internal && (args.Mobile.Map == null || args.Mobile.Map != Map))
			{
				if (MapChangeReset)
				{
					return -state.Progress;
				}

				return 0;
			}

			if (!String.IsNullOrWhiteSpace(Region) && (args.Mobile.Region == null || !args.Mobile.Region.IsPartOf(Region)))
			{
				if (RegionChangeReset)
				{
					return -state.Progress;
				}

				return 0;
			}

			return 1;
		}
Exemple #2
0
        private static void EventSink_Logout( LogoutEventArgs e )
        {
            Mobile from = e.Mobile;

            InstanceRegion region = from.Region as InstanceRegion;

            if ( region != null )
                region.Owner.Kick( from );
        }
        static void EventSink_Logout(LogoutEventArgs e)
        {
            Logger.LogMessage("Logout: " + e.Mobile.RawName, "Logins");

            foreach (Mobile mobile in m_HearAll)
            {
                mobile.SendMessage("Logout: " + e.Mobile.RawName);

            }
        }
Exemple #4
0
		private static void OnLogout(LogoutEventArgs e)
		{
			Mobile m = e.Mobile;

			if (m != null)
			{
				if (Follow.Collection.Contains(m))
					Follow.Collection.Remove(m);
			}
		}
Exemple #5
0
        public static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile from = e.Mobile;
            Party  p    = Party.Get(from);

            if (p != null)
            {
                p.Remove(from);
            }

            from.Party = null;
        }
Exemple #6
0
        private static void OnLogout(LogoutEventArgs e)
        {
            Mobile m = e.Mobile;

            if (m != null)
            {
                if (Follow.Collection.Contains(m))
                {
                    Follow.Collection.Remove(m);
                }
            }
        }
Exemple #7
0
 public static void OnLogout(LogoutEventArgs e)
 {
     if (m_AFK.Contains(e.Mobile.Serial.Value))
     {
         AFK afk = (AFK)m_AFK[e.Mobile.Serial.Value];
         if (afk == null)
         {
             e.Mobile.SendMessage("Afk object missing!");
             return;
         }
         afk.wakeUp();
     }
 }
Exemple #8
0
 private void bt_rsRequest_Click(object sender, RoutedEventArgs e)
 {
     if (banker.applyForRes(cb_progName.Text, requestManager.getVector()))
     {
         LogoutEventArgs a = new LogoutEventArgs("success: 申请资源成功.");
         Logout.NewMsg(a);
     }
     else
     {
         LogoutEventArgs a = new LogoutEventArgs("申请资源失败.");
         Logout.NewMsg(a);
     }
 }
Exemple #9
0
 private void bt_addRes_Click(object sender, RoutedEventArgs e)
 {
     if (banker.getResNum() >= 26)
     {
         LogoutEventArgs a = new LogoutEventArgs("error: 最多支持26个种类的资源");
         Logout.NewMsg(a);
         return;
     }
     newProgMax.newColumn();
     request.newColumn();
     banker.newRes();
     tb_resCount.Text = ((Convert.ToInt32(tb_resCount.Text) + 1).ToString());
 }
Exemple #10
0
        void OnLogout(object sender, LogoutEventArgs e)
        {
            var dataClient = (DataClient)sender;

            dataClient.Logout -= this.OnLogout;

            if (e.Reason == LogoutReason.InvalidCredentials)
            {
                this.eventArgs = e;
            }

            this.syncEvent.Set();
        }
        public static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile          from = e.Mobile;
            TeleportingInfo info;

            if (from == null || !m_Table.TryGetValue(from, out info))
            {
                return;
            }

            info.Timer.Stop();
            m_Table.Remove(from);
        }
        private static void HandleOnLogout(LogoutEventArgs args)
        {
            Mobile m = args.Mobile;

            try
            {
                StaticTile[] tiles  = m.Map.Tiles.GetStaticTiles(m.X, m.Y, true);
                NetState     state  = (NetState)m.NetState;
                int          tileID = 0;
                bool         safe   = false;

                int[] bedID = new int[]
                {
                    2651, 2653, 2654, 2656,
                    2659, 2660, 2662, 2663,
                    2665, 2666, 2682, 2684,
                    2688, 2690, 2692, 2696,
                    2702, 2704
                };

                foreach (Item item in m.GetItemsInRange(6))
                {
                    for (int i = 0; !safe && i < bedID.Length; i++)
                    {
                        for (int j = 0; !safe && j < tiles.Length; j++)
                        {
                            tileID = tiles[j].ID;

                            if (tiles[j].Z == m.Z)
                            {
                                safe = (tileID == bedID[i]) || (item.ItemID == bedID[i]);
                            }
                        }
                    }
                }

                if (safe)
                {
                    ((PlayerMobile)m).BedrollLogout = true;

                    if (state != null)
                    {
                        state.Dispose();
                    }
                }
            }
            catch (Exception e)
            {
                ExceptionManager.LogException("StartupSettings.cs", e);
            }
        }
Exemple #13
0
 /// <summary>
 /// On player logout, broadcast a message.
 /// </summary>
 public static void EventSink_Logout(LogoutEventArgs e)
 {
     if (e.Mobile.Player)
     {
         if (e.Mobile.AccessLevel <= m_AnnounceLevel)
         {
             CommandHandlers.BroadcastMessage(AccessLevel.Player, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name));
         }
         else //broadcast any other level to the staff
         {
             CommandHandlers.BroadcastMessage(AccessLevel.Counselor, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name));
         }
     }
 }
		private static void EventSink_Logout( LogoutEventArgs e )
		{
			Mobile mob = e.Mobile;

			Container pack = mob.Backpack;

			if ( pack == null )
				return;

			Item[] sigils = pack.FindItemsByType( typeof( Sigil ) );

			for ( int i = 0; i < sigils.Length; ++i )
				((Sigil)sigils[i]).ReturnHome();
		}
Exemple #15
0
        private static void EventSink_Logout(LogoutEventArgs e)
        {
            ScriptMobile sm = e.Mobile as ScriptMobile;

            sm.Detection.ResetAlentours();
            foreach (NetState state in NetState.Instances)
            {
                ScriptMobile m = state.Mobile as ScriptMobile;
                if (m != null)
                {
                    m.Detection.RetirerJoueurDesAlentours(sm);
                }
            }
        }
Exemple #16
0
        private void bt_updateAvaliable_Click(object sender, RoutedEventArgs e)
        {
            List <int> newRes = resCountManager.getVector();

            if (banker.modifyRes(newRes))
            {
                LogoutEventArgs a = new LogoutEventArgs("success: 资源已更新.");
                Logout.NewMsg(a);
            }
            else
            {
                LogoutEventArgs a = new LogoutEventArgs("error: 资源更新失败.");
                Logout.NewMsg(a);
            }
        }
		private static void EventSink_Logout( LogoutEventArgs args )
		{
			Mobile m = args.Mobile;
			try
			{
				Stream fileStream = File.Open( "Logs/LoginLogout/" + m.Account + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite );
				StreamWriter writeAdapter = new StreamWriter( fileStream );

				writeAdapter.WriteLine( String.Format( "Disconnected: {0} logged out as {1} on {2}", m.Account, m.Name, DateTime.Now ) );
				writeAdapter.Close();
			}
			catch
			{
				Console.WriteLine( "Record Error... {0} Logout", m.Account );
			}
		}
Exemple #18
0
        private static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile from = e.Mobile;

            List <Matchmaking> toremove = WaitingForParty.Where(match => match.Player == @from).ToList();

            if (toremove.Count <= 0)
            {
                return;
            }

            foreach (Matchmaking drop in toremove.Where(drop => WaitingForParty.Contains(drop)))
            {
                WaitingForParty.Remove(drop);
            }
        }
        private static void HandleOnLogout( LogoutEventArgs args )
        {
            Mobile m = args.Mobile;

            try
            {
                StaticTile[] tiles = m.Map.Tiles.GetStaticTiles(m.X, m.Y, true);
                NetState state = (NetState)m.NetState;
                int tileID = 0;
                bool safe = false;

                int[] bedID = new int[]
				{
					2651,	2653,	2654,	2656,
					2659,	2660,	2662,	2663,
					2665,	2666,	2682,	2684,
					2688,	2690,	2692,	2696,
					2702,	2704
				};

                foreach( Item item in m.GetItemsInRange(6) )
                {
                    for( int i = 0; !safe && i < bedID.Length; i++ )
                    {
                        for( int j = 0; !safe && j < tiles.Length; j++ )
                        {
                            tileID = tiles[j].ID;

                            if( tiles[j].Z == m.Z )
                                safe = (tileID == bedID[i]) || (item.ItemID == bedID[i]);
                        }
                    }
                }

                if( safe )
                {
                    ((PlayerMobile)m).BedrollLogout = true;

                    if( state != null )
                        state.Dispose();
                }
            }
            catch( Exception e )
            {
                ExceptionManager.LogException("StartupSettings.cs", e);
            }
        }
        private static void EventSink_Logout(LogoutEventArgs args)
        {
            Mobile m = args.Mobile;

            try
            {
                Stream       fileStream   = File.Open("Logs/LoginLogout/" + m.Account + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
                StreamWriter writeAdapter = new StreamWriter(fileStream);

                writeAdapter.WriteLine(String.Format("Disconnected: {0} logged out as {1} on {2}", m.Account, m.Name, DateTime.Now));
                writeAdapter.Close();
            }
            catch
            {
                Console.WriteLine("Record Error... {0} Logout", m.Account);
            }
        }
Exemple #21
0
        void OnLogout(object sender, LogoutEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.InvokeInPrimaryThread(OnLogout, sender, e);
                return;
            }

            if (string.IsNullOrEmpty(e.Text))
            {
                this.Log("Logout event is received; reason = {0}", e.Reason);
            }
            else
            {
                this.Log("Logout event is received; reason = {0}; Text = {1}", e.Reason, e.Text);
            }
        }
Exemple #22
0
        // Si un GM se déconnecte on le retire de la liste lui et ses PNJ écoutés
        private static void GMLogout(LogoutEventArgs args)
        {
            if (args.Mobile == null || args.Mobile.AccessLevel == AccessLevel.Player)
            {
                return;
            }

            Mobile gm = args.Mobile;

            for (int i = 0; i < ListenedMobiles.Length; i++)
            {
                if (ListenedMobiles[i] != null && ListenedMobiles[i][0] == gm)
                {
                    ListenedMobiles[i] = null;
                }
            }
        }
Exemple #23
0
        private void newProgress_Click(object sender, RoutedEventArgs e)
        {
            if (tb_newProgName.Text == "")
            {
                LogoutEventArgs a = new LogoutEventArgs("error: 进程名为空");
                Logout.NewMsg(a);
                return;
            }
            List <int> progMax = newProgMaxManager.getVector();

            if (banker.newProgress(tb_newProgName.Text, progMax))
            {
                cb_progName.ItemsSource = null;
                cb_progName.ItemsSource = banker.getProgressNameList();
                tb_progressNum.Text     = ((Convert.ToInt32(tb_progressNum.Text) + 1).ToString());
                tb_newProgName.Clear();
            }
        }
Exemple #24
0
        public static void OnLogoutImpl(LogoutEventArgs e)
        {
            var user = e.Mobile as PlayerMobile;

            if (user == null || !Instances.ContainsKey(user))
            {
                return;
            }

            VitaNexCore.TryCatch(
                () =>
            {
                foreach (SuperGump g in GetInstances <SuperGump>(user, true))
                {
                    g.Close(true);
                }
            },
                x => x.ToConsole(true));
        }
        private static void EventSink_Logout(LogoutEventArgs args)
        {
            Stream       fileStream   = null;
            StreamWriter writeAdapter = null;
            Mobile       m            = args.Mobile;

            try
            {
                fileStream   = File.Open("logs/Logout/" + args.Mobile.Name + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
                writeAdapter = new StreamWriter(fileStream);
                writeAdapter.WriteLine(args.Mobile.Name + " " + DateTime.Now + "  Logout");
                writeAdapter.Close();
            }
            catch
            {
                Console.WriteLine("Record Error......{0} Logout", args.Mobile.Name);
                return;
            }
        }
Exemple #26
0
        public bool applyForRes(string name, List <int> request)
        {
            //清空workAllocation
            workAllocation.clearAll();
            List <string> safetyList = bankerAlg(name, request);

            if (safetyList != null)
            {
                StringBuilder sb = new StringBuilder("安全序列:{");
                foreach (string i in safetyList)
                {
                    sb.Append(i + ",");
                }
                sb.Remove(sb.Length - 1, 1);
                sb.Append("}");
                LogoutEventArgs e = new LogoutEventArgs(sb.ToString());
                Logout.NewMsg(e);
                return(true);
            }
            return(false);
        }
        private static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile m = e.Mobile;

            if (m == null)
            {
                return;
            }

            Duel duel;

            if (IsInDuel(m, out duel) && !m_TimeoutTable.ContainsKey(m.Serial))
            {
                if (duel != null && duel.Started)
                {
                    LogoutTimeoutTimer timer = new LogoutTimeoutTimer(m, duel);
                    timer.Start();

                    m_TimeoutTable.Add(m.Serial, timer);
                }
            }
        }
Exemple #28
0
        public virtual bool newRow(string header)
        {
            if (progressName.Contains(header))
            {
                LogoutEventArgs e = new LogoutEventArgs("error: 已存在同名进程,创建失败.");
                Logout.NewMsg(e);
                return(false);
            }
            else
            {
                progressName.Add(header);

                List <Int32> t = new List <int>();
                for (int i = 0; i < columnNum; i++)
                {
                    t.Add(0);
                }
                data.Add(t);
                row++;
                onDataChanged(null);
                return(true);
            }
        }
Exemple #29
0
        public bool newProgress(string name, List <int> vector)
        {
            //判断是否超过resCount向量,若超过,返回false报错
            List <int> resCountList = resCount.getDataList();

            if (!BankerHelper.VectorLess(vector, resCountList))
            {
                LogoutEventArgs e = new LogoutEventArgs("error: 新建进程的最大需求资源数超过最大资源数.");
                Logout.NewMsg(e);
                return(false);
            }

            if (max.newRow(name))
            {
                //修改max
                max.modify(name, vector);
                need.newRow(name);
                allocation.newRow(name);
                //增加进程数
                progNum++;

                //计算need矩阵的值
                List <List <Int32> > t = new List <List <int> >();
                for (int i = 0; i < progNum; i++)
                {
                    t.Add(new List <int>());
                    for (int j = 0; j < resNum; j++)
                    {
                        t[i].Add(0);
                    }
                }
                BankerHelper.MatrixRed(max.getData(), allocation.getData(), ref t);
                need.modify(t);
                return(true);
            }
            return(false);
        }
		private static void OnLogout(LogoutEventArgs e)
		{
			if (e.Mobile is PlayerMobile)
			{
				((PlayerMobile)e.Mobile).AutoStablePets();
			}

			#region Scroll of Alacrity
			if (((PlayerMobile)e.Mobile).AcceleratedStart > DateTime.UtcNow)
			{
				((PlayerMobile)e.Mobile).AcceleratedStart = DateTime.UtcNow;
				ScrollofAlacrity.AlacrityEnd(e.Mobile);
			}
			#endregion
		}
Exemple #31
0
 private static void OnLogout(LogoutEventArgs e)
 {
 }
 private static void EventSink_Logout(LogoutEventArgs args)
 {
     Mobile player = args.Mobile;
     HideChatFrom(player);
 }
 private static void World_Logout(LogoutEventArgs args)
 {
     World.Broadcast(0x482, false, "{0} has left our world.", args.Mobile.Name);
 }
		private static void OnLogout( LogoutEventArgs e )
		{
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm != null)
            {
                pm.AbortCurrentPlayerAction();
                ((PlayerMobile) e.Mobile).AutoStablePets();
            }                
		}
Exemple #35
0
		private static void EventSink_Logout(LogoutEventArgs e)
		{
			Mobile mob = e.Mobile;

			Container pack = mob.Backpack;

			if (pack == null)
			{
				return;
			}

			foreach (Sigil s in pack.FindItemsByType<Sigil>())
			{
				s.ReturnHome();
			}
		}
 public static void RunOnLogout(LogoutEventArgs e)
 {
     AppSettings.SessionState.SessionId = "";
 }
Exemple #37
0
        public void OnLogout( LogoutEventArgs e )
        {
            /* Publish 59: Players can no longer log out without repercussions in Champ Spawn regions
             * - Players that log out in a champ spawn region will get teleported to a shrine
             * - If a player logs out in a champ spawn area all the non equipped "cursed" items on them will drop to the ground
             * - This will only affect players who log out beyond the 10 minute grace period; accidental disconnections will not be punished
             */

            Mobile m = e.Mobile;

            if ( m.Region.IsPartOf( m_Region ) )
            {
                if ( m.Backpack != null )
                {
                    List<Item> list = new List<Item>();

                    RecurseGetCursedItems( m.Backpack, list );

                    foreach ( Item item in list )
                        item.MoveToWorld( m.Location, m.Map );
                }

                m.Location = ExorcismSpell.GetNearestShrine( m );
            }
        }
 private static void OnPlayerLogout(LogoutEventArgs args)
 {
     PlayerWeapons.Remove(args.Mobile.Serial.Value);
 }
Exemple #39
0
 void OnLogout(object sender, LogoutEventArgs e)
 {
     Console.WriteLine("OnLogout(): {0}", e);
 }
Exemple #40
0
 private void UserController_LogoutEvent(object source, LogoutEventArgs e)
 {
     switchToLoginController();
 }
Exemple #41
0
 protected void OnLogout( LogoutEventArgs e )
 {
     if ( GetMobiles().Contains( e.Mobile ) )
         e.Mobile.MoveToWorld( new Point3D( 1071, 1057, -43 ), Map.TerMur );
 }
		private static void OnLogout(LogoutEventArgs e)
		{
			if (TestCenter.Enabled && e.Mobile is PlayerMobile)
			{
				((PlayerMobile)e.Mobile).AutoStablePets();
			}

			if (e.Mobile != null && e.Mobile.Account is Account)
			{
				((Account)e.Mobile.Account).LogIPAccess(null, true);
			}

            #region SmoothMove
            if (((PlayerMobile)e.Mobile).Transport != null)
                ((PlayerMobile)e.Mobile).Transport.LeaveCommand((PlayerMobile)e.Mobile);
            #endregion
		}
Exemple #43
0
 public void InvokeLogout( LogoutEventArgs e )
 {
     if ( Logout != null )
         Logout( e );
 }
Exemple #44
0
        private static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile mob = e.Mobile;

            Container pack = mob.Backpack;

            if (pack == null)
                return;

            Item[] sigils = pack.FindItemsByType(typeof(Sigil));

            for (int i = 0; i < sigils.Length; ++i)
                ((Sigil)sigils[i]).ReturnHome();
        }
		private static void OnLogout(LogoutEventArgs e)
		{
			Mobile from = e.Mobile;

			if (m_Instruments.ContainsKey(from))
			{
				m_LogoutCleanup[from] = Timer.DelayCall(TimeSpan.FromMinutes(60.0), ExpireInstrumentPick, from);
			}
		}
Exemple #46
0
 void OnLogout(Object sender, LogoutEventArgs e)
 {
     this.logoutReason = e.Reason;
     this.logoutEvent.Set();
 }
		private static void EventSink_Logout(LogoutEventArgs e)
		{
			Mobile m = e.Mobile;

			if (m == null)
				return;

			Duel duel;

			if (IsInDuel(m, out duel) && !m_TimeoutTable.ContainsKey(m.Serial))
			{
				if (duel != null && duel.Started)
				{
					LogoutTimeoutTimer timer = new LogoutTimeoutTimer(m, duel);
					timer.Start();

					m_TimeoutTable.Add(m.Serial, timer);
				}
			}
		}
Exemple #48
0
 private void OnLogout(Object sender, LogoutEventArgs e)
 {
     //_logger.InfoFormat("OnLogout() ");
     IsConnected = false;
 }
Exemple #49
0
		public static void EventSink_Logout(LogoutEventArgs e)
		{
			Mobile from = e.Mobile;
			TeleportingInfo info;

			if (from == null || !m_Table.TryGetValue(from, out info))
			{
				return;
			}

			info.Timer.Stop();
			m_Table.Remove(from);
		}
		private static void OnLogout( LogoutEventArgs e )
		{
			if( e.Mobile is PlayerMobile )
				((PlayerMobile)e.Mobile).AutoStablePets();
		}
Exemple #51
0
 private static void World_Logout(LogoutEventArgs args)
 {
     World.Broadcast(0x482, false, "{0} has left our world.", args.Mobile.Name);
 }
        private static void EventSink_Logout(LogoutEventArgs args)
        {
            Mobile player = args.Mobile;

            HideChatFrom(player);
        }
Exemple #53
0
		public static void EventSink_Logout( LogoutEventArgs e )
		{
			Mobile from = e.Mobile;
			Party p = Get( from );

			if ( p != null )
				p.Remove( from );

			from.Party = null;
		}