Jump to content

Recommended Posts

Posted

I readed articles and saw that all want mmocore fixed

I decided to put my mmocore

:It's for Interlude (Used on L2J)

:L2j Server Attacker (Fixed)

 

AbstractPacket.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.ByteBuffer;


/**
* @author KenM
*
*/
public abstract class AbstractPacket<T extends MMOClient>
{
   protected ByteBuffer _buf;
   
   protected T _client;
   
   protected void setClient(T client)
   {
       _client = client;
   }
   
   public T getClient()
   {
       return _client;
   }
   
   protected void setByteBuffer(ByteBuffer buf)
   {
       _buf = buf;
   }
   
   protected ByteBuffer getByteBuffer()
   {
       return _buf;
   }
}

=====================================

IAcceptFilter.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.channels.SocketChannel;

/**
* @author KenM
*
*/
public interface IAcceptFilter
{
   public boolean accept(SocketChannel sc);
}

=====================================

IClientFactory.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

/**
* @author KenM
*
*/
public interface IClientFactory<T extends MMOClient>
{
   public T create(MMOConnection<T> con);
}

=====================================

IMMOExecutor.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;


/**
* @author KenM
*
*/
public interface IMMOExecutor<T extends MMOClient>
{
   public void execute(ReceivablePacket<T> packet);
}

=====================================

IPacketHandler.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.ByteBuffer;


/**
* @author KenM
*
*/
public interface IPacketHandler<T extends MMOClient>
{
   public ReceivablePacket<T> handlePacket(ByteBuffer buf, T client);
}

=====================================

MMOClient.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.ByteBuffer;

/**
* @author KenM
*
*/
public abstract class MMOClient<T extends MMOConnection>
{
   private T _connection;
   
   @SuppressWarnings("unchecked")
   public MMOClient(T con)
   {
       this.setConnection(con);
       con.setClient(this);
   }
   
   protected void setConnection(T con)
   {
       _connection = con;
   }
   
   public T getConnection()
   {
       return _connection;
   }
   
   public void closeNow()
   {
       this.getConnection().closeNow();
   }
   
   public void closeLater()
   {
       this.getConnection().closeLater();
   }
   
   public abstract boolean decrypt(ByteBuffer buf, int size);
   
   public abstract boolean encrypt(ByteBuffer buf, int size);
   
   protected void onDisconection()
   {
   }
   
   protected void onForcedDisconnection()
   {
   }
}

=====================================

MMOConnection.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.ByteBuffer;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;


import javolution.util.FastList;

/**
* @author KenM
*
*/
public class MMOConnection<T extends MMOClient>
{
   private final SelectorThread<T> _selectorThread;
   private T _client;
   
   private SocketChannel _socketChannel;
   private FastList<SendablePacket<T>> _sendQueue = new FastList<SendablePacket<T>>();
   private SelectionKey _selectionKey;
   
   private ByteBuffer _readBuffer;
   private ByteBuffer _writeBuffer;
   
   private boolean _pendingClose;
   
   public MMOConnection(SelectorThread<T> selectorThread, SocketChannel sc, SelectionKey key)
   {
       _selectorThread = selectorThread;
       this.setSocketChannel(sc);
       this.setSelectionKey(key);
   }
   
   protected void setClient(T client)
   {
       _client = client;
   }
   
   protected T getClient()
   {
       return _client;
   }
   
   public void sendPacket(SendablePacket<T> sp)
   {
       sp.setClient(this.getClient());
       synchronized (this.getSendQueue())
       {
           if (!_pendingClose)
           {
               try
               {
                   this.getSelectionKey().interestOps(this.getSelectionKey().interestOps() | SelectionKey.OP_WRITE);
                   this.getSendQueue().addLast(sp);
               }
               catch (CancelledKeyException e)
               {
                   // ignore
               }
           }
       }
   }
   
   protected SelectorThread<T> getSelectorThread()
   {
       return _selectorThread;
   }
   
   protected void setSelectionKey(SelectionKey key)
   {
       _selectionKey = key;
   }
   
   protected SelectionKey getSelectionKey()
   {
       return _selectionKey;
   }
   
   protected void enableReadInterest()
   {
       try
       {
           this.getSelectionKey().interestOps(this.getSelectionKey().interestOps() | SelectionKey.OP_READ);
       }
       catch (CancelledKeyException e)
       {
           // ignore
       }
   }
   
   protected void disableReadInterest()
   {
       try
       {
           this.getSelectionKey().interestOps(this.getSelectionKey().interestOps() & ~SelectionKey.OP_READ);
       }
       catch (CancelledKeyException e)
       {
           // ignore
       }
   }
   
   protected void enableWriteInterest()
   {
       try
       {
           this.getSelectionKey().interestOps(this.getSelectionKey().interestOps() | SelectionKey.OP_WRITE);
       }
       catch (CancelledKeyException e)
       {
           // ignore
       }
   }
   
   protected void disableWriteInterest()
   {
       try
       {
           this.getSelectionKey().interestOps(this.getSelectionKey().interestOps() & ~SelectionKey.OP_WRITE);
       }
       catch (CancelledKeyException e)
       {
           // ignore
       }
   }
   
   protected void setSocketChannel(SocketChannel sc)
   {
       _socketChannel = sc;
   }
   
   public SocketChannel getSocketChannel()
   {
       return _socketChannel;
   }
   
   protected FastList<SendablePacket<T>> getSendQueue()
   {
       return _sendQueue;
   }
   
   protected void setWriteBuffer(ByteBuffer buf)
   {
       _writeBuffer = buf;
   }
   
   protected ByteBuffer getWriteBuffer()
   {
       return _writeBuffer;
   }
   
   protected void setReadBuffer(ByteBuffer buf)
   {
       _readBuffer = buf;
   }
   
   protected ByteBuffer getReadBuffer()
   {
       return _readBuffer;
   }
   
   public boolean isClosed()
   {
       return _pendingClose;
   }
   
   protected void closeNow()
   {
       synchronized (this.getSendQueue())
       {
           _pendingClose = true;
           this.getSendQueue().clear();
           this.disableWriteInterest();
       }
       this.getSelectorThread().closeConnection(this);
   }
   
   public void close(SendablePacket<T> sp)
   {
       synchronized (this.getSendQueue())
       {
           this.getSendQueue().clear();
           this.sendPacket(sp);
           _pendingClose = true;
       }
       this.getSelectorThread().closeConnection(this);
   }
   
   protected void closeLater()
   {
       synchronized (this.getSendQueue())
       {
           _pendingClose = true;
       }
       this.getSelectorThread().closeConnection(this);
   }
   
   protected void onDisconection()
   {
       this.getClient().onDisconection();
   }
   
   protected void onForcedDisconnection()
   {
       this.getClient().onForcedDisconnection();
   }
}

=====================================

ReceivablePacket.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;


import javolution.text.TextBuilder;

/**
* @author KenM
*
*/
public abstract class ReceivablePacket<T extends MMOClient> extends AbstractPacket<T> implements Runnable
{
   protected ReceivablePacket()
   {
       
   }
   
   protected int getAvaliableBytes()
   {
       return this.getByteBuffer().remaining();
   }
   
   protected abstract boolean read();
   
   public abstract void run();
   
   protected void readB(byte[] dst)
   {
       this.getByteBuffer().get(dst);
   }
   
   protected void readB(byte[] dst, int offset, int len)
   {
       this.getByteBuffer().get(dst, offset, len);
   }
   
   protected int readC()
   {
       return this.getByteBuffer().get() & 0xFF;
   }
   
   protected int readH()
   {
       return this.getByteBuffer().getShort() & 0xFFFF;
   }
   
   protected int readD()
   {
       return this.getByteBuffer().getInt();
   }
   
   protected long readQ()
   {
       return this.getByteBuffer().getLong();
   }
   
   protected double readF()
   {
       return this.getByteBuffer().getDouble();
   }
   
   protected String readS()
   {
       TextBuilder tb = TextBuilder.newInstance();
       char ch;
       while((ch = getByteBuffer().getChar()) != 0) 
           tb.append(ch);
       String str = tb.stringValue();
       TextBuilder.recycle(tb);
       return str;
   }
}

=====================================

SelectorConfig.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.nio.ByteOrder;

/**
* @author KenM
*
*/
public class SelectorConfig
{
   
   private int READ_BUFFER_SIZE = 64*1024;
   private int WRITE_BUFFER_SIZE = 64*1024;
   private HeaderSize HEADER_TYPE = HeaderSize.SHORT_HEADER;
   private int HELPER_BUFFER_SIZE = 64*1024;
   private int HELPER_BUFFER_COUNT = 20;
   private ByteOrder BYTE_ORDER = ByteOrder.LITTLE_ENDIAN;
   
   /**
    * BYTE_HEADER: unsigned byte, max size: 255 <BR>
    * SHORT_HEADER: unsigned short, max size: 65535<BR>
    * INT_HEADER: signed integer, max size: Integer.MAX_SIZE<BR>
    * @author KenM
    */
   public static enum HeaderSize
   { 
       BYTE_HEADER,
       SHORT_HEADER,
       INT_HEADER,
   }
   
   public SelectorConfig()
   {
   }
   
   public int getReadBufferSize()
   {
       return READ_BUFFER_SIZE;
   }
   
   public int getWriteBufferSize()
   {
       return READ_BUFFER_SIZE;
   }
   
   public int getHelperBufferSize()
   {
       return HELPER_BUFFER_SIZE;
   }
   
   public int getHelperBufferCount()
   {
       return HELPER_BUFFER_COUNT;
   }
   
   public ByteOrder getByteOrder()
   {
       return BYTE_ORDER;
   }
   
   public HeaderSize getHeaderType()
   {
       return HEADER_TYPE;
   }
}

=====================================

SelectorServerConfig.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;

import java.net.InetAddress;

/**
* @author KenM
*
*/
public class SelectorServerConfig extends SelectorConfig
{
   private final int SERVER_PORT;
   private final InetAddress SERVER_ADDRESS;
   
   public SelectorServerConfig(int port)
   {
       this(null, port);
   }
   
   public SelectorServerConfig(InetAddress address, int port)
   {
       SERVER_PORT = port;
       SERVER_ADDRESS = address;
   }
   
   public int getPort()
   {
       return SERVER_PORT;
   }
   
   public InetAddress getAddress()
   {
       return SERVER_ADDRESS;
   }
}

=====================================

SelectorThread.java

http://www.4shared.com/file/183645656/a50d2d56/SelectorThread.html

=====================================

SendablePacket.java

/* This program 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 2, or (at your option)
* any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jserver.mmocore.network;


import com.l2jserver.mmocore.network.SelectorConfig.HeaderSize;

/**
* @author KenM
*
*/
public abstract class SendablePacket<T extends MMOClient> extends AbstractPacket<T>
{
   protected void writeC(int data)
   {
       this.getByteBuffer().put((byte) data);
   }
   
   protected void writeF(double value)
   {
       this.getByteBuffer().putDouble(value);
   }
   
   protected void writeH(int value)
   {
       this.getByteBuffer().putShort((short) value);
   }
   
   protected void writeD(int value)
   {
       this.getByteBuffer().putInt(value);
   }
   
   protected void writeQ(long value)
   {
       this.getByteBuffer().putLong(value);
   }
   
   protected void writeB(byte[] data)
   {
       this.getByteBuffer().put(data);
   }
   
   protected void writeS(CharSequence charSequence)
   {
       if (charSequence == null)
       {
           charSequence = "";
       }
       
       int length = charSequence.length();
       for (int i = 0; i < length; i++)
       {
           this.getByteBuffer().putChar(charSequence.charAt(i));
       }
       this.getByteBuffer().putChar('\000');
   }
   
   protected abstract void write();
   
   protected void writeHeader(HeaderSize ht, int pos)
   {
       switch (ht)
       {
           case BYTE_HEADER:
               this.getByteBuffer().put(pos, (byte) this.getByteBuffer().position());
               break;
           case SHORT_HEADER:
               this.getByteBuffer().putShort(pos, (short) this.getByteBuffer().position());
               break;
           case INT_HEADER:
               this.getByteBuffer().putInt(pos, this.getByteBuffer().position());
               break;
       }
   }
}

Posted

jeeez "learn to add a share" thats like argh...as i see you dont have a clue about diff file...

 

and btw we dont give  +1 karma for c/p karma restored.

Posted

He made some modifications to avoid, L2JAttack. You idiot.

 

you idiot the fix is posted in l2j forum its just delete the result 0 content.

Posted

+1 Karma from me for all  of his shares that they rocking!!!

Also about Interpid why you dont share somthing and you only know to dekarma and collecting posts??

STFU NooB Interpid Is L2JMod

Try To Give +1 And I Will Dekarma You

Posted

+1 Karma from me for all  of his shares that they rocking!!!

Also about Interpid why you dont share somthing and you only know to dekarma and collecting posts??

 

1st still i have the most shares in this section with 16 java share(own shares not c/p like you biatchs do)

2nd im mod i need to show activity and yes with that comes i need to post too.

 

PS.:i have over 900 post in the dev help section so shut your little mouth you can talk like that when you did what i did bb

Guest
This topic is now closed to further replies.


  • Posts

    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...