Jump to content

FactorX

Members
  • Posts

    116
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by FactorX

  1. /* * Copyright (C) 2004-2016 L2J Server * * This file is part of L2J Server. * * L2J Server is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Server 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.network.clientpackets; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.ChatHandler; import com.l2jserver.gameserver.handler.IChatHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.effects.L2EffectType; import com.l2jserver.gameserver.model.events.EventDispatcher; import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerChat; import com.l2jserver.gameserver.model.events.returns.ChatFilterReturn; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; import com.l2jserver.gameserver.util.Util; /** * This class ... * @version $Revision: 1.16.2.12.2.7 $ $Date: 2005/04/11 10:06:11 $ */ public final class Say2 extends L2GameClientPacket { private static final String _C__49_SAY2 = "[C] 49 Say2"; private static Logger _logChat = Logger.getLogger("chat"); public static final int ALL = 0; public static final int SHOUT = 1; // ! public static final int TELL = 2; public static final int PARTY = 3; // # public static final int CLAN = 4; // @ public static final int GM = 5; public static final int PETITION_PLAYER = 6; // used for petition public static final int PETITION_GM = 7; // * used for petition public static final int TRADE = 8; // + public static final int ALLIANCE = 9; // $ public static final int ANNOUNCEMENT = 10; public static final int BOAT = 11; public static final int L2FRIEND = 12; public static final int MSNCHAT = 13; public static final int PARTYMATCH_ROOM = 14; public static final int PARTYROOM_COMMANDER = 15; // (Yellow) public static final int PARTYROOM_ALL = 16; // (Red) public static final int HERO_VOICE = 17; public static final int CRITICAL_ANNOUNCE = 18; public static final int SCREEN_ANNOUNCE = 19; public static final int BATTLEFIELD = 20; public static final int MPCC_ROOM = 21; public static final int NPC_ALL = 22; public static final int NPC_SHOUT = 23; private static final String[] CHAT_NAMES = { "ALL", "SHOUT", "TELL", "PARTY", "CLAN", "GM", "PETITION_PLAYER", "PETITION_GM", "TRADE", "ALLIANCE", "ANNOUNCEMENT", // 10 "BOAT", "L2FRIEND", "MSNCHAT", "PARTYMATCH_ROOM", "PARTYROOM_COMMANDER", "PARTYROOM_ALL", "HERO_VOICE", "CRITICAL_ANNOUNCE", "SCREEN_ANNOUNCE", "BATTLEFIELD", "MPCC_ROOM" }; private static final String[] WALKER_COMMAND_LIST = { "USESKILL", "USEITEM", "BUYITEM", "SELLITEM", "SAVEITEM", "LOADITEM", "MSG", "DELAY", "LABEL", "JMP", "CALL", "RETURN", "MOVETO", "NPCSEL", "NPCDLG", "DLGSEL", "CHARSTATUS", "POSOUTRANGE", "POSINRANGE", "GOHOME", "SAY", "EXIT", "PAUSE", "STRINDLG", "STRNOTINDLG", "CHANGEWAITTYPE", "FORCEATTACK", "ISMEMBER", "REQUESTJOINPARTY", "REQUESTOUTPARTY", "QUITPARTY", "MEMBERSTATUS", "CHARBUFFS", "ITEMCOUNT", "FOLLOWTELEPORT" }; private String _text; private int _type; private String _target; @Override protected void readImpl() { _text = readS(); _type = readD(); _target = (_type == TELL) ? readS() : null; } @Override protected void runImpl() { if (Config.DEBUG) { _log.info("Say2: Msg Type = '" + _type + "' Text = '" + _text + "'."); } L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) { return; } if ((_type < 0) || (_type >= CHAT_NAMES.length)) { _log.warning("Say2: Invalid type: " + _type + " Player : " + activeChar.getName() + " text: " + String.valueOf(_text)); activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.logout(); return; } if (_text.isEmpty()) { _log.warning(activeChar.getName() + ": sending empty text. Possible packet hack!"); activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.logout(); return; } // Even though the client can handle more characters than it's current limit allows, an overflow (critical error) happens if you pass a huge (1000+) message. // July 11, 2011 - Verified on High Five 4 official client as 105. // Allow higher limit if player shift some item (text is longer then). if (!activeChar.isGM() && (((_text.indexOf(8) >= 0) && (_text.length() > 500)) || ((_text.indexOf(8) < 0) && (_text.length() > 105)))) { activeChar.sendPacket(SystemMessageId.DONT_SPAM); return; } if (Config.L2WALKER_PROTECTION && (_type == TELL) && checkBot(_text)) { Util.handleIllegalPlayerAction(activeChar, "Client Emulator Detect: Player " + activeChar.getName() + " using l2walker.", Config.DEFAULT_PUNISH); return; } if (activeChar.isCursedWeaponEquipped() && ((_type == TRADE) || (_type == SHOUT))) { activeChar.sendPacket(SystemMessageId.SHOUT_AND_TRADE_CHAT_CANNOT_BE_USED_WHILE_POSSESSING_CURSED_WEAPON); return; } if (activeChar.isChatBanned() && (_text.charAt(0) != '.')) { if (activeChar.getEffectList().getFirstEffect(L2EffectType.CHAT_BLOCK) != null) { activeChar.sendPacket(SystemMessageId.YOU_HAVE_BEEN_REPORTED_SO_CHATTING_NOT_ALLOWED); } else { for (int chatId : Config.BAN_CHAT_CHANNELS) { if (_type == chatId) { activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); } } } return; } if (activeChar.isJailed() && Config.JAIL_DISABLE_CHAT) { if ((_type == TELL) || (_type == SHOUT) || (_type == TRADE) || (_type == HERO_VOICE)) { activeChar.sendMessage("You can not chat with players outside of the jail."); return; } } if ((_type == PETITION_PLAYER) && activeChar.isGM()) { _type = PETITION_GM; } if (Config.LOG_CHAT) { LogRecord record = new LogRecord(Level.INFO, _text); record.setLoggerName("chat"); if (_type == TELL) { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + " to " + _target + "]" }); } else { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + "]" }); } _logChat.log(record); } if (_text.indexOf(8) >= 0) { if (!parseAndPublishItem(activeChar)) { return; } } final ChatFilterReturn filter = EventDispatcher.getInstance().notifyEvent(new OnPlayerChat(activeChar, L2World.getInstance().getPlayer(_target), _text, _type), ChatFilterReturn.class); if (filter != null) { _text = filter.getFilteredText(); } // Say Filter implementation if (Config.USE_SAY_FILTER) { checkText(); } final IChatHandler handler = ChatHandler.getInstance().getHandler(_type); if (handler != null) { handler.handleChat(_type, activeChar, _target, _text); } else { _log.info("No handler registered for ChatType: " + _type + " Player: " + getClient()); } } private boolean checkBot(String text) { for (String botCommand : WALKER_COMMAND_LIST) { if (text.startsWith(botCommand)) { return true; } } return false; } private void checkText() { String filteredText = _text; for (String pattern : Config.FILTER_LIST) { filteredText = filteredText.replaceAll("(?i)" + pattern, Config.CHAT_FILTER_CHARS); } _text = filteredText; } private boolean parseAndPublishItem(L2PcInstance owner) { int pos1 = -1; while ((pos1 = _text.indexOf(8, pos1)) > -1) { int pos = _text.indexOf("ID=", pos1); if (pos == -1) { return false; } StringBuilder result = new StringBuilder(9); pos += 3; while (Character.isDigit(_text.charAt(pos))) { result.append(_text.charAt(pos++)); } int id = Integer.parseInt(result.toString()); L2Object item = L2World.getInstance().findObject(id); if (item instanceof L2ItemInstance) { if (owner.getInventory().getItemByObjectId(id) == null) { _log.info(getClient() + " trying publish item which doesnt own! ID:" + id); return false; } ((L2ItemInstance) item).publish(); } else { _log.info(getClient() + " trying publish object which is not item! Object:" + item); return false; } pos1 = _text.indexOf(8, pos) + 1; if (pos1 == 0) // missing ending tag { _log.info(getClient() + " sent invalid publish item msg! ID:" + id); return false; } } return true; } @Override public String getType() { return _C__49_SAY2; } @Override protected boolean triggersOnActionRequest() { return false; } } Here it's my code..(untouched)=L2jServer
  2. i still understand..maybe i`m stupid or i`m bored. i don;t know
  3. It's a simple edit in java...isn't complicated..i no need full pack..:( if you want to help me is good. If not...that's it
  4. https://www.facebook.com/VercettiOfficial/videos/1997489273828281/ look here...first of video...and look at first chat (up). I want something like that
  5. I want to show you something..like i want
  6. ok..you give me that code...but where i have to put? to end of code?
  7. what is this blabla? :)
  8. now i post the project...someone help me?
  9. Hi Bogdy1, To make your server from 0, you can try to compile. Here it's link with how you can make that. http://www.l2jserver.com/forum/viewtopic.php?t=32261
  10. l2jserver is the project. and here it`s my Say2.java (untouched, clean) /* * Copyright (C) 2004-2016 L2J Server * * This file is part of L2J Server. * * L2J Server is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Server 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.network.clientpackets; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.ChatHandler; import com.l2jserver.gameserver.handler.IChatHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.effects.L2EffectType; import com.l2jserver.gameserver.model.events.EventDispatcher; import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerChat; import com.l2jserver.gameserver.model.events.returns.ChatFilterReturn; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; import com.l2jserver.gameserver.util.Util; /** * This class ... * @version $Revision: 1.16.2.12.2.7 $ $Date: 2005/04/11 10:06:11 $ */ public final class Say2 extends L2GameClientPacket { private static final String _C__49_SAY2 = "[C] 49 Say2"; private static Logger _logChat = Logger.getLogger("chat"); public static final int ALL = 0; public static final int SHOUT = 1; // ! public static final int TELL = 2; public static final int PARTY = 3; // # public static final int CLAN = 4; // @ public static final int GM = 5; public static final int PETITION_PLAYER = 6; // used for petition public static final int PETITION_GM = 7; // * used for petition public static final int TRADE = 8; // + public static final int ALLIANCE = 9; // $ public static final int ANNOUNCEMENT = 10; public static final int BOAT = 11; public static final int L2FRIEND = 12; public static final int MSNCHAT = 13; public static final int PARTYMATCH_ROOM = 14; public static final int PARTYROOM_COMMANDER = 15; // (Yellow) public static final int PARTYROOM_ALL = 16; // (Red) public static final int HERO_VOICE = 17; public static final int CRITICAL_ANNOUNCE = 18; public static final int SCREEN_ANNOUNCE = 19; public static final int BATTLEFIELD = 20; public static final int MPCC_ROOM = 21; public static final int NPC_ALL = 22; public static final int NPC_SHOUT = 23; private static final String[] CHAT_NAMES = { "ALL", "SHOUT", "TELL", "PARTY", "CLAN", "GM", "PETITION_PLAYER", "PETITION_GM", "TRADE", "ALLIANCE", "ANNOUNCEMENT", // 10 "BOAT", "L2FRIEND", "MSNCHAT", "PARTYMATCH_ROOM", "PARTYROOM_COMMANDER", "PARTYROOM_ALL", "HERO_VOICE", "CRITICAL_ANNOUNCE", "SCREEN_ANNOUNCE", "BATTLEFIELD", "MPCC_ROOM" }; private static final String[] WALKER_COMMAND_LIST = { "USESKILL", "USEITEM", "BUYITEM", "SELLITEM", "SAVEITEM", "LOADITEM", "MSG", "DELAY", "LABEL", "JMP", "CALL", "RETURN", "MOVETO", "NPCSEL", "NPCDLG", "DLGSEL", "CHARSTATUS", "POSOUTRANGE", "POSINRANGE", "GOHOME", "SAY", "EXIT", "PAUSE", "STRINDLG", "STRNOTINDLG", "CHANGEWAITTYPE", "FORCEATTACK", "ISMEMBER", "REQUESTJOINPARTY", "REQUESTOUTPARTY", "QUITPARTY", "MEMBERSTATUS", "CHARBUFFS", "ITEMCOUNT", "FOLLOWTELEPORT" }; private String _text; private int _type; private String _target; @Override protected void readImpl() { _text = readS(); _type = readD(); _target = (_type == TELL) ? readS() : null; } @Override protected void runImpl() { if (Config.DEBUG) { _log.info("Say2: Msg Type = '" + _type + "' Text = '" + _text + "'."); } L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) { return; } if ((_type < 0) || (_type >= CHAT_NAMES.length)) { _log.warning("Say2: Invalid type: " + _type + " Player : " + activeChar.getName() + " text: " + String.valueOf(_text)); activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.logout(); return; } if (_text.isEmpty()) { _log.warning(activeChar.getName() + ": sending empty text. Possible packet hack!"); activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.logout(); return; } // Even though the client can handle more characters than it's current limit allows, an overflow (critical error) happens if you pass a huge (1000+) message. // July 11, 2011 - Verified on High Five 4 official client as 105. // Allow higher limit if player shift some item (text is longer then). if (!activeChar.isGM() && (((_text.indexOf(8) >= 0) && (_text.length() > 500)) || ((_text.indexOf(8) < 0) && (_text.length() > 105)))) { activeChar.sendPacket(SystemMessageId.DONT_SPAM); return; } if (Config.L2WALKER_PROTECTION && (_type == TELL) && checkBot(_text)) { Util.handleIllegalPlayerAction(activeChar, "Client Emulator Detect: Player " + activeChar.getName() + " using l2walker.", Config.DEFAULT_PUNISH); return; } if (activeChar.isCursedWeaponEquipped() && ((_type == TRADE) || (_type == SHOUT))) { activeChar.sendPacket(SystemMessageId.SHOUT_AND_TRADE_CHAT_CANNOT_BE_USED_WHILE_POSSESSING_CURSED_WEAPON); return; } if (activeChar.isChatBanned() && (_text.charAt(0) != '.')) { if (activeChar.getEffectList().getFirstEffect(L2EffectType.CHAT_BLOCK) != null) { activeChar.sendPacket(SystemMessageId.YOU_HAVE_BEEN_REPORTED_SO_CHATTING_NOT_ALLOWED); } else { for (int chatId : Config.BAN_CHAT_CHANNELS) { if (_type == chatId) { activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); } } } return; } if (activeChar.isJailed() && Config.JAIL_DISABLE_CHAT) { if ((_type == TELL) || (_type == SHOUT) || (_type == TRADE) || (_type == HERO_VOICE)) { activeChar.sendMessage("You can not chat with players outside of the jail."); return; } } if ((_type == PETITION_PLAYER) && activeChar.isGM()) { _type = PETITION_GM; } if (Config.LOG_CHAT) { LogRecord record = new LogRecord(Level.INFO, _text); record.setLoggerName("chat"); if (_type == TELL) { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + " to " + _target + "]" }); } else { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + "]" }); } _logChat.log(record); } if (_text.indexOf(8) >= 0) { if (!parseAndPublishItem(activeChar)) { return; } } final ChatFilterReturn filter = EventDispatcher.getInstance().notifyEvent(new OnPlayerChat(activeChar, L2World.getInstance().getPlayer(_target), _text, _type), ChatFilterReturn.class); if (filter != null) { _text = filter.getFilteredText(); } // Say Filter implementation if (Config.USE_SAY_FILTER) { checkText(); } final IChatHandler handler = ChatHandler.getInstance().getHandler(_type); if (handler != null) { handler.handleChat(_type, activeChar, _target, _text); } else { _log.info("No handler registered for ChatType: " + _type + " Player: " + getClient()); } } private boolean checkBot(String text) { for (String botCommand : WALKER_COMMAND_LIST) { if (text.startsWith(botCommand)) { return true; } } return false; } private void checkText() { String filteredText = _text; for (String pattern : Config.FILTER_LIST) { filteredText = filteredText.replaceAll("(?i)" + pattern, Config.CHAT_FILTER_CHARS); } _text = filteredText; } private boolean parseAndPublishItem(L2PcInstance owner) { int pos1 = -1; while ((pos1 = _text.indexOf(8, pos1)) > -1) { int pos = _text.indexOf("ID=", pos1); if (pos == -1) { return false; } StringBuilder result = new StringBuilder(9); pos += 3; while (Character.isDigit(_text.charAt(pos))) { result.append(_text.charAt(pos++)); } int id = Integer.parseInt(result.toString()); L2Object item = L2World.getInstance().findObject(id); if (item instanceof L2ItemInstance) { if (owner.getInventory().getItemByObjectId(id) == null) { _log.info(getClient() + " trying publish item which doesnt own! ID:" + id); return false; } ((L2ItemInstance) item).publish(); } else { _log.info(getClient() + " trying publish object which is not item! Object:" + item); return false; } pos1 = _text.indexOf(8, pos) + 1; if (pos1 == 0) // missing ending tag { _log.info(getClient() + " sent invalid publish item msg! ID:" + id); return false; } } return true; } @Override public String getType() { return _C__49_SAY2; } @Override protected boolean triggersOnActionRequest() { return false; } }
  11. Who know how add teleport in pm's?
  12. Ok SweeTs, i compiled...now i have project in eclipse..how i can do that?
  13. Ok SweeTs. Thank you
  14. And in this case i don;t know if he work (he=code).
  15. Sorry tazerman2 but I do not know what to do if I did not compile the server in eclipse. It's preconfigured server..
  16. For now..i work in my server. (Fully customized) and i want to make tvt's more interesting) and i try to make something special..like. when i start tvt (or any event) when i make announcement with "Started event. Pm me for instant Teleport"
  17. I can't do alone cuz i don't know what i do. Then i need little help. (This take 5 min max with a good developer). Anyway..thanks for your answers
  18. And how i can do this?
  19. pm=autoteleport...maybe now you understand
  20. man..i mean...when if event...who pm me i want to teleport to me
  21. how is it possible when the event is, the players who give me a PM to teleport where I am? Must be edited in Ecclipse? It's a java code? and how i can find the code. Thanks
  22. [22:13:12] WARN: Cannot create item 21716 java.lang.NumberFormatException: For input string: "0x10" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at l2r.gameserver.engines.DocumentBase.attachFunc(DocumentBase.java:269) at l2r.gameserver.engines.DocumentBase.parseTemplate(DocumentBase.java:2 56) at l2r.gameserver.engines.items.DocumentItem.parseItem(DocumentItem.java :132) at l2r.gameserver.engines.items.DocumentItem.parseDocument(DocumentItem. java:83) at l2r.gameserver.engines.DocumentBase.parse(DocumentBase.java:175) at l2r.gameserver.engines.DocumentEngine.loadItems(DocumentEngine.java:1 26) at l2r.gameserver.data.xml.impl.ItemData.load(ItemData.java:128) at l2r.gameserver.data.xml.impl.ItemData.reload(ItemData.java:382) at handlers.admincommandhandlers.AdminReload.useAdminCommand(AdminReload .java:201) at l2r.gameserver.network.clientpackets.SendBypassBuildCmd.runImpl(SendB ypassBuildCmd.java:87) at l2r.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameCli entPacket.java:71) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) with your command
  23. this value must be in cloak?
  24. Hi all....first of all i want to thanks all developers for help me with good answers. I want to add stats for Cloak of Zaken. Any stats i add in game doesn't have Effect. for exemple i try to add Speed. So this is syntax <add stat="runSpd" val="150" /> Value it`s just exemple. in game i type //reloaditem (no errors in gameserver) and cloak doesn;t have effect for Speed. What is wrong? Thanks
  25. i don;t know how to do that
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..