• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Server.Server类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Server的典型用法代码示例。如果您正苦于以下问题:C# Server类的具体用法?C# Server怎么用?C# Server使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Server类属于Server命名空间,在下文中一共展示了Server类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Serialize

        /// <summary>
        /// Serialization
        /// </summary>
        protected override void Serialize( Server.GenericWriter writer )
        {
            base.Serialize(writer);

            writer.Write((int)1); //version
            writer.Write(Ambush);
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:10,代码来源:Rogue.cs


示例2: OnResponse

        public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
        {
            int val, type, index;
            DecodeButtonId(info.ButtonID, out val, out type, out index);

            if( val < 0 )
                return;

            switch( type )
            {
                case 1:
                    {
                        switch( index )
                        {
                            case 0: //purchase
                                {
                                    Market.BuyItem(sender.Mobile, _entry);
                                    break;
                                }
                            case 1: //go back
                                {
                                    sender.Mobile.CloseGump(typeof(MarketDetailsGump));
                                    break;
                                }
                        }

                        break;
                    }
            }
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:30,代码来源:MarketDetailsGump.cs


示例3: OnResponse

        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile pm = ( Mobile )sender.Mobile;

            if( pm == null )
                return;

            switch (info.ButtonID)
            {
                case 2:
                    {
                        TextRelay text = info.GetTextEntry( 1 );

                        if (text == null || text.Text == "")
                        {
                            pm.CloseGump(typeof(AccountSearch));
                            pm.SendGump(new AccountSearch());
                            return;
                        }

                        ArrayList authors = new ArrayList();

                        if (ForumCore.AuthorExists( out authors, text.Text))
                        {
                            pm.CloseGump( typeof(AccountListingGump));
                            pm.SendGump( new AccountListingGump( authors, 0 ) );
                        }
                        else
                        {
                            pm.SendMessage("Either that player does not exist, or no posts have been made by that player.");
                        }
                        break;
                    }
            }
        }
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:35,代码来源:AccountSearchGump.cs


示例4: OnResponse

        public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
        {
            switch ( info.ButtonID )
            {
                case 0: // Close Gump
                {
                    MessagesTitle = "Delete Entry";
                    Messages = "You have chosen not to delete the entry.";

                    SetArgsList();

                    gumpMobile.SendGump( new EditSpawnGump( gumpMobile, ArgsList ) );

                    break;
                }
                case 1: // Delete Entry
                {
                    if ( CheckProcess() )
                        break;

                    MSEGCheckBoxesList.RemoveAt( index );
                    megaSpawner.DeleteEntry( index );

                    MessagesTitle = "Delete Entry";
                    Messages = "Entry has been removed.";

                    SetArgsList();

                    gumpMobile.SendGump( new MegaSpawnerEditGump( gumpMobile, ArgsList ) );

                    break;
                }
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:34,代码来源:ConfirmDeleteEntryGump.cs


示例5: OnResponse

		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			if ( info.ButtonID == 1 )
			{
				AuctionSystem.ForceDelete( sender.Mobile );
			}
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:7,代码来源:DeleteSystemGump.cs


示例6: ObjectWindow

 public ObjectWindow(Server.Objects.Object objct)
 {
     InitializeComponent();
     this.objct = objct;
     this.Text = "View " + objct.Id;
     refresher.RefreshTick += new EventHandler(refresher_RefreshTick);
 }
开发者ID:Keldyn,项目名称:BattleOfTheClans,代码行数:7,代码来源:ObjectWindow.cs


示例7: OnResponse

        public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
        {
            switch ( info.ButtonID )
            {
                case 0: // Close Gump
                {
                    MessagesTitle = "Delete Account";
                    Messages = "You have chosen not to delete the account.";

                    SetArgsList();

                    gumpMobile.SendGump( new EditAccountGump( gumpMobile, ArgsList ) );

                    break;
                }
                case 1: // Delete Account
                {
                    MC.AccountsList.RemoveAt( index );
                    MC.AccessList.RemoveAt( index );
                    MC.AdminMenuAccessList.RemoveAt( index );
                    MC.AccountEditors.RemoveAt( index );

                    MC.SaveAccountsAccess();

                    MessagesTitle = "Delete Account";
                    Messages = "Account has been removed.";

                    SetArgsList();

                    gumpMobile.SendGump( new AccountsManagementGump( gumpMobile, ArgsList ) );

                    break;
                }
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:35,代码来源:ConfirmDeleteAccountGump.cs


示例8: OnResponse

        public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
        {
            Mobile m_Player = ( Mobile )sender.Mobile;

            if( m_Player == null )
                return;

            switch( info.ButtonID )
            {
                case 1:
                    {
                        ForumCore.AutoCleanup = true;
                        m_Player.CloseGump( typeof( AdministrationGump ) );
                        m_Player.SendGump( new AdministrationGump( ) );
                        break;
                    }
                case 2:
                    {
                        ForumCore.AutoCleanup = false;
                        m_Player.CloseGump( typeof( AdministrationGump ) );
                        m_Player.SendGump( new AdministrationGump( ) );
                        break;
                    }
            }
        }
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:25,代码来源:BoolGump.cs


示例9: OnResponse

		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			if ( ! m_Buttons.Contains( info.ButtonID ) )
			{
				Console.WriteLine( @"The auction system located a potential exploit. 
					Player {0} (Acc. {1}) tried to press an unregistered button in a gump of type: {2}",
					sender.Mobile != null ? sender.Mobile.ToString() : "Unkown",
					sender.Mobile != null && sender.Mobile.Account != null ? ( sender.Mobile.Account as Server.Accounting.Account ).Username : "Unkown",
					this.GetType().Name );

				return;
			}

			if ( ! AuctionSystem.Running )
			{
				sender.Mobile.SendMessage( AuctionSystem.MessageHue, AuctionSystem.ST[ 15 ] );
				return;
			}

			switch ( info.ButtonID )
			{
				case 0: // Exit

					break;

				case 1: // Create auction

					AuctionSystem.AuctionRequest( sender.Mobile );

					break;

				case 2: // View all auctions

					sender.Mobile.SendGump( new AuctionListing(
						sender.Mobile,
						AuctionSystem.Auctions,
						true,
						true ) );

					break;

				case 3: // View your auctions

					sender.Mobile.SendGump( new AuctionListing(
						sender.Mobile, AuctionSystem.GetAuctions( sender.Mobile ), true, true ) );
					break;

				case 4: // View your bids

					sender.Mobile.SendGump( new AuctionListing(
						sender.Mobile, AuctionSystem.GetBids( sender.Mobile ), true, true ) );
					break;

				case 5: // View pendencies

					sender.Mobile.SendGump( new AuctionListing(
						sender.Mobile, AuctionSystem.GetPendencies( sender.Mobile ), true, true ) );
					break;
			}
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:60,代码来源:AuctionGump.cs


示例10: OnResponse

		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			string web = null;

			switch ( info.ButtonID )
			{
				case 1 : web = "http://www.chessvariants.com/d.chess/chess.html";
					break;
				case 2 : web = "http://www.chessvariants.com/d.chess/faq.html";
					break;
				case 3 : web = "http://www.chessvariants.com/d.chess/matefaq.html";
					break;
				case 4 : web = "http://www.chessvariants.com/d.chess/castlefaq.html";
					break;
				case 5 : web = "http://www.chessvariants.com/d.chess/enpassant.html";
					break;
				case 6 : web = "http://www.chessvariants.com/d.chess/pawnfaq.html";
					break;
				case 7 : web = "http://www.chessvariants.com/d.chess/knightfaq.html";
					break;
				case 8 : web = "http://www.chessvariants.com/d.chess/queenfaq.html";
					break;
				case 9 : web = "http://www.chessvariants.com/d.chess/kingfaq.html";
					break;
			}

			if ( web != null )
			{
				sender.Mobile.LaunchBrowser( web );
				sender.Mobile.SendGump( this );
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:32,代码来源:ChessHelpGump.cs


示例11: OnResponse

		public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
		{
			if( info.ButtonID == 0 )
			{
				_from.SendLocalizedMessage( 501235, "", 0x35 ); //Help request aborted.
				return;
			}
			else
			{
				TextRelay txtEntry = info.GetTextEntry( 0 );
				string text = (txtEntry == null ? "" : txtEntry.Text);

				if( text.Length == 0 )
				{
					_from.SendMessage( 0x35, "You must enter a description of your problem." );
					_from.SendGump( new PagePromptGump( _from, _type ) );
				}
				else
				{
					_from.SendMessage( 0x35, "The next available staff member will be with you as soon as possible. If your issue is resolved early, please revoke it from the page queue. To check the statue of your page, type \'[CheckPage\'." );

					PageQueue.AddNewPage( new PageEntry( _from, text, _type ) );
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:25,代码来源:PagePromptGump.cs


示例12: ClearGuildListeners_OnCommand

		public static void ClearGuildListeners_OnCommand( Server.Commands.CommandEventArgs args )
		{
			if( _table.ContainsKey( args.Mobile ) )
				_table.Remove( args.Mobile );

			args.Mobile.SendMessage( "You are no longer listening to any private guild chat." );
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:7,代码来源:ListenToGuild.cs


示例13: Main

 static void Main(string[] args)
 {
     var server = new Server();
     server.LoadConfig();
     server.Run();
     Console.ReadLine();
 }
开发者ID:gormel,项目名称:SeaBattle,代码行数:7,代码来源:Program.cs


示例14: FindRunes_OnCommand

		public static void FindRunes_OnCommand( Server.Commands.CommandEventArgs e )
		{
			foreach ( Item item in World.Items.Values )
			{
				if ( item is RecallRune )
				{
					RecallRune rune = (RecallRune)item;

					if ( rune.Marked && rune.TargetMap != null && IsBad( rune.Target, rune.TargetMap ) )
					{
						object root = item.RootParent;

						if ( root is Mobile )
						{
							if ( ((Mobile)root).AccessLevel < AccessLevel.GameMaster )
								e.Mobile.SendAsciiMessage( "Rune: '{4}' {0} [{1}]: {2} ({3})", item.GetWorldLocation(), item.Map, root.GetType().Name, ((Mobile)root).Name, rune.Description );
						}
						else
						{
							e.Mobile.SendAsciiMessage( "Rune: '{3}' {0} [{1}]: {2}", item.GetWorldLocation(), item.Map, root==null ? "(null)" : root.GetType().Name, rune.Description );
						}
					}
				}
			}
		}
开发者ID:greeduomacro,项目名称:GoUO,代码行数:25,代码来源:FindRunes.cs


示例15: OnResponse

        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if ( m_IsOwner )
            {
                if ( info.ButtonID == 3 )
                {
                    // Switch the allow spectators flag
                    m_Game.AllowSpectators = !m_AllowSpectators;
                    sender.Mobile.SendGump( new StartGameGump( sender.Mobile, m_Game, m_IsOwner, !m_AllowSpectators ) );
                }
                else if ( info.ButtonID == 2 )
                {
                    m_Game.CancelGameStart( sender.Mobile );
                }
                else if ( info.ButtonID == 1 )
                {
                    sender.Mobile.Target = new ChessTarget( m_Game, sender.Mobile, "Please select your partner...",
                        new ChessTargetCallback( m_Game.ChooseOpponent ) );

                    sender.Mobile.SendGump( new StartGameGump( sender.Mobile, m_Game, m_IsOwner, m_AllowSpectators ) );
                }
            }
            else
            {
                if ( info.ButtonID == 2 )
                {
                    m_Game.CancelGameStart( sender.Mobile );
                }
                else if ( info.ButtonID == 1 )
                {
                    m_Game.AcceptGame( sender.Mobile );
                }
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:34,代码来源:StartGameGump.cs


示例16: OnResponse

		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			PawnPromotion type = PawnPromotion.None;

			switch ( info.ButtonID )
			{
				case 0 :
						return; // This fixes a crash when staff deletes the pawn being promoted

				case 1 : type = PawnPromotion.Queen;
					break;

				case 2 : type = PawnPromotion.Rook;
					break;

				case 3 : type = PawnPromotion.Knight;
					break;

				case 4 : type = PawnPromotion.Bishop;
					break;

				case 5: type = PawnPromotion.None;
					break;
			}

			m_Game.OnPawnPromoted( type );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:27,代码来源:PawnPromotionGump.cs


示例17: Main

        static void Main(string[] args)
        {
            bool exit = false;

            var obj = new Server();
            obj.Start();

            while (!exit)
            {
                var input = Console.ReadKey();

                switch (input.Key)
                {
                    case ConsoleKey.Escape:
                        exit = true;
                        obj.Close();
                        break;
                    case ConsoleKey.Spacebar:
                        obj.InterdaceUpdate();
                        break;
                    default:
                        break;
                }
            }
        }
开发者ID:Budalica,项目名称:Online-Auction-House,代码行数:25,代码来源:Program.cs


示例18: OnResponse

 public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
 {
     if ( info.ButtonID == 2 )
     {
         if ( m_Victim != null && !m_Victim.Blessed && m_Vamp != null && m_Vamp.InRange(m_Victim, 1) && m_Victim.Alive &&
             m_Vamp.Alive && !m_Vamp.Paralyzed && m_Victim is PlayerMobile && !((PlayerMobile)m_Victim).IsVampire )
         {
             m_Vamp.Emote( "*feeds on {0}*", m_Victim.Name );
             m_Vamp.PlaySound( 49 );
             m_Victim.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Head );
             m_Victim.Damage( 10 );
             ((PlayerMobile)m_Vamp).BPs += 2;
             ((PlayerMobile)m_Vamp).NextFeedingAllowed = DateTime.Now + TimeSpan.FromSeconds( 5 );
             foreach (DiseaseTimer timer in HealthAttachment.GetHA(m_Victim).CurrentDiseases)
             {
                 if (!HealthAttachment.GetHA(m_Vamp).HasDisease(timer.Disease))
                 {
                     DiseaseTimer newDis = new DiseaseTimer(m_Vamp, timer.Disease);
                     HealthAttachment.GetHA(m_Vamp).CurrentDiseases.Add(newDis);
                     newDis.Start();
                 }
             }
         }
     }
 }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:25,代码来源:AllowFeedingGump.cs


示例19: Main

        /// <summary>
        /// The main entry point for the server application.
        /// </summary>
        static void Main()
        {
            Console.Title = "Server is stopped";

            Server server = new Server(443);

            // commands
            Console.WriteLine("Server is stopped.");
            Console.WriteLine("==================");
            Console.WriteLine("Commands:");
            Console.WriteLine("start - Start listening to clients.");
            Console.WriteLine("stop - Stop listening to clients.");
            Console.WriteLine("exit - Close server.");
            Console.WriteLine();

            while (true)
            {
                string command = Console.ReadLine();

                if ("start".Equals(command))
                {
                    server.Start();
                    Console.Title = "Server is running";
                }
                else if ("stop".Equals(command))
                {
                    server.Stop();
                    Console.Title = "Server is stopped";
                }
                else if ("exit".Equals(command))
                    return;
            }
        }
开发者ID:pr3sto,项目名称:CryptoMessenger,代码行数:36,代码来源:Program.cs


示例20: OnResponse

 public override void OnResponse( Server.Network.NetState sender, int index )
 {
     if ( index == 0 && m_Callback != null )
         m_Callback( sender.Mobile, true, m_State );
     else if ( m_Callback != null )
         m_Callback( sender.Mobile, false, m_State );
 }
开发者ID:Godkong,项目名称:Origins,代码行数:7,代码来源:WarningGump.cs



注:本文中的Server.Server类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Server.Skill类代码示例发布时间:2022-05-26
下一篇:
C# Server.Serial类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap