Page 1 of 2
l2j problem
Posted: Tue Aug 28, 2012 2:04 am
by NewbieNeverDie
Hello guys , first of all i want to tell you that i am not new and i am not searching for a fast answer.. my old account name is ThePwned <- but i lost my acc infos..anyway
i have one problem with l2j gameserver (instances. L2PCinstance) when every player log in game lose all skills active and passive..
this is the file (i just added a part of the problem)
Code: Select all
// Remove a skill from the L2Character and its Func objects from calculator set of the L2Character final L2Skill oldSkill = super.removeSkill(skill); if (oldSkill != null) { Connection con = null; try { // Remove or update a L2PcInstance skill from the character_skills table of the database con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement(DELETE_SKILL_FROM_CHAR); statement.setInt(1, oldSkill.getId()); statement.setInt(2, getObjectId()); statement.setInt(3, getClassIndex()); statement.execute(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "Error could not delete skill: " + e.getMessage(), e); } finally { L2DatabaseFactory.close(con); } } if (transformId() > 0 || isCursedWeaponEquipped()) return oldSkill; final L2ShortCut[] allShortCuts = getAllShortCuts(); for (L2ShortCut sc : allShortCuts) { if ((sc != null) && (skill != null) && (sc.getId() == skill.getId()) && (sc.getType() == L2ShortCut.TYPE_SKILL) && !(skill.getId() >= 3080 && skill.getId() <= 3259)) // FIXME: Rough fix for shortcuts of augments getting removed. Find a better way deleteShortCut(sc.getSlot(), sc.getPage()); } return oldSkill; }
Here my gameserver errors when i log i n/ ingame problem:
1)
2)
i hope i gave all the infos to have a respone.. if i am not right reply me what other to upload ... any answer is weclome.
Re: l2j problem
Posted: Thu Aug 30, 2012 11:26 am
by NewbieNeverDie
dafaq no one know?? :S
Re: l2j problem
Posted: Fri Aug 31, 2012 10:09 am
by DreamStage
check ur EnterWorld.java file
Re: l2j problem
Posted: Sat Sep 01, 2012 10:53 am
by NewbieNeverDie
DreamStage wrote:check ur EnterWorld.java file
i will check it but where can i find this file (in wich folder?) Also what kind of problem can be there?
Re: l2j problem
Posted: Sat Sep 01, 2012 11:13 am
by DreamStage
@ java\com\l2jserver\gameserver\network\clientpackets
You need to check if when player enter / logs at ur server, some code removes their skills.
Look for some code that removes your skills.
Re: l2j problem
Posted: Sat Sep 01, 2012 11:44 am
by NewbieNeverDie
DreamStage wrote:@ java\com\l2jserver\gameserver\network\clientpackets
You need to check if when player enter / logs at ur server, some code removes their skills.
Look for some code that removes your skills.
Code: Select all
/* * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */package com.l2jserver.gameserver.network.clientpackets; import java.io.UnsupportedEncodingException;import java.util.logging.Logger; import com.l2jserver.Config;import com.l2jserver.gameserver.Announcements;import com.l2jserver.gameserver.GmListTable;import com.l2jserver.gameserver.LoginServerThread;import com.l2jserver.gameserver.SevenSigns;import com.l2jserver.gameserver.TaskPriority;import com.l2jserver.gameserver.cache.HtmCache;import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager;import com.l2jserver.gameserver.datatables.AdminCommandAccessRights;import com.l2jserver.gameserver.datatables.GMSkillTable;import com.l2jserver.gameserver.datatables.SkillTable;import com.l2jserver.gameserver.instancemanager.CHSiegeManager;import com.l2jserver.gameserver.instancemanager.CastleManager;import com.l2jserver.gameserver.instancemanager.ClanHallManager;import com.l2jserver.gameserver.instancemanager.CoupleManager;import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;import com.l2jserver.gameserver.instancemanager.DimensionalRiftManager;import com.l2jserver.gameserver.instancemanager.FortManager;import com.l2jserver.gameserver.instancemanager.FortSiegeManager;import com.l2jserver.gameserver.instancemanager.InstanceManager;import com.l2jserver.gameserver.instancemanager.MailManager;import com.l2jserver.gameserver.instancemanager.MapRegionManager;import com.l2jserver.gameserver.instancemanager.PetitionManager;import com.l2jserver.gameserver.instancemanager.QuestManager;import com.l2jserver.gameserver.instancemanager.SiegeManager;import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;import com.l2jserver.gameserver.model.L2Clan;import com.l2jserver.gameserver.model.L2Object;import com.l2jserver.gameserver.model.L2World;import com.l2jserver.gameserver.model.actor.L2Character;import com.l2jserver.gameserver.model.actor.instance.L2ClassMasterInstance;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.model.entity.CTF;import com.l2jserver.gameserver.model.entity.Couple;import com.l2jserver.gameserver.model.entity.Fort;import com.l2jserver.gameserver.model.entity.FortSiege;import com.l2jserver.gameserver.model.entity.L2Event;import com.l2jserver.gameserver.model.entity.Siege;import com.l2jserver.gameserver.model.entity.TvTEvent;import com.l2jserver.gameserver.model.entity.clanhall.AuctionableHall;import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;import com.l2jserver.gameserver.model.item.instance.L2ItemInstance;import com.l2jserver.gameserver.model.quest.Quest;import com.l2jserver.gameserver.model.quest.QuestState;import com.l2jserver.gameserver.network.SystemMessageId;import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;import com.l2jserver.gameserver.network.serverpackets.Die;import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;import com.l2jserver.gameserver.network.serverpackets.ExBasicActionList;import com.l2jserver.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;import com.l2jserver.gameserver.network.serverpackets.ExNevitAdventPointInfoPacket;import com.l2jserver.gameserver.network.serverpackets.ExNevitAdventTimeChange;import com.l2jserver.gameserver.network.serverpackets.ExNoticePostArrived;import com.l2jserver.gameserver.network.serverpackets.ExNotifyPremiumItem;import com.l2jserver.gameserver.network.serverpackets.ExShowContactList;import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo;import com.l2jserver.gameserver.network.serverpackets.FriendList;import com.l2jserver.gameserver.network.serverpackets.HennaInfo;import com.l2jserver.gameserver.network.serverpackets.ItemList;import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll;import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListUpdate;import com.l2jserver.gameserver.network.serverpackets.PledgeSkillList;import com.l2jserver.gameserver.network.serverpackets.PledgeStatusChanged;import com.l2jserver.gameserver.network.serverpackets.QuestList;import com.l2jserver.gameserver.network.serverpackets.ShortCutInit;import com.l2jserver.gameserver.network.serverpackets.SkillCoolTime;import com.l2jserver.gameserver.network.serverpackets.SystemMessage;import com.l2jserver.gameserver.network.serverpackets.CreatureSay;import com.l2jserver.gameserver.util.Broadcast;import com.l2jserver.util.Base64; /** * Enter World Packet Handler<p> * <p> * 0000: 03 <p> * packet format rev87 bddddbdcccccccccccccccccccc * <p> */public class EnterWorld extends L2GameClientPacket{ private static final String _C__11_ENTERWORLD = "[C] 11 EnterWorld"; private static Logger _log = Logger.getLogger(EnterWorld.class.getName()); private final int[][] tracert = new int[5][4]; public TaskPriority getPriority() { return TaskPriority.PR_URGENT; } @Override protected void readImpl() { readB(new byte[32]); // Unknown Byte Array readD(); // Unknown Value readD(); // Unknown Value readD(); // Unknown Value readD(); // Unknown Value readB(new byte[32]); // Unknown Byte Array readD(); // Unknown Value for (int i = 0; i < 5; i++) for (int o = 0; o < 4; o++) tracert[i][o] = readC(); } @Override protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) { _log.warning("EnterWorld failed! activeChar returned 'null'."); getClient().closeNow(); return; } String[] adress = new String[5]; for (int i = 0; i < 5; i++) adress[i] = tracert[i][0]+"."+tracert[i][1]+"."+tracert[i][2]+"."+tracert[i][3]; LoginServerThread.getInstance().sendClientTracert(activeChar.getAccountName(), adress); getClient().setClientTracert(tracert); // Restore to instanced area if enabled if (Config.RESTORE_PLAYER_INSTANCE) activeChar.setInstanceId(InstanceManager.getInstance().getPlayerInstance(activeChar.getObjectId())); else { int instanceId = InstanceManager.getInstance().getPlayerInstance(activeChar.getObjectId()); if (instanceId > 0) InstanceManager.getInstance().getInstance(instanceId).removePlayer(activeChar.getObjectId()); } if (L2World.getInstance().findObject(activeChar.getObjectId()) != null) { if (Config.DEBUG) _log.warning("User already exists in Object ID map! User "+activeChar.getName()+" is a character clone."); } // Apply special GM properties to the GM when entering if (activeChar.isGM()) { if (Config.GM_STARTUP_INVULNERABLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel())) activeChar.setIsInvul(true); if (Config.GM_STARTUP_INVISIBLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invisible", activeChar.getAccessLevel())) activeChar.getAppearance().setInvisible(); if (Config.GM_STARTUP_SILENCE && AdminCommandAccessRights.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel())) activeChar.setSilenceMode(true); if (Config.GM_STARTUP_DIET_MODE && AdminCommandAccessRights.getInstance().hasAccess("admin_diet", activeChar.getAccessLevel())) { activeChar.setDietMode(true); activeChar.refreshOverloaded(); } if (Config.GM_STARTUP_AUTO_LIST && AdminCommandAccessRights.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel())) GmListTable.getInstance().addGm(activeChar, false); else GmListTable.getInstance().addGm(activeChar, true); if (Config.GM_GIVE_SPECIAL_SKILLS) GMSkillTable.getInstance().addSkills(activeChar, false); if (Config.GM_GIVE_SPECIAL_AURA_SKILLS) GMSkillTable.getInstance().addSkills(activeChar, true); } // Set dead status if applies if (activeChar.getCurrentHp() < 0.5) activeChar.setIsDead(true); boolean showClanNotice = false; // Clan related checks are here if (activeChar.getClan() != null) { activeChar.sendPacket(new PledgeSkillList(activeChar.getClan())); notifyClanMembers(activeChar); notifySponsorOrApprentice(activeChar); AuctionableHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan()); if (activeChar.getClan().getLeaderName().equals(activeChar.getName()) && activeChar.getClan().getHasCastle() > 0 && Config.ANNOUNCE_CASTLE_LORD && !activeChar.isGM()) { String castlename = ""; switch (activeChar.getClan().getHasCastle()) { case 1: castlename = "Gludio"; break; case 2: castlename = "Dion"; break; case 3: castlename = "Giran"; break; case 4: castlename = "Oren"; break; case 5: castlename = "Aden"; break; case 6: castlename = "Innadril"; break; case 7: castlename = "Goddard"; break; case 8: castlename = "Rune"; break; case 9: castlename = "Schuttgart"; break; } Broadcast.toAllOnlinePlayers(new CreatureSay(1, Say2.CRITICAL_ANNOUNCE, "", "Clan Manager: " + activeChar.getName() + " the lord of " + castlename + " castle has logged into the game.")); } if (clanHall != null) { if (!clanHall.getPaid()) activeChar.sendPacket(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW); } for (Siege siege : SiegeManager.getInstance().getSieges()) { if (!siege.getIsInProgress()) continue; if (siege.checkIsAttacker(activeChar.getClan())) { activeChar.setSiegeState((byte)1); activeChar.setSiegeSide(siege.getCastle().getCastleId()); } else if (siege.checkIsDefender(activeChar.getClan())) { activeChar.setSiegeState((byte)2); activeChar.setSiegeSide(siege.getCastle().getCastleId()); } } for (FortSiege siege : FortSiegeManager.getInstance().getSieges()) { if (!siege.getIsInProgress()) continue; if (siege.checkIsAttacker(activeChar.getClan())) { activeChar.setSiegeState((byte)1); activeChar.setSiegeSide(siege.getFort().getFortId()); } else if (siege.checkIsDefender(activeChar.getClan())) { activeChar.setSiegeState((byte)2); activeChar.setSiegeSide(siege.getFort().getFortId()); } } for(SiegableHall hall : CHSiegeManager.getInstance().getConquerableHalls().values()) { if(!hall.isInSiege()) continue; if(hall.isRegistered(activeChar.getClan())) { activeChar.setSiegeState((byte)1); activeChar.setSiegeSide(hall.getId()); activeChar.setIsInHideoutSiege(true); } } sendPacket(new PledgeShowMemberListAll(activeChar.getClan(), activeChar)); sendPacket(new PledgeStatusChanged(activeChar.getClan())); // Residential skills support if (activeChar.getClan().getHasCastle() > 0) CastleManager.getInstance().getCastleByOwner(activeChar.getClan()).giveResidentialSkills(activeChar); if (activeChar.getClan().getHasFort() > 0) FortManager.getInstance().getFortByOwner(activeChar.getClan()).giveResidentialSkills(activeChar); showClanNotice = activeChar.getClan().isNoticeEnabled(); } if (TerritoryWarManager.getInstance().getRegisteredTerritoryId(activeChar) > 0) { if (TerritoryWarManager.getInstance().isTWInProgress()) activeChar.setSiegeState((byte)1); activeChar.setSiegeSide(TerritoryWarManager.getInstance().getRegisteredTerritoryId(activeChar)); } // Updating Seal of Strife Buff/Debuff if (SevenSigns.getInstance().isSealValidationPeriod() && SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) != SevenSigns.CABAL_NULL) { int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId()); if (cabal != SevenSigns.CABAL_NULL) { if (cabal == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE)) activeChar.addSkill(SkillTable.FrequentSkill.THE_VICTOR_OF_WAR.getSkill()); else activeChar.addSkill(SkillTable.FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill()); } } else { activeChar.removeSkill(SkillTable.FrequentSkill.THE_VICTOR_OF_WAR.getSkill()); activeChar.removeSkill(SkillTable.FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill()); } if (Config.ENABLE_VITALITY && Config.RECOVER_VITALITY_ON_RECONNECT) { float points = Config.RATE_RECOVERY_ON_RECONNECT * (System.currentTimeMillis() - activeChar.getLastAccess()) / 60000; if (points > 0) activeChar.updateVitalityPoints(points, false, true); } if (activeChar.getPvpKills() >= (Config.PVP_AMOUNT1) && (Config.PVP_COLOR_SYSTEM_ENABLED)) updatePvPColor(activeChar.getPvpKills(), activeChar); if (activeChar.getPkKills() >= (Config.PK_AMOUNT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) updatePkColor(activeChar.getPkKills(), activeChar); activeChar.checkRecoBonusTask(); activeChar.broadcastUserInfo(); // Send Macro List activeChar.getMacros().sendUpdate(); // Send Item List sendPacket(new ItemList(activeChar, false)); // Send GG check activeChar.queryGameGuard(); // Send Teleport Bookmark List sendPacket(new ExGetBookMarkInfoPacket(activeChar)); // Send Shortcuts sendPacket(new ShortCutInit(activeChar)); // Send Action list activeChar.sendPacket(ExBasicActionList.getStaticPacket(activeChar)); // Send Skill list activeChar.sendSkillList(); // Send Dye Information activeChar.sendPacket(new HennaInfo(activeChar)); Quest.playerEnter(activeChar); if (!Config.DISABLE_TUTORIAL) loadTutorial(activeChar); for (Quest quest : QuestManager.getInstance().getAllManagedScripts()) { if (quest != null && quest.getOnEnterWorld()) quest.notifyEnterWorld(activeChar); } activeChar.sendPacket(new QuestList()); if (Config.PLAYER_SPAWN_PROTECTION > 0) activeChar.setProtection(true); activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ()); activeChar.getInventory().applyItemSkills(); if (L2Event.isParticipant(activeChar)) L2Event.restorePlayerEventStatus(activeChar); // Wedding Checks if (Config.L2JMOD_ALLOW_WEDDING) { engage(activeChar); notifyPartner(activeChar,activeChar.getPartnerId()); } if (activeChar.isCursedWeaponEquipped()) { CursedWeaponsManager.getInstance().getCursedWeapon(activeChar.getCursedWeaponEquippedId()).cursedOnLogin(); } activeChar.updateEffectIcons(); activeChar.sendPacket(new EtcStatusUpdate(activeChar)); //Expand Skill activeChar.sendPacket(new ExStorageMaxCount(activeChar)); sendPacket(new FriendList(activeChar)); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.FRIEND_S1_HAS_LOGGED_IN); sm.addString(activeChar.getName()); for (int id : activeChar.getFriendList()) { L2Object obj = L2World.getInstance().findObject(id); if (obj != null) obj.sendPacket(sm); } activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE); activeChar.sendMessage(getText("V2VsY29tZSB0byBSMSBTeXN0ZW1zLg==\n")); activeChar.sendMessage(getText("Q3JlZGl0czogTDJKU2VydmVyICYgaW5zYW5leEQu\n")); SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar); Announcements.getInstance().showAnnouncements(activeChar); if (showClanNotice) { NpcHtmlMessage notice = new NpcHtmlMessage(1); notice.setFile(activeChar.getHtmlPrefix(), "data/html/clanNotice.htm"); notice.replace("%clan_name%", activeChar.getClan().getName()); notice.replace("%notice_text%", activeChar.getClan().getNotice().replaceAll("\r\n", "<br>")); notice.disableValidation(); sendPacket(notice); } else if (Config.SERVER_NEWS) { String serverNews = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/servnews.htm"); if (serverNews != null) sendPacket(new NpcHtmlMessage(1, serverNews)); } if (Config.PETITIONING_ALLOWED) PetitionManager.getInstance().checkPetitionMessages(activeChar); if (activeChar.isAlikeDead()) // dead or fake dead { // no broadcast needed since the player will already spawn dead to others sendPacket(new Die(activeChar)); } activeChar.onPlayerEnter(); sendPacket(new SkillCoolTime(activeChar)); sendPacket(new ExVoteSystemInfo(activeChar)); sendPacket(new ExNevitAdventPointInfoPacket(0)); sendPacket(new ExNevitAdventTimeChange(-1)); // only set pause state... sendPacket(new ExShowContactList(activeChar)); for (L2ItemInstance i : activeChar.getInventory().getItems()) { if (i.isTimeLimitedItem()) i.scheduleLifeTimeTask(); if (i.isShadowItem() && i.isEquipped()) i.decreaseMana(false); } for (L2ItemInstance i : activeChar.getWarehouse().getItems()) { if (i.isTimeLimitedItem()) i.scheduleLifeTimeTask(); } if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false)) DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar); if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis()) activeChar.sendPacket(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED); // remove combat flag before teleporting if (activeChar.getInventory().getItemByItemId(9819) != null) { Fort fort = FortManager.getInstance().getFort(activeChar); if (fort != null) FortSiegeManager.getInstance().dropCombatFlag(activeChar, fort.getFortId()); else { int slot = activeChar.getInventory().getSlotFromItem(activeChar.getInventory().getItemByItemId(9819)); activeChar.getInventory().unEquipItemInBodySlot(slot); activeChar.destroyItem("CombatFlag", activeChar.getInventory().getItemByItemId(9819), null, true); } } // Attacker or spectator logging in to a siege zone. Actually should be checked for inside castle only? if (!activeChar.isGM() // inside siege zone && activeChar.isInsideZone(L2Character.ZONE_SIEGE) // but non-participant or attacker && (!activeChar.isInSiege() || activeChar.getSiegeState() < 2)) activeChar.teleToLocation(MapRegionManager.TeleportWhereType.Town); if (Config.ALLOW_MAIL) { if (MailManager.getInstance().hasUnreadPost(activeChar)) sendPacket(ExNoticePostArrived.valueOf(false)); } RegionBBSManager.getInstance().changeCommunityBoard(); CommunityServerThread.getInstance().sendPacket(new WorldInfo(activeChar, null, WorldInfo.TYPE_UPDATE_PLAYER_STATUS)); TvTEvent.onLogin(activeChar); if (Config.WELCOME_MESSAGE_ENABLED) activeChar.sendPacket(new ExShowScreenMessage(Config.WELCOME_MESSAGE_TEXT, Config.WELCOME_MESSAGE_TIME)); L2ClassMasterInstance.showQuestionMark(activeChar); if (CTF._savePlayers.contains(activeChar.getName())) { CTF.addDisconnectedPlayer(activeChar); } int birthday = activeChar.checkBirthDay(); if (birthday == 0) { activeChar.sendPacket(SystemMessageId.YOUR_BIRTHDAY_GIFT_HAS_ARRIVED); // activeChar.sendPacket(new ExBirthdayPopup()); Removed in H5? } else if (birthday != -1) { sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_DAYS_UNTIL_YOUR_CHARACTERS_BIRTHDAY); sm.addString(Integer.toString(birthday)); activeChar.sendPacket(sm); } if(!activeChar.getPremiumItemList().isEmpty()) activeChar.sendPacket(new ExNotifyPremiumItem()); } /** * @param cha */ private void engage(L2PcInstance cha) { int _chaid = cha.getObjectId(); for(Couple cl: CoupleManager.getInstance().getCouples()) { if (cl.getPlayer1Id()==_chaid || cl.getPlayer2Id()==_chaid) { if (cl.getMaried()) cha.setMarried(true); cha.setCoupleId(cl.getId()); if (cl.getPlayer1Id()==_chaid) cha.setPartnerId(cl.getPlayer2Id()); else cha.setPartnerId(cl.getPlayer1Id()); } } } /** * @param cha * @param partnerId */ private void notifyPartner(L2PcInstance cha, int partnerId) { if (cha.getPartnerId() != 0) { int objId = cha.getPartnerId(); try { L2PcInstance partner = L2World.getInstance().getPlayer(objId); if (partner != null) partner.sendMessage("Your Partner has logged in."); partner = null; } catch (ClassCastException cce) { _log.warning("Wedding Error: ID "+objId+" is now owned by a(n) "+L2World.getInstance().findObject(objId).getClass().getSimpleName()); } } } /** * @param activeChar */ private void notifyClanMembers(L2PcInstance activeChar) { L2Clan clan = activeChar.getClan(); // This null check may not be needed anymore since notifyClanMembers is called from within a null check already. Please remove if we're certain it's ok to do so. if (clan != null) { clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar); SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN); msg.addString(activeChar.getName()); clan.broadcastToOtherOnlineMembers(msg, activeChar); msg = null; clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar); } } /** * @param activeChar */ private void notifySponsorOrApprentice(L2PcInstance activeChar) { if (activeChar.getSponsor() != 0) { L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor()); if (sponsor != null) { SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN); msg.addString(activeChar.getName()); sponsor.sendPacket(msg); } } else if (activeChar.getApprentice() != 0) { L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice()); if (apprentice != null) { SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_C1_HAS_LOGGED_IN); msg.addString(activeChar.getName()); apprentice.sendPacket(msg); } } } public void updatePvPColor(int pvpKillAmount, L2PcInstance activeChar) { if (Config.PVP_COLOR_SYSTEM_ENABLED) { if (activeChar.isGM()) return; { if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2))) { activeChar.getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1); } else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount < (Config.PVP_AMOUNT3))) { activeChar.getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2); } else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount < (Config.PVP_AMOUNT4))) { activeChar.getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3); } else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount < (Config.PVP_AMOUNT5))) { activeChar.getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4); } else if (pvpKillAmount >= (Config.PVP_AMOUNT5)) { activeChar.getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5); } } } } public void updatePkColor(int pkKillAmount, L2PcInstance activeChar) { if (Config.PK_COLOR_SYSTEM_ENABLED) { if (activeChar.isGM()) return; { if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount < (Config.PVP_AMOUNT2))) { activeChar.getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT1); } else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount < (Config.PVP_AMOUNT3))) { activeChar.getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT2); } else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount < (Config.PVP_AMOUNT4))) { activeChar.getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT3); } else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount < (Config.PVP_AMOUNT5))) { activeChar.getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT4); } else if (pkKillAmount >= (Config.PK_AMOUNT5)) { activeChar.getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT5); } } } } /////////////////////////////////////////////////////////////////////////////////////////////////////// /** * @param string * @return */ private String getText(String string) { try { String result = new String(Base64.decode(string), "UTF-8"); return result; } catch (UnsupportedEncodingException e) { return null; } } private void loadTutorial(L2PcInstance player) { QuestState qs = player.getQuestState("255_Tutorial"); if (qs != null) qs.getQuest().notifyEvent("UC", null, player); } @Override public String getType() { return _C__11_ENTERWORLD; } @Override protected boolean triggersOnActionRequest() { return false; }}
i can't see smt wrong..can you?

Re: l2j problem
Posted: Sat Sep 01, 2012 12:34 pm
by DreamStage
Show me ur method at L2PcInstance: restoreSkills
Control+L (8365) - line number
Hes saying he cant restore skill (id), because its a null value. Somethings wrong with your method there, or some custom skill. Show me the method, also have u add some custom skills?
Re: l2j problem
Posted: Sat Sep 01, 2012 12:51 pm
by NewbieNeverDie
DreamStage wrote:Show me ur method at L2PcInstance: restoreSkills
Control+L (8365) - line number
Hes saying he cant restore skill (id), because its a null value. Somethings wrong with your method there, or some custom skill. Show me the method, also have u add some custom skills?
Code: Select all
/** * Retrieve from the database all skills of this L2PcInstance and add them to _skills. */ private void restoreSkills() { Connection con = null; try { // Retrieve all skills of this L2PcInstance from the database con = L2DatabaseFactory.getInstance().getConnection(); final PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR); statement.setInt(1, getObjectId()); statement.setInt(2, getClassIndex()); final ResultSet rset = statement.executeQuery(); // Go though the recordset of this SQL query while (rset.next()) { final int id = rset.getInt("skill_id"); final int level = rset.getInt("skill_level"); // Create a L2Skill object for each record final L2Skill skill = SkillTable.getInstance().getInfo(id, level); if (skill == null) { _log.warning("Skipped null skill Id: " + id + " Level: " + level + " while restoring player skills for playerObjId: " + getObjectId()); continue; } // Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character super.addSkill(skill); if (Config.SKILL_CHECK_ENABLE && (!isGM() || Config.SKILL_CHECK_GM)) { if (!SkillTreesData.getInstance().isSkillAllowed(this, skill)) { Util.handleIllegalPlayerAction(this, "Player " + getName() + " has invalid skill " + skill.getName() + " ("+skill.getId() + "/" + skill.getLevel() + "), class:" + getTemplate().className, 1); if (Config.SKILL_CHECK_REMOVE) removeSkill(skill); } } } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e); } finally { L2DatabaseFactory.close(con); } } /** * Retrieve from the database all skill effects of this L2PcInstance and add them to the player. */ @Override public void restoreEffects() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement; ResultSet rset; statement = con.prepareStatement(RESTORE_SKILL_SAVE); statement.setInt(1, getObjectId()); statement.setInt(2, getClassIndex()); rset = statement.executeQuery(); while (rset.next()) { int effectCount = rset.getInt("effect_count"); int effectCurTime = rset.getInt("effect_cur_time"); long reuseDelay = rset.getLong("reuse_delay"); long systime = rset.getLong("systime"); int restoreType = rset.getInt("restore_type"); final L2Skill skill = SkillTable.getInstance().getInfo(rset.getInt("skill_id"), rset.getInt("skill_level")); if (skill == null) continue; final long remainingTime = systime - System.currentTimeMillis(); if (remainingTime > 10) { disableSkill(skill, remainingTime); addTimeStamp(skill, reuseDelay, systime); } /** * Restore Type 1 * The remaning skills lost effect upon logout but * were still under a high reuse delay. */ if (restoreType > 0) continue; /** * Restore Type 0 * These skill were still in effect on the character * upon logout. Some of which were self casted and * might still have had a long reuse delay which also * is restored. * */ if (skill.hasEffects()) { Env env = new Env(); env.player = this; env.target = this; env.skill = skill; L2Effect ef; for (EffectTemplate et : skill.getEffectTemplates()) { ef = et.getEffect(env); if (ef != null) { ef.setCount(effectCount); ef.setFirstTime(effectCurTime); ef.scheduleEffect(); } } } } rset.close(); statement.close(); statement = con.prepareStatement(DELETE_SKILL_SAVE); statement.setInt(1, getObjectId()); statement.setInt(2, getClassIndex()); statement.executeUpdate(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "Could not restore "+this+" active effect data: " + e.getMessage(), e); } finally { L2DatabaseFactory.close(con); } } /** * Retrieve from the database all Henna of this L2PcInstance, add them to _henna and calculate stats of the L2PcInstance.<BR><BR> */ private void restoreHenna() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS); statement.setInt(1, getObjectId()); statement.setInt(2, getClassIndex()); ResultSet rset = statement.executeQuery(); for (int i=0;i<3;i++) _henna[i]=null; while (rset.next()) { int slot = rset.getInt("slot"); if (slot<1 || slot>3) continue; int symbol_id = rset.getInt("symbol_id"); L2HennaInstance sym = null; if (symbol_id != 0) { L2Henna tpl = HennaTable.getInstance().getTemplate(symbol_id); if (tpl != null) { sym = new L2HennaInstance(tpl); _henna[slot-1] = sym; } } } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.SEVERE, "Failed restoing character "+this+" hennas.", e); } finally { L2DatabaseFactory.close(con); } // Calculate Henna modifiers of this L2PcInstance recalcHennaStats(); } /** * @return the number of Henna empty slot of the L2PcInstance. */ public int getHennaEmptySlots() { int totalSlots = 0; if (getClassId().level() == 1) totalSlots = 2; else totalSlots = 3; for (int i = 0; i < 3; i++) { if (_henna[i] != null) totalSlots--; } if (totalSlots <= 0) return 0; return totalSlots; } /** * Remove a Henna of the L2PcInstance, save update in the character_hennas table of the database and send Server->Client HennaInfo/UserInfo packet to this L2PcInstance.<BR><BR> * @param slot * @return */ public boolean removeHenna(int slot) { if (slot < 1 || slot > 3) return false; slot--; if (_henna[slot] == null) return false; L2HennaInstance henna = _henna[slot]; _henna[slot] = null; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement(DELETE_CHAR_HENNA); statement.setInt(1, getObjectId()); statement.setInt(2, slot+1); statement.setInt(3, getClassIndex()); statement.execute(); statement.close(); } catch (Exception e) { _log.log(Level.SEVERE, "Failed remocing character henna.", e); } finally { L2DatabaseFactory.close(con); } // Calculate Henna modifiers of this L2PcInstance recalcHennaStats(); // Send Server->Client HennaInfo packet to this L2PcInstance sendPacket(new HennaInfo(this)); // Send Server->Client UserInfo packet to this L2PcInstance sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); // Add the recovered dyes to the player's inventory and notify them. getInventory().addItem("Henna", henna.getItemIdDye(), henna.getAmountDyeRequire() / 2, this, null); reduceAdena("Henna", henna.getPrice() / 5, this, false); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S); sm.addItemName(henna.getItemIdDye()); sm.addItemNumber(henna.getAmountDyeRequire() / 2); sendPacket(sm); sendPacket(SystemMessageId.SYMBOL_DELETED); return true; } /** * Add a Henna to the L2PcInstance, save update in the character_hennas table of the database and send Server->Client HennaInfo/UserInfo packet to this L2PcInstance.<BR><BR> * @param henna * @return */ public boolean addHenna(L2HennaInstance henna) { for (int i = 0; i < 3; i++) { if (_henna[i] == null) { _henna[i] = henna; // Calculate Henna modifiers of this L2PcInstance recalcHennaStats(); Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement(ADD_CHAR_HENNA); statement.setInt(1, getObjectId()); statement.setInt(2, henna.getSymbolId()); statement.setInt(3, i+1); statement.setInt(4, getClassIndex()); statement.execute(); statement.close(); } catch (Exception e) { _log.log(Level.SEVERE, "Failed saving character henna.", e); } finally { L2DatabaseFactory.close(con); } // Send Server->Client HennaInfo packet to this L2PcInstance sendPacket(new HennaInfo(this)); // Send Server->Client UserInfo packet to this L2PcInstance sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); return true; } } return false;
i just fixed some skills ( debuff of hk etc.. but that happened days ago.. nowadays i didn't change anything i think)
Re: l2j problem
Posted: Sat Sep 01, 2012 1:00 pm
by DreamStage
ok first check if ur sql statement (RESTORE_SKILLS_FOR_CHAR) for restoring skills is valid, if theres exist the colum: skill_id and skill_level at your table database for skills for that statement.
Then check if for example when u create a char, and add some skill or when he levels up ur server needs to save all player skills ofc. So test that:
- Creating a new character
- Leveling him up
- Learning all skills.
- Shutdown server for saving player skills.
- Check if the player has skills saved at database.
Conditions:
- If player has skills saved at database, its ok, if not theres something wrong with saving skills method.
- If player has skills, and doesnt load it, somethings wrong with ur method restoreSkills.
- If player doesnt have skills, and the method wants to load them, you get that error (null skills).
For that problem ur facing, im wondering if that player has skills for him at database. Its saying there are 0 skills for him. Check it, trace his object id char with his skills at database, skills table for that statement (RESTORE_SKILLS_FOR_CHAR).
Re: l2j problem
Posted: Sat Sep 01, 2012 1:07 pm
by NewbieNeverDie
there is no problem with save skills...i think just can't load. also it shows me grade penalty in passive skills ( even when u wear s84 items in 85 lvl)
Re: l2j problem
Posted: Mon Sep 03, 2012 7:50 pm
by UnAfraid
The problem is in skill trees.
Have you touched anything skill trees related?
pastebin your com.l2jserver.gameserver.datatables.SkillTreesData.isSkillAllowed(L2PcInstance, L2Skill) method and mark which is the line shown in the log.
Re: l2j problem
Posted: Tue Sep 04, 2012 5:45 am
by NewbieNeverDie
UnAfraid wrote:The problem is in skill trees.
Have you touched anything skill trees related?
pastebin your com.l2jserver.gameserver.datatables.SkillTreesData.isSkillAllowed(L2PcInstance, L2Skill) method and mark which is the line shown in the log.
Code: Select all
} /** * Verify if the give skill is valid for the given player.<br> * GM's skills are excluded for GM players. * @param player the player to verify the skill. * @param skill the skill to be verified. * @return {@code true} if the skill is allowed to the given player. */ public boolean isSkillAllowed(L2PcInstance player, L2Skill skill) { if (skill.isExcludedFromCheck()) { return true; } if (player.isGM() && skill.isGMSkill()) { return true; } // Prevent accidental skill remove during reload if (_loading) { return true; } final int maxLvl = SkillTable.getInstance().getMaxLevel(skill.getId()); final int hashCode = SkillTable.getSkillHashCode(skill.getId(), Math.min(skill.getLevel(), maxLvl)); if (Arrays.binarySearch(_skillsByClassIdHashCodes.get(player.getClassId().ordinal()), hashCode) >= 0) { return true; } if (Arrays.binarySearch(_skillsByRaceHashCodes.get(player.getRace().ordinal()), hashCode) >= 0) { return true; } if (Arrays.binarySearch(_allSkillsHashCodes, hashCode) >= 0) { return true; } // Exclude Transfer Skills from this check. if (getTransferSkill(skill.getId(), Math.min(skill.getLevel(), maxLvl), player.getClassId()) != null) { return true; } return false; } public static SkillTreesData getInstance() { return SingletonHolder._instance; } /** * Singleton holder for the SkillTreesData class. */ @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final SkillTreesData _instance = new SkillTreesData(); }}
here it is... what's the problem from this file? also what is pastebin? (i'm little newbie) 
Re: l2j problem
Posted: Tue Sep 04, 2012 12:10 pm
by UnAfraid
UnAfraid wrote:The problem is in skill trees.
Have you touched anything skill trees related?
pastebin your com.l2jserver.gameserver.datatables.SkillTreesData.isSkillAllowed(L2PcInstance, L2Skill) method and mark which is the line shown in the log.
Re: l2j problem
Posted: Tue Sep 04, 2012 2:07 pm
by NewbieNeverDie
UnAfraid wrote:UnAfraid wrote:The problem is in skill trees.
Have you touched anything skill trees related?
pastebin your com.l2jserver.gameserver.datatables.SkillTreesData.isSkillAllowed(L2PcInstance, L2Skill) method and mark which is the line shown in the log.
i didn't touch anything... what do u mean mark it? or pastebin?
Re: l2j problem
Posted: Tue Sep 04, 2012 3:13 pm
by UnAfraid
Mark which line is 1218 in that file.