Jump to content
  • 0

Help to fix exploit


DnR

Question

7 answers to this question

Recommended Posts

  • 0

auto einai gia interlude xriazete na to kaneis compile

credits:theonegandalf

 

Index: /trunk/L2JHardCode_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
===================================================================
--- /trunk/L2JHardCode_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 72)
+++ /trunk/L2JHardCode_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 158)
@@ -23,4 +23,5 @@
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
+import java.util.concurrent.locks.ReentrantLock;

import net.sf.l2j.Config;
@@ -91,21 +92,5 @@
	protected void runImpl()
	{
-        if (CharNameTable.getInstance().accountCharNumber(getClient().getAccountName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
-        {
-            if (Config.DEBUG)
-                _log.fine("Max number of characters reached. Creation failed.");
-            CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS);
-            sendPacket(ccf);
-            return;
-        }
-        else if (CharNameTable.getInstance().doesCharNameExist(_name))
-		{
-			if (Config.DEBUG)
-				_log.fine("charname: "+ _name + " already exists. creation failed.");
-			CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_NAME_ALREADY_EXISTS);
-			sendPacket(ccf);
-			return;
-		}
-		else if ((_name.length() < 3) || (_name.length() > 16) || !Util.isAlphaNumeric(_name) || !isValidName(_name))
+        if ((_name.length() < 3) || (_name.length() > 16) || !Util.isAlphaNumeric(_name) || !isValidName(_name))
		{
			if (Config.DEBUG)
@@ -116,18 +101,47 @@
		}

-		if (Config.DEBUG)
-			_log.fine("charname: " + _name + " classId: " + _classId);
-
-		L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(_classId);
-		if(template == null || template.classBaseLevel > 1)
-		{
-			CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
-			sendPacket(ccf);
-			return;
-		}
-
-		int objectId = IdFactory.getInstance().getNextId();
-		L2PcInstance newChar = L2PcInstance.create(objectId, template, getClient().getAccountName(),
-				_name, _hairStyle, _hairColor, _face, _sex!=0);
+        L2PcInstance newChar = null;
+		L2PcTemplate template = null;
+		
+		/*
+		* Since checks for duplicate names are done using SQL,
+		* lock must be held until data is written to DB as well.
+		*/
+		synchronized (CharNameTable.getInstance())
+		{
+        if (CharNameTable.getInstance().accountCharNumber(getClient().getAccountName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT
+			        && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
+			{
+				if (Config.DEBUG)
+					_log.fine("Max number of characters reached. Creation failed.");
+				CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS);
+				sendPacket(ccf);
+				return;
+			}
+			else if (CharNameTable.getInstance().doesCharNameExist(_name))
+			{
+				if (Config.DEBUG)
+					_log.fine("charname: " + _name + " already exists. creation failed.");
+				CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_NAME_ALREADY_EXISTS);
+				sendPacket(ccf);
+				return;
+			}
+			
+			template = CharTemplateTable.getInstance().getTemplate(_classId);
+			
+			if (Config.DEBUG)
+				_log.fine("charname: " + _name + " classId: " + _classId + " template: " + template);
+			
+			if (template == null || template.classBaseLevel > 1)
+			{
+				CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
+				sendPacket(ccf);
+				return;
+			}
+			
+			int objectId = IdFactory.getInstance().getNextId();
+			newChar = L2PcInstance.create(objectId, template, getClient().getAccountName(), _name, _hairStyle, _hairColor, _face, _sex != 0);
+		}
+		
		newChar.setCurrentHp(template.baseHpMax);
		newChar.setCurrentCp(template.baseCpMax);

Link to comment
Share on other sites

  • 0

Tote logika de me boi8aei. :S

 

An exeis compiled pack , fisika kai se boithaei.

 

An exeis preconfigured , ontos den mporeis na kaneis tpt.

Link to comment
Share on other sites

  • 0

An exeis compiled pack , fisika kai se boithaei.

 

An exeis preconfigured , ontos den mporeis na kaneis tpt.

Compiled exw alla sikwsa ton server prin liges wres kai den kserw polla.

Mporeis na m peis pou 8a to kanw paste?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Best Psychic ☎️ +1 (862) 626–6441 love spells in Nashville, TN *To Get Back Ex Lover* Black magic cleansing.   Love spells in Nashville, TN, if you want to reunite with your ex, this spell is for you. This spell is best for people who break up with someone and realize they wish they hadn't, and it won't force the other person to get back into the relationship. Instead, it removes the negative energy.   Expert love spells to renew your relationship &; make your relationship stronger. love spells to bring back the feelings of love for ex-lovers. Increase the intimacy, affection &; love between you and your lover using voodoo relationship love spells in the USA. Black Magic Spells Removal Money spells, easy love spells with just words, think of me spell, powerful love spell, spells of love, spells that work, love potion to attract a man, easy love spells with just words, pink candle prayer, white magic spells, call me spell, manifestation spell, gay love spells, commitment spells, business spells and, how to bring back lost love in a relationship, Witchcraft love spells that work immediately to increase love &; intimacy in your relationship. Attraction love spells to attract someone, stop a divorce, prevent a breakup & get your ex back.   Get back your ex-lover If your lover is gone, don't be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will bring our spiritual powers to bring him/her back. Get back your ex-lover This service has been the reason for so many happy endings that you should consider it as a serious solution. Let us show you our method with zero chances of rejection. Don't waste your precious time; get your lover back NOW!   When you work with an expert, this spell works toward dissipating the negative energies that were kicked up between you and your ex so that reconciliation becomes a possibility. When you break up with someone, especially if things end badly, it's like having a thick fog between the two of you that prevents you from seeing the truth of each other. Anger, hurt, and resentment linger in the air and it's difficult to remember the reasons you fell in love in the first place.   ☎️ +1(862) 626-6441   With this spell, you can restore your broken relationship. The fog will clear, and the sun will shine on both your hearts, warming you up and preparing you for a reunion.   MAKE HIM/HER LOVE ME.   You love someone but this isn't mutual? Don't wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you combine this service with a marriage ritual if you want this person to commit to you.
    • I use l2fandc files. I need a java code, I've been searching a lot and waiting for help. What I want to do is to teleport to the players doing pvp. So it's like finding the flag player. I found some files but they did not fit my system. I'm waiting for help..   EXAMPLE:     package handlers.bypasshandlers; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import com.l2jmobius.Config; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; /**  * @author Mobius (based on Tenkai pvpzone)  */ public class FindPvP implements IBypassHandler {     private static final String[] COMMANDS =     {         "FindPvP"     };          @Override     public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)     {         if (!Config.ENABLE_FIND_PVP || !target.isNpc())         {             return false;         }                  L2PcInstance mostPvP = null;         int max = -1;         for (L2PcInstance player : L2World.getInstance().getPlayers())         {             if ((player == null) //                 || (player.getPvpFlag() == 0) //                 || (player.getInstanceId() != 0) //                 || player.isGM() //                 || player.isInsideZone(ZoneId.PEACE) //                 || player.isInsideZone(ZoneId.SIEGE) //                 || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND))             {                 continue;             }                          int count = 0;             for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class))             {                 if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE))                 {                     count++;                 }             }                          if (count > max)             {                 max = count;                 mostPvP = player;             }         }                  if (mostPvP != null)         {             // Check if the player's clan is already outnumbering the PvP             if (activeChar.getClan() != null)             {                 Map<Integer, Integer> clanNumbers = new HashMap<>();                 int allyId = activeChar.getAllyId();                 if (allyId == 0)                 {                     allyId = activeChar.getClanId();                 }                 clanNumbers.put(allyId, 1);                 for (L2PcInstance known : L2World.getInstance().getVisibleObjects(mostPvP, L2PcInstance.class))                 {                     int knownAllyId = known.getAllyId();                     if (knownAllyId == 0)                     {                         knownAllyId = known.getClanId();                     }                     if (knownAllyId != 0)                     {                         if (clanNumbers.containsKey(knownAllyId))                         {                             clanNumbers.put(knownAllyId, clanNumbers.get(knownAllyId) + 1);                         }                         else                         {                             clanNumbers.put(knownAllyId, 1);                         }                     }                 }                                  int biggestAllyId = 0;                 int biggestAmount = 2;                 for (Entry<Integer, Integer> clanNumber : clanNumbers.entrySet())                 {                     if (clanNumber.getValue() > biggestAmount)                     {                         biggestAllyId = clanNumber.getKey();                         biggestAmount = clanNumber.getValue();                     }                 }                                  if (biggestAllyId == allyId)                 {                     activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there."));                     return true;                 }             }                          activeChar.teleToLocation((mostPvP.getX() + Rnd.get(300)) - 150, (mostPvP.getY() + Rnd.get(300)) - 150, mostPvP.getZ());             activeChar.setSpawnProtection(true);             if (!activeChar.isGM())             {                 activeChar.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);                 activeChar.startPvPFlag();             }         }         else         {             activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now."));         }         return false;     }          @Override     public String[] getBypassList()     {         return COMMANDS;     } }
  • Topics

×
×
  • Create New...