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


C# Chat.Channel類代碼示例

本文整理匯總了C#中Server.Engines.Chat.Channel的典型用法代碼示例。如果您正苦於以下問題:C# Channel類的具體用法?C# Channel怎麽用?C# Channel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: EmoteMessage

		public static void EmoteMessage( ChatUser from, Channel channel, string param )
		{
			if ( channel.CanTalk( from ) )
				channel.SendIgnorableMessage( 58, from, from.GetColorCharacter() + from.Username, param ); // %1 %2
			else
				from.SendMessage( 36 ); // The moderator of this conference has not given you speaking priviledges.
		}
開發者ID:Godkong,項目名稱:RunUO,代碼行數:7,代碼來源:ChatActionHandlers.cs

示例2: AddVoice

        public static void AddVoice( ChatUser from, Channel channel, string param )
        {
            ChatUser target = ChatSystem.SearchForUser( from, param );

            if ( target != null )
                channel.AddVoiced( target, from );
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:7,代碼來源:ChatActionHandlers.cs

示例3: AddIgnore

        public static void AddIgnore( ChatUser from, Channel channel, string param )
        {
            ChatUser target = ChatSystem.SearchForUser( from, param );

            if ( target == null )
                return;

            from.AddIgnored( target );
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:9,代碼來源:ChatActionHandlers.cs

示例4: AddChannel

        public static Channel AddChannel( string name )
        {
            Channel channel = FindChannelByName( name );

            if ( channel == null )
            {
                channel = new Channel( name );
                m_Channels.Add( channel );
            }

            ChatUser.GlobalSendCommand( ChatCommand.AddChannel, name, "0" );

            ChatLogging.LogCreateChannel( name );

            return channel;
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:16,代碼來源:Channel.cs

示例5: PrivateMessage

		public static void PrivateMessage( ChatUser from, Channel channel, string param )
		{
			int indexOf = param.IndexOf( ' ' );

			string name = param.Substring( 0, indexOf );
			string text = param.Substring( indexOf + 1 );

			ChatUser target = ChatSystem.SearchForUser( from, name );

			if ( target == null )
				return;

			if ( target.IsIgnored( from ) )
				from.SendMessage( 35, target.Username ); // %1 has chosen to ignore you. None of your messages to them will get through.
			else if ( target.IgnorePrivateMessage )
				from.SendMessage( 42, target.Username ); // %1 has chosen to not receive private messages at the moment.
			else
				target.SendMessage( 59, from.Mobile, from.GetColorCharacter() + from.Username, text ); // [%1]: %2
		}
開發者ID:Godkong,項目名稱:RunUO,代碼行數:19,代碼來源:ChatActionHandlers.cs

示例6: JoinChannel

		public static void JoinChannel( ChatUser from, Channel channel, string param )
		{
			string name;
			string password = null;

			int start = param.IndexOf( '\"' );

			if ( start >= 0 )
			{
				int end = param.IndexOf( '\"', ++start );

				if ( end >= 0 )
				{
					name = param.Substring( start, end - start );
					password = param.Substring( ++end );
				}
				else
				{
					name = param.Substring( start );
				}
			}
			else
			{
				int indexOf = param.IndexOf( ' ' );

				if ( indexOf >= 0 )
				{
					name = param.Substring( 0, indexOf++ );
					password = param.Substring( indexOf );
				}
				else
				{
					name = param;
				}
			}

			CreateAndJoin( from, name );
		}
開發者ID:zerodowned,項目名稱:justuo-with-ec-support,代碼行數:38,代碼來源:ChatActionHandlers.cs

示例7: HideCharacterName

		public static void HideCharacterName( ChatUser from, Channel channel, string param )
		{
			from.Anonymous = true;
			from.SendMessage( 40 ); // You are no longer showing your character name to any players who inquire with the whois command.
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:5,代碼來源:ChatActionHandlers.cs

示例8: AddChannel

		public static Channel AddChannel( string name, string password )
		{
			Channel channel = FindChannelByName( name );

			if ( channel == null )
			{
				channel = new Channel( name, password );
				m_Channels.Add( channel );
			}

			ChatUser.GlobalSendCommand( ChatCommand.AddChannel, name, "0" ) ; 

			return channel;
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:14,代碼來源:Channel.cs

示例9: DisableDefaultVoice

		public static void DisableDefaultVoice( ChatUser from, Channel channel, string param )
		{
			channel.VoiceRestricted = true;
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:4,代碼來源:ChatActionHandlers.cs

示例10: RenameChannel

		public static void RenameChannel( ChatUser from, Channel channel, string param )
		{
			channel.Name = param;
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:4,代碼來源:ChatActionHandlers.cs

示例11: RemoveModerator

		public static void RemoveModerator( ChatUser from, Channel channel, string param )
		{
			ChatUser target = ChatSystem.SearchForUser( from, param );

			if ( target != null )
				channel.RemoveModerator( target, from );
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:7,代碼來源:ChatActionHandlers.cs

示例12: JoinNewChannel

		public static void JoinNewChannel( ChatUser from, Channel channel, string param )
		{
			if ( (param = param.Trim()).Length == 0 )
				return;

			string name;
			string password = null;

			int start = param.IndexOf( '{' );

			if ( start >= 0 )
			{
				name = param.Substring( 0, start++ );

				int end = param.IndexOf( '}', start );

				if ( end >= start )
					password = param.Substring( start, end - start );
			}
			else
			{
				name = param;
			}

			if ( password != null )
				password = password.Trim();

			if ( password != null && password.Length == 0 )
				password = null;

			Channel.AddChannel( name, password ).AddUser( from, password );
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:32,代碼來源:ChatActionHandlers.cs

示例13: RemoveChannel

        public static void RemoveChannel( Channel channel )
        {
            if ( channel == null )
                return;

            if ( m_Channels.Contains( channel ) && channel.m_Users.Count == 0 )
            {
                ChatUser.GlobalSendCommand( ChatCommand.RemoveChannel, channel.Name );

                m_Channels.Remove( channel );

                ChatLogging.LogRemoveChannel( channel.Name );
            }
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:14,代碼來源:Channel.cs

示例14: CreateChannel

		public static void CreateChannel( ChatUser from, Channel channel, string param )
		{
			CreateAndJoin( from, param );
		}
開發者ID:zerodowned,項目名稱:justuo-with-ec-support,代碼行數:4,代碼來源:ChatActionHandlers.cs

示例15: ToggleCharacterName

		public static void ToggleCharacterName( ChatUser from, Channel channel, string param )
		{
			from.Anonymous = !from.Anonymous;
			from.SendMessage( from.Anonymous ? 40 : 39 ); // See above for messages
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:5,代碼來源:ChatActionHandlers.cs


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