Exemplo n.º 1
0
        public static void ShowCharacterName(ChatUser from, Channel channel, string param)
        {
            from.Anonymous = false;

            // You are now showing your character name to any players who inquire with the whois command.
            from.SendMessage(39);
        }
Exemplo n.º 2
0
 public static void DisallowPrivateMessages(ChatUser from, Channel channel, string param)
 {
     from.IgnorePrivateMessage = true;
     from.SendMessage(38);               /* You will no longer receive private messages.
                                          * Those who send you a message will be notified that you are blocking incoming messages.
                                          */
 }
Exemplo n.º 3
0
        public static void HideCharacterName(ChatUser from, Channel channel, string param)
        {
            from.Anonymous = true;

            // You are no longer showing your character name to any players who inquire with the whois command.
            from.SendMessage(40);
        }
Exemplo n.º 4
0
		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.
		}
Exemplo n.º 5
0
        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
            }
        }
Exemplo n.º 6
0
        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;
                }
            }

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

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

            Channel joined = Channel.FindChannelByName(name);

            if (joined == null)
            {
                from.SendMessage(33, name); // There is no conference named '%1'.
            }
            else
            {
                joined.AddUser(from, password);
            }
        }
Exemplo n.º 7
0
        public static void QueryWhoIs(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target == null)
            {
                return;
            }

            if (target.Anonymous)
            {
                from.SendMessage(41, target.Username); // %1 is remaining anonymous.
            }
            else
            {
                from.SendMessage(43, target.Username, target.Mobile.Name); // %2 is known in the lands of Britannia as %2.
            }
        }
Exemplo n.º 8
0
 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.
     }
 }
Exemplo n.º 9
0
        public static ChatUser SearchForUser(ChatUser from, string name)
        {
            var user = ChatUser.GetChatUser(name);

            if (user == null)
            {
                from.SendMessage(32, name); // There is no player named '%1'.
            }

            return(user);
        }
Exemplo n.º 10
0
        public static void JoinChannel(ChatUser from, Channel channel, string param)
        {
            string name;
            string password = null;

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

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

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

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

            password = password?.Trim().IsNullOrDefault(null);

            var joined = Channel.FindChannelByName(name);

            if (joined == null)
            {
                from.SendMessage(33, name); // There is no conference named '%1'.
            }
            else
            {
                joined.AddUser(from, password);
            }
        }
Exemplo n.º 11
0
		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
		}
Exemplo n.º 12
0
		public static void AllowPrivateMessages( ChatUser from, Channel channel, string param )
		{
			from.IgnorePrivateMessage = false;
			from.SendMessage( 37 ); // You can now receive private messages.
		}
Exemplo n.º 13
0
		public static void TogglePrivateMessages( ChatUser from, Channel channel, string param )
		{
			from.IgnorePrivateMessage = !from.IgnorePrivateMessage;
			from.SendMessage( from.IgnorePrivateMessage ? 38 : 37 ); // See above for messages
		}
Exemplo n.º 14
0
		public static void ShowCharacterName( ChatUser from, Channel channel, string param )
		{
			from.Anonymous = false;
			from.SendMessage( 39 ); // You are now showing your character name to any players who inquire with the whois command.
		}
Exemplo n.º 15
0
 public static void ToggleCharacterName(ChatUser from, Channel channel, string param)
 {
     from.Anonymous = !from.Anonymous;
     from.SendMessage(from.Anonymous ? 40 : 39); // See above for messages
 }
Exemplo n.º 16
0
 public static void TogglePrivateMessages(ChatUser from, Channel channel, string param)
 {
     from.IgnorePrivateMessage = !from.IgnorePrivateMessage;
     from.SendMessage(from.IgnorePrivateMessage ? 38 : 37); // See above for messages
 }
Exemplo n.º 17
0
 public static void AllowPrivateMessages(ChatUser from, Channel channel, string param)
 {
     from.IgnorePrivateMessage = false;
     from.SendMessage(37); // You can now receive private messages.
 }
Exemplo n.º 18
0
 public static void ChangeChannelPassword(ChatUser from, Channel channel, string param)
 {
     channel.Password = param;
     from.SendMessage(60); // The password to the conference has been changed.
 }
Exemplo n.º 19
0
		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.
		}
Exemplo n.º 20
0
		public static void ToggleCharacterName( ChatUser from, Channel channel, string param )
		{
			from.Anonymous = !from.Anonymous;
			from.SendMessage( from.Anonymous ? 40 : 39 ); // See above for messages
		}
Exemplo n.º 21
0
		public static void DisallowPrivateMessages( ChatUser from, Channel channel, string param )
		{
			from.IgnorePrivateMessage = true;
			from.SendMessage( 38 ); /* You will no longer receive private messages.
									 * Those who send you a message will be notified that you are blocking incoming messages.
									 */
		}
Exemplo n.º 22
0
		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;
				}
			}

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

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

			Channel joined = Channel.FindChannelByName( name );

			if ( joined == null )
				from.SendMessage( 33, name ); // There is no conference named '%1'.
			else
				joined.AddUser( from, password );
		}
Exemplo n.º 23
0
		public static void ChangeChannelPassword( ChatUser from, Channel channel, string param )
		{
			channel.Password = param;
			from.SendMessage( 60 ); // The password to the conference has been changed.
		}
Exemplo n.º 24
0
		public static void QueryWhoIs( ChatUser from, Channel channel, string param )
		{
			ChatUser target = ChatSystem.SearchForUser( from, param );

			if ( target == null )
				return;

			if ( target.Anonymous )
				from.SendMessage( 41, target.Username ); // %1 is remaining anonymous.
			else
				from.SendMessage( 43, target.Username, target.Mobile.Name ); // %2 is known in the lands of Britannia as %2.
		}