Mute a player

Re: [Release] Mute a player

Read the code! D: It blocks them from talking in all chat, period. PERIOD.

comma,? :(

Great release, surprised someone hasn't thought of this before. It's such a simple feature (not coding wise, I mean) and I have no doubt people could've used this many, many times before.
 
Re: [Release] Mute a player

where do you put


public boolean getCanTalk() {
return this.canTalk;
}

public boolean canTalk(boolean talk) {
return this.canTalk = talk;
}



which last closing bracket ?


Edit Goofy is helping me *
 
Last edited:
Re: [Release] Mute a player

i get this erros


D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:28: cannot find symbol
symbol : class Command
location: package net.sf.odinms.client.messages
import net.sf.odinms.client.messages.Command;
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:29: cannot find symbol
symbol : class CommandDefinition
location: package net.sf.odinms.client.messages
import net.sf.odinms.client.messages.CommandDefinition;
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:33: cannot find symbol
symbol: class Command
public class PunishmentCommands implements Command {
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:71: cannot find symbol
symbol : class CommandDefinition
location: class net.sf.odinms.client.messages.commands.PunishmentCommands
public CommandDefinition[] getDefinition() {
^
D:\PrivteMS\src\net\sf\odinms\provider\xmlwz\FileStoredPngMapleCanvas.java:14: warning: com.sun.imageio.plugins.png.PNGImageReaderSpi is Sun proprietary API and may be removed in a future release
import com.sun.imageio.plugins.png.PNGImageReaderSpi;
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:26: cannot find symbol
symbol : static joinAfterString
location: class net.sf.odinms.client.messages.CommandProcessor
import static net.sf.odinms.client.messages.CommandProcessor.joinAfterString;
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:25: cannot find symbol
symbol : static getNamedIntArg
location: class net.sf.odinms.client.messages.CommandProcessor
import static net.sf.odinms.client.messages.CommandProcessor.getNamedIntArg;
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:34: method does not override or implement a method from a supertype
@Override
^
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:72: cannot find symbol
symbol : class CommandDefinition
location: class net.sf.odinms.client.messages.commands.PunishmentCommands
return new CommandDefinition[] {
^
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:73: cannot find symbol
symbol : class CommandDefinition
location: class net.sf.odinms.client.messages.commands.PunishmentCommands
new CommandDefinition("mute", "victim set", "Takes away or gives back a player's ability to talk.", 1000),
^
D:\PrivteMS\src\net\sf\odinms\client\messages\PunishmentCommands.java:70: method does not override or implement a method from a supertype
@Override
^
D:\PrivteMS\src\net\sf\odinms\net\channel\handler\GeneralchatHandler.java:37: cannot find symbol
symbol : method getInstance()
location: class net.sf.odinms.client.messages.CommandProcessor
if (!CommandProcessor.getInstance().processCommand(c, text)) {
^
D:\PrivteMS\src\net\sf\odinms\net\channel\handler\GeneralchatHandler.java:45: getChatText(int,java.lang.String,int) in net.sf.odinms.tools.MaplePacketCreator cannot be applied to (int,java.lang.String)
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text));
D:\PrivteMS\src\net\sf\odinms\provider\xmlwz\FileStoredPngMapleCanvas.java:47: warning: com.sun.imageio.plugins.png.PNGImageReaderSpi is Sun proprietary API and may be removed in a future release
ImageReaderSpi readerSpi = iioRegistry.getServiceProviderByClass(PNGImageReaderSpi.class);
^
Note: D:\PrivteMS\src\net\sf\odinms\net\channel\pvp\MaplePvp.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
12 errors
2 warnings
BUILD FAILED (total time: 1 second)

this how my client messages looks:

iGoofy - Mute a player - RaGEZONE Forums

I get the same exact error....
 
Re: [Release] Mute a player

Code:
init:
deps-jar:
Compiling 3 source files to C:\Documents and Settings\Kylie\Desktop\AlpheusMS V4 - Copy\AlpheusMS V2\AlpheusMS V2\dist\build\classes
C:\Documents and Settings\Kylie\Desktop\AlpheusMS V4 - Copy\AlpheusMS V2\AlpheusMS V2\src\net\sf\odinms\net\channel\handler\GeneralchatHandler.java:37: cannot find symbol
symbol  : method getInstance()
location: class net.sf.odinms.client.messages.CommandProcessor
                if (!CommandProcessor.getInstance().processCommand(c, text)) {
                                     ^
C:\Documents and Settings\Kylie\Desktop\AlpheusMS V4 - Copy\AlpheusMS V2\AlpheusMS V2\src\net\sf\odinms\net\channel\handler\GeneralchatHandler.java:45: getChatText(int,java.lang.String,int) in net.sf.odinms.tools.MaplePacketCreator cannot be applied to (int,java.lang.String)
                            c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text));
Gotten this errors

Same. D:
 
Re: [Release] Mute a player

You guys getting the error cos you guys putting rev 988+ stuff into below 988 rev source. Scroll down to the bottom of the 1st post, theres an older version that goofy put. Copy that and put in commandprocessor.java. I didn't get any compile errors, but the command doens't work.

It shows on notice "You got muted." "(name) has been muted.)" but they can still talk.... you sure this works?
 
Re: [Release] Mute a player

You guys getting the error cos you guys putting rev 988+ stuff into below 988 rev source. Scroll down to the bottom of the 1st post, theres an older version that goofy put. Copy that and put in commandprocessor.java. I didn't get any compile errors, but the command doens't work.

It shows on notice "You got muted." "(name) has been muted.)" but they can still talk.... you sure this works?
Unless all of the testing that proved successful was all a lie, yes I'm absolutely sure it works. <_<"
 
Re: [Release] Mute a player

Goofy you stopped helping me D:

and if your sure it works post the src of sean's repack 5.9 and add your mute thing and see if it works goofy
 
Re: [Release] Mute a player

Unless all of the testing that proved successful was all a lie, yes I'm absolutely sure it works. <_<"
Well it does block players from chat but, they can chat throught buddy(confirmed), party(not sure yet), guild(not sure yet) or whisper(not sure yet)
 
Re: [Release] Mute a player

Well it does block players from chat but, they can chat throught buddy(confirmed), party(not sure yet), guild(not sure yet) or whisper(not sure yet)
It's only going to block general chat, obviously. I'm going to make it block for all chats for my own server, so feel free to do it yourself. :o
 
Re: [Release] Mute a player

Use mine

GeneralChatHandler.java
Code:
/*
    This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <[email protected]> 
                       Matthias Butz <[email protected]>
                       Jan Christian Meyer <[email protected]>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package net.sf.odinms.net.channel.handler;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.CommandProcessor;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.StringUtil;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;

public class GeneralchatHandler extends AbstractMaplePacketHandler {
    @Override
    public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
        String text = slea.readMapleAsciiString();
                boolean warning;

        if (!CommandProcessor.processCommand(c, text)) {
            if (StringUtil.countCharacters(text, '@') > 4 || StringUtil.countCharacters(text, '%') > 4 ||
                StringUtil.countCharacters(text, '+') > 6 || StringUtil.countCharacters(text, '$') > 6 ||
                StringUtil.countCharacters(text, '&') > 6 || StringUtil.countCharacters(text, '~') > 6 ||
                StringUtil.countCharacters(text, 'W') > 6) {
                text = "DISREGARD THAT I SUCK COCK.";
            }
                        if (c.getPlayer().getCanTalk() == true) {
                            c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().isGM() ? 1 : 0));
                        } else {
                            c.getPlayer().getClient().getChannelServer().broadcastPacket(MaplePacketCreator.serverNotice(6, "You have been muted and therefore unable to talk."));
                        }
        }
    }
}
 
Back