當前位置: 首頁>>代碼示例>>C#>>正文


C# RelayInfo.GetTextEntry方法代碼示例

本文整理匯總了C#中Server.Gumps.RelayInfo.GetTextEntry方法的典型用法代碼示例。如果您正苦於以下問題:C# RelayInfo.GetTextEntry方法的具體用法?C# RelayInfo.GetTextEntry怎麽用?C# RelayInfo.GetTextEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Gumps.RelayInfo的用法示例。


在下文中一共展示了RelayInfo.GetTextEntry方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnResponse

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

			if( pm == null || pm.Guild != null )
				return;		//Sanity

			switch( info.ButtonID )
			{
				case 1:
				{
					TextRelay tName = info.GetTextEntry( 5 );
					TextRelay tAbbrev = info.GetTextEntry( 6 );

					string guildName = (tName == null) ? "" : tName.Text;
					string guildAbbrev = (tAbbrev == null) ? "" : tAbbrev.Text;

					guildName = Utility.FixHtml( guildName.Trim() );
					guildAbbrev = Utility.FixHtml( guildAbbrev.Trim() );

					if( guildName.Length <= 0 )
						pm.SendLocalizedMessage( 1070884 ); // Guild name cannot be blank.
					else if( guildAbbrev.Length <= 0 )
						pm.SendLocalizedMessage( 1070885 ); // You must provide a guild abbreviation.
                    else if( guildName.Length > Guild.NameLimit )
						pm.SendLocalizedMessage( 1063036, Guild.NameLimit.ToString() ); // A guild name cannot be more than ~1_val~ characters in length.
					else if( guildAbbrev.Length > Guild.AbbrevLimit )
						pm.SendLocalizedMessage( 1063037, Guild.AbbrevLimit.ToString() ); // An abbreviation cannot exceed ~1_val~ characters in length.
					else if( Guild.FindByAbbrev( guildAbbrev ) != null || !BaseGuildGump.CheckProfanity( guildAbbrev ) )
						pm.SendLocalizedMessage( 501153 ); // That abbreviation is not available.
					else if( Guild.FindByName( guildName ) != null || !BaseGuildGump.CheckProfanity( guildName ) )
						pm.SendLocalizedMessage( 1063000 ); // That guild name is not available.
					else if( !Banker.Withdraw( pm, Guild.RegistrationFee ) )
						pm.SendLocalizedMessage( 1063001, Guild.RegistrationFee.ToString() ); // You do not possess the ~1_val~ gold piece fee required to create a guild.
					else
					{
						pm.SendLocalizedMessage( 1060398, Guild.RegistrationFee.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                        pm.SendGump(new GuildForm());
						pm.SendLocalizedMessage( 1063238 ); // Your new guild has been founded.
						pm.Guild = new Guild( pm, guildName, guildAbbrev );
					}

					break;
				}
				case 2:
				{
					pm.AcceptGuildInvites = !pm.AcceptGuildInvites;

					if( pm.AcceptGuildInvites )
						pm.SendLocalizedMessage( 1070699 ); // You are now accepting guild invitations.
					else
						pm.SendLocalizedMessage( 1070698 ); // You are now ignoring guild invitations.

					break;
				}
			}
		}
開發者ID:ITLongwell,項目名稱:aedilis2server,代碼行數:57,代碼來源:Create+Guild+Gump.cs

示例2: OnResponse

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

            if (info.ButtonID == 1)
            {
                if (m_Struct.Event == null || m_Struct.Event.Deleted)
                {
                    m.SendGump(new IndexGump(0, m.AccessLevel >= AccessLevel.Administrator));
                    m.SendMessage("The event has been deleted, thus the timer could not be added.");
                    return;
                }

                bool add = true;

                string name = info.GetTextEntry(0).Text;
                int hour;
                int minute;

                if(!Int32.TryParse(info.GetTextEntry(1).Text, out hour))
                    add = false;

                if (!Int32.TryParse(info.GetTextEntry(2).Text, out minute))
                    add = false;

                bool[] barray = new bool[7];
                for (int i = 0; i < 7; i++)
                    barray[i] = info.IsSwitched(i);

                if (!add)
                {
                    m.SendGump(this);
                    m.SendMessage("The hour or minute are not valid Int32 values.");
                }

                else if (!AutoStartEvent.Enlisted.Contains(m_Struct))
                {
                    m_Struct.Name = name;
                    m_Struct.Hour = hour;
                    m_Struct.Minute = minute;
                    m_Struct.Days = barray;

                    if (m_Struct.Days[AutoStartEvent.NowDayOfWeek] && (AutoStartEvent.Now.Hour > m_Struct.Hour || (AutoStartEvent.Now.Hour == m_Struct.Hour && AutoStartEvent.Now.Minute > m_Struct.Minute)))
                        m_Struct.LastExecutedDay = AutoStartEvent.Now.Day;

                    m_Struct.SetNextExecution();
                    AutoStartEvent.AddNewTimedEvent(m_Struct);
                    m.SendGump(new IndexGump(0, m.AccessLevel >= AccessLevel.Administrator));
                    m.SendMessage("The timer has been succesfully added.");
                }

                else
                    m.SendMessage("Someone else has edited this entry in the meantime.");
            }
        }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:55,代碼來源:Gumps.cs

示例3: OnResponse

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
            this.caller = sender.Mobile;

            switch (info.ButtonID)
            {

                case 1:
                    {
                        TextRelay entrySphereAcc = info.GetTextEntry(10);
                        this.textSphereAcc = (entrySphereAcc == null ? "" : entrySphereAcc.Text.Trim());

                        TextRelay entrySphereChar = info.GetTextEntry(11);
                        this.textSphereChar = (entrySphereChar == null ? "" : entrySphereChar.Text.Trim());

                        TextRelay entryRunUOAcc = info.GetTextEntry(12);
                        this.textRunUOAcc = (entryRunUOAcc == null ? "" : entryRunUOAcc.Text.Trim());

                        TextRelay entryRunUOChar = info.GetTextEntry(13);
                        this.textRunUOChar = (entryRunUOChar == null ? "" : entryRunUOChar.Text.Trim());

                        ArrayList Selections = new ArrayList(info.Switches);

                        if (Selections.Contains(20))
                            this.importSkills = true;
                        else
                            this.importSkills = false;

                        if (Selections.Contains(21))
                            this.importItensToPlayer = true;
                        else
                            this.importItensToPlayer = false;

                        if (Selections.Contains(22))
                            this.importItensToStaff = true;
                        else
                            this.importItensToStaff = false;

                        StartImport();

                        break;
                    }

                case 0:
                default:
                    caller.SendMessage("Importacao CANCELADA.");
                    break;
            }
        }
開發者ID:greeduomacro,項目名稱:DimensionsNewAge,代碼行數:50,代碼來源:SphereImportGump.cs

示例4: OnResponse

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			Mobile from = sender.Mobile;
			int button = info.ButtonID - 1;

			if ( m_Type == -1 )
			{
				if ( button >= 0 && button < m_Types.Length )
					from.SendGump( new AddStairsGump( button ) );
			}
			else
			{
				if ( button >= 0 && button < 4 )
				{
					TextRelay levelx = info.GetTextEntry(0);
                    string slevel = (levelx == null ? null : levelx.Text.Trim());
                    int level = 0;
                    
                    if (slevel != null && slevel.Length != 0)
                    	int.TryParse(slevel, out level);
                    
                    if (level < 1) level = 1;
                    if (level > 20) level = 20;
                    
					from.SendGump( new AddStairsGump( m_Type, level) );
					CommandSystem.Handle( from, String.Format( "{0}Add {1} {2} {3}", CommandSystem.Prefix, m_Types[m_Type].m_Type.Name, (Facing) button, level) );
				}
				else
				{
					from.SendGump( new AddStairsGump() );
				}
			}
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:33,代碼來源:AddStairsGump.cs

示例5: OnResponse

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

				if ( text.Length == 0 )
				{
					m_From.SendMessage( 0x35, "You must enter a description." );
					m_From.SendGump( new PagePromptGump( m_From, m_Type ) );
				}
				else
				{
					m_From.SendLocalizedMessage( 501234, "", 0x35 ); /* The next available Counselor/Game Master will respond as soon as possible.
																	  * Please check your Journal for messages every few minutes.
																	  */

					PageQueue.Enqueue( new PageEntry( m_From, text, m_Type ) );
				}
			}
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:26,代碼來源:PagePromptGump.cs

示例6: OnResponse

		public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
		{
			if( _canEdit && _editMode )
			{
				string entryText = "";
				TextRelay relay;

				for( int i = 0; i < _numEntries; i++ )
				{
					relay = info.GetTextEntry( 100 + i );

					if( relay != null )
						entryText += relay.Text;
					else
						break;
				}

				if( entryText != _beheld.Profile )
					_beheld.Profile = entryText.Trim();
			}

			if( info.ButtonID == 5 )
				sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, _numEntries, !_editMode ) );
			else if( info.ButtonID == 10 )
				sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, Math.Min( MaxTextEntries, (_numEntries + 1) ), _editMode ) );
			else if( info.ButtonID == 20 )
				sender.Mobile.SendGump( new CharacterProfileGump( sender.Mobile, _beheld, Math.Max( MinTextEntries, (_numEntries - 1) ), _editMode ) );
		}
開發者ID:greeduomacro,項目名稱:hubroot,代碼行數:28,代碼來源:CharacterProfileGump.cs

示例7: 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,項目名稱:last-wish,代碼行數:35,代碼來源:AccountSearchGump.cs

示例8: 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

示例9: OnResponse

        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0: // Close/Cancel
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 1: // OK
                    {
                        TextRelay entry = info.GetTextEntry( 0 );
                        string code = ( entry == null ? "" : entry.Text.Trim() );

                        if ( code != "" )
                        {
                            from.SendLocalizedMessage( 1062098 ); // Your promotional code has been submitted.  We are processing your request.

                            PromotionalType type = PromotionalType.None;
                            bool success = false;
                            ( (PlayerMobile) from ).LastPromotionCode = code;

                            // TODO: Send query for inputed promo-code to database
                            // We must receive following results: bool success, PromotionalType type, string code

                            from.SendGump( new PromotionMessageGump( success, type, code ) );
                        }

                        break;
                    }
            }
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:35,代碼來源:PromotionalSystem.cs

示例10: CreateArray

		public List<string> CreateArray( RelayInfo info, Mobile from ) 
		{ 
			List<string> itemsName = new List<string>(); 

			for ( int i = 0;  i < 13; i++ ) 
			{ 
				TextRelay te = info.GetTextEntry( i ); 

				if ( te != null ) 
				{ 
					string str = te.Text; 

					if ( str.Length > 0 ) 
					{ 
						str = str.Trim(); 

						Type type = ItemSpawnerType.GetType( str ); 
                   
						if ( type != null ) 
							itemsName.Add( str ); 
						else 
							from.SendMessage( "{0} is not a valid type name.", str ); 
					} 
				} 
			} 

			return itemsName; 
		} 
開發者ID:Tukaramdas,項目名稱:ServUO-EC-Test-Fork,代碼行數:28,代碼來源:TownChestGump.cs

示例11: CreateArray

		public ArrayList CreateArray( RelayInfo info, Mobile from )
		{
			ArrayList subSpawnerD = new ArrayList();

			for ( int i = 0;  i < 15; i++ )
			{
				TextRelay te = info.GetTextEntry( i );

				if ( te != null )
				{
					string str = te.Text;

					if ( str.Length > 0 )
					{
						str = str.Trim();

						Type type = SpawnerType.GetType( str );

						if ( type != null )
							subSpawnerD.Add( str );
						else
							from.SendMessage( "{0} is not a valid type name.", str );
					}
				}
			}

			return subSpawnerD;
		}
開發者ID:greeduomacro,項目名稱:annox,代碼行數:28,代碼來源:PremiumSpawnerGumpD.cs

示例12: OnResponse

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			if ( info.ButtonID == 1 )
			{
				try
				{
					if ( m_From.AccessLevel >= AccessLevel.GameMaster )
					{
						TextRelay text = info.GetTextEntry( 0 );

						if ( text != null )
						{
							m_Skill.Base = Convert.ToDouble( text.Text );
							CommandLogging.LogChangeProperty( m_From, m_Target, String.Format( "{0}.Base", m_Skill ), m_Skill.Base.ToString() );
						}
					}
					else
					{
						m_From.SendMessage( "You may not change that." );
					}

					m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
				}
				catch
				{
					m_From.SendMessage( "Bad format. ###.# expected." );
					m_From.SendGump( new EditSkillGump( m_From, m_Target, m_Skill, m_Selected ) );
				}
			}
			else
			{
				m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
			}
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:34,代碼來源:SkillsGump.cs

示例13: OnResponse

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

			switch ( info.ButtonID )
			{
				case 1:
				{
					from.CloseGump( typeof( KillSearch ) );
					from.SendGump( new KillIndex( from, m_Book, m_KillList ) );
					break;
				}
				case 2:
				{
					TextRelay s = info.GetTextEntry( 0 );
					
					if ( s != null )
					{
						string search = s.Text;
						from.SendGump( new KillSearch( search, m_Book, m_KillList ));
					}
					break;
				}
			}
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:25,代碼來源:Search.cs

示例14: CreateArray

		public List<string> CreateArray( RelayInfo info, Mobile from )
		{
			List<string> creaturesName = new List<string>();

			for ( int i = 0;  i < 13; i++ )
			{
				TextRelay te = info.GetTextEntry( i );

				if ( te != null )
				{
					string str = te.Text;

					if ( str.Length > 0 )
					{
						str = str.Trim();

						string t = Spawner.ParseType( str );

						Type type = ScriptCompiler.FindTypeByName( t );

						if ( type != null )
							creaturesName.Add( str );
						else
							from.SendMessage( "{0} is not a valid type name.", t );
					}
				}
			}

			return creaturesName;
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:30,代碼來源:SpawnerGump.cs

示例15: 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 2:
                    {
                        TextRelay value = info.GetTextEntry( 1 );

                        int number;
                        try
                        {
                            number = Convert.ToInt32( value.Text );
                        }
                        catch
                        {
                            m_Player.SendMessage( "That value was not valid please try again." );
                            m_Player.CloseGump( typeof( InputGump ) );
                            m_Player.SendGump( new InputGump( m_Value, m_Property ) );
                            break;
                        }

                        if( number > 2147483647 || number < 0 )
                        {
                            m_Player.SendMessage( "This value may not be below 0 or above 2147483647. Please try again." );
                            m_Player.CloseGump( typeof( InputGump ) );
                            m_Player.SendGump( new InputGump( m_Value, m_Property ) );
                            break;
                        }

                        switch( m_Property.ToLower() )
                        {
                            case "purge days":
                                {
                                    ForumCore.AutoCleanupDays = number;
                                    break;
                                }
                            case "minimum characters":
                                {
                                    ForumCore.MinPostCharactersCount = number;
                                    break;
                                }
                            case "maximum characters":
                                {
                                    ForumCore.MaxPostCharactersCount = number;
                                    break;
                                }
                        }

                        m_Player.CloseGump( typeof( AdministrationGump ) );
                        m_Player.SendGump( new AdministrationGump( ) );
                        break;
                    }
            }
        }
開發者ID:greeduomacro,項目名稱:dragonknights-uo,代碼行數:59,代碼來源:InputGump.cs


注:本文中的Server.Gumps.RelayInfo.GetTextEntry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。