Many Users Don't Receive Bukkit.getServer().broadcastMessage()

Discussion in 'Plugin Development' started by jkcclemens, Dec 8, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    jkcclemens

    I have a command that outputs something like "jkcclemens slaps <player>!", but several users are not seeing these. They could see them yesterday, but they're just not showing up now (I see them, and so does the console).

    Code:
    
    } else if (cmd.getName().equalsIgnoreCase("slap")) {
    			if (!isAuthorized(sender, "rcmds.slap")) {
    				sender.sendMessage(ChatColor.RED
    						+ "You don't have permission for that!");
    				log.warning("[RoyalCommands] " + sender.getName()
    						+ " was denied access to the command!");
    				return true;
    			} else {
    				if (args.length < 1) {
    					return false;
    				}
    				if (getOnline(args[0]) == false) {
    					sender.sendMessage(ChatColor.RED
    							+ "That person is not online!");
    					return true;
    				} else {
    					victim = (Player) plugin.getServer().getPlayer(args[0]);
    					if (isAuthorized(victim, "rcmds.slap.exempt")) {
    						sender.sendMessage(ChatColor.RED
    								+ "You may not slap that player.");
    						return true;
    					} else {
    						Bukkit.getServer().broadcastMessage(
    								ChatColor.GOLD + sender.getName()
    										+ ChatColor.WHITE + " slaps "
    										+ ChatColor.RED + victim.getName()
    										+ ChatColor.WHITE + "!");
    						return true;
    					}
    				}
    			}
    
    Sorry for the lack of indents, that's how it copies it. Anyway, there are no errors, they just straight up can't see the broadcasts. I've tried Bukkit.getServer().broadcastMessage(), plugin.getServer()..., and this.getServer()..., all to no success.

    I'm running iChat if that's any help.

    Any suggestions?
     
  2. Offline

    dadaking

    I have a similar problem.

    When we restart our server. All player can see all broadcast message. But after 3-4 hours, a lot of player can't see broadcast message and the most strange, it's the other player can see ...

    If someone had this problem and solved it. I wait his answer :)

    (Sorry for my poor english :( )
     
  3. Offline

    wwsean08

    there is an open bug report for this on bukkits bug system so hopefully someone can track it down
     
  4. Offline

    md_5

    Instead of the bukkit broadcast methods I use,
    Code:
    for(Player p : Bukkit.getServer().getOnlinePlayers()){
    p.sendMessage("Hello");
    }
     
    Tanite likes this.
  5. Offline

    dadaking

    Yes, it's a solution. If the probleme is always here, I think i do that :)
     
Thread Status:
Not open for further replies.

Share This Page