Thread: Commands [PI]

Results 1 to 9 of 9
  1. #1 Commands [PI] 
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Hey guys,
    The mute, ipmute, or ban command will not work on this server. Every time I try to mute someone, the target is still allowed to talk, same with ipmute. When I try to ban someone, it will kick them but they will be able to log back in. This is based off of virtue and krithium.
    Thanks
    Reply With Quote  
     

  2. #2  
    Donator
    Smile Cow's Avatar
    Join Date
    Apr 2014
    Posts
    214
    Thanks given
    51
    Thanks received
    34
    Rep Power
    40
    Post the commands or the banplayer related methods.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Ban:
    Code:
    if (cmd.startsWith("ban") && cmd.charAt(3) == ' ') {
    			try {	
    				String playerToBan = cmd.substring(4);
    				Connection.addNameToBanList(playerToBan);
    				Connection.addNameToFile(playerToBan);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(PlayerHandler.players[i] != null) {
    						if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    							PlayerHandler.players[i].disconnected = true;
    							Player c2 = (Player)PlayerHandler.players[i];
    							c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
    						} 
    					}
    				}
    			} catch(Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}
    		}
    Mute:
    Code:
    if (cmd.startsWith("mute")) {
    			try {
    				String playerToBan = cmd.substring(5);
    				Connection.addNameToMuteList(playerToBan);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (PlayerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName
    								.equalsIgnoreCase(playerToBan)) {
    							Player c2 = (Player) PlayerHandler.players[i];
    							c2.sendMessage("You have been muted by: "
    									+ c.playerName);
    							break;
    						}
    					}
    				}
    			} catch (Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}
    		}
    Ip-Mute:
    Code:
    if (cmd.startsWith("ipmute")) {
    			try {	
    				String playerToBan = cmd.substring(7);
    				for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(PlayerHandler.players[i] != null) {
    						if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    							Connection.addIpToMuteList(PlayerHandler.players[i].connectedFrom);
    							c.sendMessage("You have IP Muted the user: "+PlayerHandler.players[i].playerName);
    							Player c2 = (Player)PlayerHandler.players[i];
    							c2.sendMessage("You have been muted by: " + c.playerName);
    							c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
    							break;
    						} 
    					}
    				}
    			} catch(Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}	
    		}
    	}
    
    }
    Chat.java:
    Code:
    	@Override
    	public void processPacket(final Player c, final int packetType,
    			final int packetSize) {
    		c.setChatTextEffects(c.getInStream().readUnsignedByteS());
    		c.setChatTextColor(c.getInStream().readUnsignedByteS());
    		c.setChatTextSize((byte) (c.packetSize - 2));
    		c.inStream.readBytes_reverseA(c.getChatText(), c.getChatTextSize(), 0);
    		c.getPA().writeChatLog(Misc.textUnpack(c.getChatText(), packetSize-2));
    		ReportHandler.addText(c.playerName, c.getChatText(), packetSize - 2);
    		if (System.currentTimeMillis() < c.muteEnd) {
    			c.sendMessage("You are muted, send an appeal on the forums.");
    			return;
    		} else {
    			c.setChatTextUpdateRequired(true);
    			c.muteEnd = 0;
    		}
    	}
    }
    Reply With Quote  
     

  4. #4  
    Donator
    Smile Cow's Avatar
    Join Date
    Apr 2014
    Posts
    214
    Thanks given
    51
    Thanks received
    34
    Rep Power
    40
    I'm assuming you get no errors, but PI usually uses playerCommand instead of cmd for server sided commands. Other than that those commands look good. Are you using an IDE?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Yes, I'm using an IDE. Could timed mutes possibly be interfering with this?
    Reply With Quote  
     

  6. #6  
    Donator
    Smile Cow's Avatar
    Join Date
    Apr 2014
    Posts
    214
    Thanks given
    51
    Thanks received
    34
    Rep Power
    40
    Quote Originally Posted by awesomenoob View Post
    Yes, I'm using an IDE. Could timed mutes possibly be interfering with this?
    Possibly, if you have teamviewer, I have nothing else to do right now, and I could help you with your cache problem too.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    I figured the cache problem out, I wish to stay on here. I tried making a few changes in connection.java as well, but it didn't work.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    Quote Originally Posted by awesomenoob View Post
    I figured the cache problem out, I wish to stay on here. I tried making a few changes in connection.java as well, but it didn't work.
    Refer to my thread, http://www.rune-server.org/runescape...-krithium.html
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Quote Originally Posted by Our Promise View Post
    I will check it out soon, thanks so much dude!
    -Worked, thank you so much!
    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. client commands [pi]
    By Ninja assassin in forum Help
    Replies: 4
    Last Post: 08-26-2010, 12:33 PM
  2. command [pi]
    By ilike to own in forum Help
    Replies: 9
    Last Post: 08-24-2010, 09:37 AM
  3. [PI] How to make Commands? [PI]
    By Amirtje12 in forum Help
    Replies: 4
    Last Post: 08-20-2010, 12:46 PM
  4. [PI] ::ChangePassword command [PI]
    By Cal_Short in forum Help
    Replies: 1
    Last Post: 08-17-2010, 07:13 AM
  5. Help with this pickup command..[pi]
    By ICEAuthority in forum Help
    Replies: 4
    Last Post: 05-31-2010, 10:38 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
  •