Thread: [Hyperion] Server-sided 'filtered' chat message system

Results 1 to 7 of 7
  1. #1 [Hyperion] Server-sided 'filtered' chat message system 
    Registered Member
    Nuevo's Avatar
    Join Date
    Jul 2008
    Posts
    647
    Thanks given
    7
    Thanks received
    13
    Rep Power
    169
    This code is for Hyperion. However, you can use this for educational purpose to make it work for any server.


    Purpose: To add a server-sided filterable send message system. When enabled by the player, any message deemed allowed to be filtered will not be sent to the player.
    This merely cancels the message being sent to the player, therefor when the filter to turned off, the player will still not be able to view messages filtered. Filter cautiously.


    Any messages you would like to allow to be filtered(not shown if enabled by the player) will look like the first as opposed to the original code under it:
    Code:
    player.getActionSender().sendMessage("You swing your pick at the rock...", true);
    
    player.getActionSender().sendMessage("You swing your pick at the rock...");
    You do NOT have to change any of the existing sendMessages to say false, not have to use the second argument to say false- only true.


    In ActionSender.java:
    Code:
            private boolean chatFilter;
    
            public void setChatFilter(boolean a) {
                    chatFilter = a;
            }
            
            /**
             * Send a message unless player's chat filter is enabled and message is filterable.
             * @param message The message to send.
             * @param filterable If the message is allowed to be filtered.
             * @return  The action sender instance, for chaining.
             */
            public ActionSender sendMessage(String message, boolean filterable) {
                    if ((filterable) && (chatFilter)) {
                            return this;
                    } else {
                            player.write(new PacketBuilder(253, Type.VARIABLE).putRS2String(message).toPacket());
                            return this;
                    }
        }

    In CommandPacketHandler.java:
    Code:
        else if(command.equals("chatfilter")) {
                   if(args.length == 2) {
                           int filter = Integer.parseInt(args[1]);
                            if (filter == 1) {
                                  player.getActionSender().setChatFilter(true);
                            } else {
                                     player.getActionSender().setChatFilter(false);
                            }
                       } else {
                        player.getActionSender().sendMessage("Syntax is ::chatfilter [0/1].");
                    }
        }
    Reply With Quote  
     

  2. #2  
    Community Veteran

    Dexter Morgan's Avatar
    Join Date
    Nov 2008
    Age
    28
    Posts
    4,419
    Thanks given
    1,184
    Thanks received
    757
    Rep Power
    3098
    Some odd code you have there...?

    I thought message filtering was suppose stop repeated messages being sent. This does not do that.
    Reply With Quote  
     

  3. #3  
    Banned [Hyperion] Server-sided 'filtered' chat message system Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    the client already does this with chat options? lol
    Reply With Quote  
     

  4. #4  
    Registered Member
    Nuevo's Avatar
    Join Date
    Jul 2008
    Posts
    647
    Thanks given
    7
    Thanks received
    13
    Rep Power
    169
    Quote Originally Posted by Dexter Morgan View Post
    Some odd code you have there...?

    I thought message filtering was suppose stop repeated messages being sent. This does not do that.
    It matches everything else.

    No, it filters out predetermined messages and types of messages that are repetitive. It will not show those messages a first time.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2015
    Posts
    64
    Thanks given
    17
    Thanks received
    11
    Rep Power
    3
    Should be client sided not server, gj tho
    Reply With Quote  
     

  6. #6  
    Registered Member
    Michael P's Avatar
    Join Date
    Dec 2013
    Posts
    1,264
    Thanks given
    499
    Thanks received
    321
    Rep Power
    674
    Quote Originally Posted by lare96 View Post
    the client already does this with chat options? lol
    Not until the 500's IRRC.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Nuevo's Avatar
    Join Date
    Jul 2008
    Posts
    647
    Thanks given
    7
    Thanks received
    13
    Rep Power
    169
    Quote Originally Posted by pkinghere View Post
    Should be client sided not server, gj tho
    Agree'd but many people aren't too able to edit clients like this and/or prefer to use a standard deob 317 client like me
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 208
    Last Post: 02-17-2015, 11:45 AM
  2. [$40] Server sided end of voting system
    By !!A!! in forum Requests
    Replies: 3
    Last Post: 04-24-2011, 12:22 PM
  3. Server-Sided Clan Chat [v2]
    By Runite in forum Tutorials
    Replies: 36
    Last Post: 11-22-2008, 07:37 PM
  4. Server-Sided Clan Chat (version 2)
    By Runite in forum Tutorials
    Replies: 16
    Last Post: 09-05-2008, 08:27 PM
  5. Server-Sided Clan Chat (uses quest interface)
    By Runite in forum Tutorials
    Replies: 20
    Last Post: 09-04-2008, 05:42 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •