Jump to content

Search the Community

Showing results for tags 'flagging'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. [CENTER]Hello, some of you who are hosting a live server might find this useful. It took like 2 minutes to write though so you need to add more words to flag censor. Add this String in your Config.java [CODE]/** * The words that player gets flagged. */ public static final String[] FLAG_WORDS = {"www.", ".com", ".c0m", ".co.uk", ".net", ".org", ".zzl.org", ".0rg", ".c0 m"};[/CODE] Add in Client java this: [CODE] private PlayerFlag playerFlag = new PlayerFlag(this);[/CODE] [CODE]public PlayerFlag getPlayerFlag() { return playerFlag; }[/CODE] PlayerFlag.java [CODE]package server.antimacro; import server.Configuration; import server.Connection; import server.model.players.Client; import server.model.players.Player; import server.model.players.PlayerHandler; public class PlayerFlag { /** * The maxinum amount of flags until player will be force banned. */ public static final int MAX_FLAGS = 25; /** * Represents the flag amount. */ private int flags; /** * Client instance. */ private Client c; /** * Constructs the PlayerFlag. * [MENTION=75098]Para[/MENTION]m c * */ public PlayerFlag(Client c) { this.c = c; } /** * Processes player flagging. */ public void process(String message) { for (String flagWords : Configuration.FLAG_WORDS) if (message.toLowerCase().contains(flagWords)) { c.sendMessage("Your character has received a warning. (Total flags: "+flags+"/"+MAX_FLAGS+")"); flags++; if (flags == MAX_FLAGS) { Connection.addNameToBanList(c.playerName); Connection.addNameToFile(c.playerName); PlayerHandler.getPlayer(c.playerName).disconnected = true; c.forceLogout(); flags = 0; } return; } } } [/CODE] Replace your Chat packet with mine. [CODE]package server.model.players.packets; import server.Connection; import server.model.players.Client; import server.model.players.PacketType; import server.util.Misc; /** * Chat **/ public class Chat implements PacketType { [MENTION=15855]Over[/MENTION]ride public void processPacket(Client c, int packetType, 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); String message = Misc.textUnpack(c.getChatText(), c.packetSize - 2).toLowerCase(); if (System.currentTimeMillis() < c.muteEnd) { c.sendMessage("You are muted for breaking a rule."); return; } else { c.muteEnd = 0; } ReportHandler.addText(c.playerName, c.getChatText(), packetSize - 2); if (!Connection.isMuted(c)) { c.setChatTextUpdateRequired(true); c.getPlayerFlag().process(message); } else { c.sendMessage("You are muted for breaking a rule."); return; } } } [/CODE] [B]Media[/B] [img]http://puu.sh/akmjn/3314089d66.jpg[/img] Okay now i've advertised 25 times, this is what has happened. [img]http://puu.sh/akmDB/c9f224a920.jpg[/img] You can of course change the maxinum flags to more. Next you're probably going to ask how you change it? -Simple, even cave man can do it. In PlayerFlags.java you'll find this at top of the file: [CODE]public static final int MAX_FLAGS = 25;[/CODE] Change the number to higher or lower to change maxinum flag amount. EDIT: Update - Force logout method, add this to Client.java [code]/** * Sends to the player a forced logout. */ public void forceLogout() { if (this.clan != null) { this.clan.removeMember(this); } outStream.createFrame(109); if (hasNpc == true) getSummoning().pickUpClean(this, summonId); CycleEventHandler.getSingleton().stopEvents(this); properLogout = true; ConnectedFrom.addConnectedFrom(this, connectedFrom); }[/code] [B][U]Credits to Fuzen Seth[/U][/B][/CENTER]
×