exception in thread "selectorthread-48"

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

exception in thread "selectorthread-48"

Post by Abyssal »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
what is this error?

Image

well it appears only sometimes when i try to login to the server. after i got this error i must close and open again the gameserver and the loginserver in order to login to the server again. does anyone know why is this happening and how can i fix it?
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: exception in thread "selectorthread-48"

Post by janiii »

legacy server support section, so what are your revisions?
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

janiii wrote:legacy server support section, so what are your revisions?
my revision is 1434
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: exception in thread "selectorthread-48"

Post by JIV »

it doesn't look like l2j server, from where you have that pack?
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

JIV wrote:it doesn't look like l2j server, from where you have that pack?
from the download nightly page of l2jserver. it is l2jserver but this error appears in other kind of packs as well.

this error actually appears when i try to login with my character while i am on the loading screen. when this error appears the game stacks on the loading screen and only the mouse cursor works. this has happened to me in many servers ive joined and now it happens to my server as well. im sure many people have met the same error.
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: exception in thread "selectorthread-48"

Post by JIV »

There is no such pack in nightly. Lock.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: exception in thread "selectorthread-48"

Post by janiii »

maybe he means nightly 6 months ago?..
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

guys this is my L2GamePacketHandler.java:

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 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 net.sf.l2j.gameserver.network; import java.nio.ByteBuffer;import java.sql.Time;import java.util.concurrent.RejectedExecutionException;import java.util.logging.Logger; import net.sf.l2j.Config;import net.sf.l2j.gameserver.GmListTable;import net.sf.l2j.gameserver.LoginServerThread;import net.sf.l2j.gameserver.ThreadPoolManager;import net.sf.l2j.gameserver.clientpackets.*;import net.sf.l2j.gameserver.network.L2GameClient.GameClientState;import net.sf.l2j.util.Util; import com.l2jserver.mmocore.network.IClientFactory;import com.l2jserver.mmocore.network.IMMOExecutor;import com.l2jserver.mmocore.network.IPacketHandler;import com.l2jserver.mmocore.network.MMOConnection;import com.l2jserver.mmocore.network.ReceivablePacket; /** * Stateful Packet Handler<BR> * The Stateful approach prevents the server from handling inconsistent packets, examples:<BR> * <li>Clients sends a MoveToLocation packet without having a character attached. (Potential errors handling the packet).</li> * <li>Clients sends a RequestAuthLogin being already authed. (Potential exploit).</li> * <BR><BR> * Note: If for a given exception a packet needs to be handled on more then one state, then it should be added to all these states. * @author  KenM */public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>, IClientFactory<L2GameClient>, IMMOExecutor<L2GameClient>{	private static final Logger _log = Logger.getLogger(L2GamePacketHandler.class.getName()); 	// implementation	public ReceivablePacket<L2GameClient> handlePacket(ByteBuffer buf, L2GameClient client)	{		int opcode = buf.get() & 0xFF; 		ReceivablePacket<L2GameClient> msg = null;		GameClientState state = client.getState(); 		switch (state)		{			case CONNECTED:				if (opcode == 0x00)				{					msg = new ProtocolVersion();				}				else if (opcode == 0x08)				{					msg = new AuthLogin();				}				else				{					printDebug(opcode, buf, state, client);				}				break;			case AUTHED:				switch (opcode)				{					case 0x09:						msg = new Logout();						break;					case 0x0b:						msg = new CharacterCreate();						break;					case 0x0c:						msg = new CharacterDelete();						break;					case 0x0d:						msg = new CharacterSelected();						break;					case 0x0e:						msg = new NewCharacter();						break;					case 0x62:						msg = new CharacterRestore();						break;					case 0x68:						msg = new RequestPledgeCrest();						break;					default:						printDebug(opcode, buf, state, client);						break;				}				break;			case IN_GAME:				switch(opcode)				{					case 0x01:						msg = new MoveBackwardToLocation();						break;//					case 0x02://						// Say  ... not used any more ??//						break;					case 0x03:						msg = new EnterWorld();						break;					case 0x04:						msg = new Action();						break;					case 0x09:						msg = new Logout();						break;					case 0x0a:						msg = new AttackRequest();						break;					case 0x0f:						msg = new RequestItemList();						break;//					case 0x10://						// RequestEquipItem ... not used any more, instead "useItem"//						break;					case 0x11:						msg = new RequestUnEquipItem();						break;					case 0x12:						msg = new RequestDropItem();						break;					case 0x14:						msg = new UseItem();						break;					case 0x15:						msg = new TradeRequest();						break;					case 0x16:						msg = new AddTradeItem();						break;					case 0x17:						msg = new TradeDone();						break;					case 0x1a:						msg = new DummyPacket();						break;					case 0x1b:						msg = new RequestSocialAction();						break;					case 0x1c:						msg = new ChangeMoveType2();						break;					case 0x1d:						msg = new ChangeWaitType2();						break;					case 0x1e:						msg = new RequestSellItem();						break;					case 0x1f:						msg = new RequestBuyItem();						break;					case 0x20:						msg = new RequestLinkHtml();						break;					case 0x21:						msg = new RequestBypassToServer();						break;					case 0x22:						msg = new RequestBBSwrite();						break;					case 0x23:						msg = new DummyPacket();						break;					case 0x24:						msg = new RequestJoinPledge();						break;					case 0x25:						msg = new RequestAnswerJoinPledge();						break;					case 0x26:						msg = new RequestWithdrawalPledge();						break;					case 0x27:						msg = new RequestOustPledgeMember();						break;//					case 0x28://						// RequestDismissPledge//						break;					case 0x29:						msg = new RequestJoinParty();						break;					case 0x2a:						msg = new RequestAnswerJoinParty();						break;					case 0x2b:						msg = new RequestWithDrawalParty();						break;					case 0x2c:						msg = new RequestOustPartyMember();						break;					case 0x2d:						// RequestDismissParty						break;					case 0x2e:						msg = new DummyPacket();						break;					case 0x2f:						msg = new RequestMagicSkillUse();						break;					case 0x30:						msg = new Appearing();  //  (after death)						break;					case 0x31:						if (Config.ALLOW_WAREHOUSE)							msg = new SendWareHouseDepositList();						break;					case 0x32:		                msg = new SendWareHouseWithDrawList();						break;					case 0x33:						msg = new RequestShortCutReg();						break;					case 0x34:						msg = new DummyPacket();						break;					case 0x35:						msg = new RequestShortCutDel();						break;					case 0x36:						msg = new CannotMoveAnymore();						break;					case 0x37:						msg = new RequestTargetCanceld();						break;					case 0x38:						msg = new Say2();						break;					case 0x3c:						msg = new RequestPledgeMemberList();						break;					case 0x3e:						msg = new DummyPacket();						break;					case 0x3f:						msg = new RequestSkillList();						break;//					case 0x41://						// MoveWithDelta    ... unused ?? or only on ship ??//						break;					case 0x42:						msg = new RequestGetOnVehicle();						break;					case 0x43:						msg = new RequestGetOffVehicle();						break;					case 0x44:						msg = new AnswerTradeRequest();						break;					case 0x45:						msg = new RequestActionUse();						break;					case 0x46:						msg = new RequestRestart();						break;//					case 0x47://						// RequestSiegeInfo//						break;					case 0x48:						msg = new ValidatePosition();						break;//					case 0x49://						// RequestSEKCustom//						break;//						THESE ARE NOW TEMPORARY DISABLED					case 0x4a:						//new StartRotating();						break;					case 0x4b:						//new FinishRotating();						break;					case 0x4d:						msg = new RequestStartPledgeWar();						break;					case 0x4e:						msg = new RequestReplyStartPledgeWar();						break;					case 0x4f:		                msg = new RequestStopPledgeWar();						break;					case 0x50:		                msg = new RequestReplyStopPledgeWar();		                break;		            case 0x51:		                msg = new RequestSurrenderPledgeWar();		                break;		            case 0x52:		                msg = new RequestReplySurrenderPledgeWar();		                break;		            case 0x53:						msg = new RequestSetPledgeCrest();						break;					case 0x55:						msg = new RequestGiveNickName();						break;					case 0x57:						msg = new RequestShowBoard();						break;					case 0x58:						msg = new RequestEnchantItem();						break;					case 0x59:						msg = new RequestDestroyItem();						break;					case 0x5b:						msg = new SendBypassBuildCmd();						break;					case 0x5c:						msg = new RequestMoveToLocationInVehicle();						break;					case 0x5d:						msg = new CannotMoveAnymoreInVehicle();						break;					case 0x5e:						msg = new RequestFriendInvite();						break;					case 0x5f:						msg = new RequestAnswerFriendInvite();						break; 					case 0x60:						msg = new RequestFriendList();						break;					case 0x61:						msg = new RequestFriendDel();						break;					case 0x63:						msg = new RequestQuestList();						break;					case 0x64:						msg = new RequestQuestAbort();						break;					case 0x66:						msg = new RequestPledgeInfo();						break;//					case 0x67://						// RequestPledgeExtendedInfo//						break;					case 0x68:						msg = new RequestPledgeCrest();						break;					case 0x69:		                msg = new RequestSurrenderPersonally();						break;//					case 0x6a://						// Ride//						break;					case 0x6b: // send when talking to trainer npc, to show list of available skills						msg = new RequestAquireSkillInfo();//  --> [s] 0xa4;						break;					case 0x6c: // send when a skill to be learned is selected						msg = new RequestAquireSkill();						break;					case 0x6d:						msg = new RequestRestartPoint();						break;					case 0x6e:						msg = new RequestGMCommand();						break;					case 0x6f:						msg = new RequestPartyMatchList();						break; 					case 0x70:						msg = new RequestPartyMatchConfig();						break;					case 0x71:						msg = new RequestPartyMatchDetail();						break;					case 0x72:						msg = new RequestCrystallizeItem();						break;					case 0x73:						msg = new RequestPrivateStoreManageSell();						break;					case 0x74:						msg = new SetPrivateStoreListSell();						break;//					case 0x75://						msg = new RequestPrivateStoreManageCancel(data, _client);//						break;					case 0x76:						msg = new RequestPrivateStoreQuitSell();						break;					case 0x77:						msg = new SetPrivateStoreMsgSell();						break;//					case 0x78://						// RequestPrivateStoreList//						break;					case 0x79:						msg = new RequestPrivateStoreBuy();						break;//					case 0x7a://						// ReviveReply//						break;//					case 0x7b://						// RequestTutorialLinkHtml//						break;//					case 0x7c://						// RequestTutorialPassCmdToServer//						break;//					case 0x7d://						// RequestTutorialQuestionMark//						break;//					case 0x7e://						// RequestTutorialClientEvent//						break;					case 0x7f:						msg = new RequestPetition();						break;					case 0x80:						msg = new RequestPetitionCancel();						break;					case 0x81:						msg = new RequestGmList();						break;					case 0x82:						msg = new RequestJoinAlly();						break;					case 0x83:						msg = new RequestAnswerJoinAlly();						break;		            case 0x84:		                msg = new AllyLeave();		                break;		            case 0x85:		                msg = new AllyDismiss();		                break;					case 0x86:		                msg = new RequestDismissAlly();						break;					case 0x87:						msg = new RequestSetAllyCrest();						break;					case 0x88:						msg = new RequestAllyCrest();						break;					case 0x89:						msg = new RequestChangePetName();						break;					case 0x8a:						msg = new RequestPetUseItem();						break;					case 0x8b:						msg = new RequestGiveItemToPet();						break;					case 0x8c:						msg = new RequestGetItemFromPet();						break;					case 0x8e:						msg = new RequestAllyInfo();						break;					case 0x8f:						msg = new RequestPetGetItem();						break;					case 0x90:						msg = new RequestPrivateStoreManageBuy();						break;					case 0x91:						msg = new SetPrivateStoreListBuy ();						break;//					case 0x92://						// RequestPrivateStoreBuyManageCancel//						break;					case 0x93:						msg = new RequestPrivateStoreQuitBuy();						break;					case 0x94:						msg = new SetPrivateStoreMsgBuy();						break;//					case 0x95://						// RequestPrivateStoreBuyList//						break;					case 0x96:						msg = new RequestPrivateStoreSell();						break;//					case 0x97://						// SendTimeCheckPacket//						break;//					case 0x98://						// RequestStartAllianceWar//						break;//					case 0x99://						// ReplyStartAllianceWar//						break;//					case 0x9a://						// RequestStopAllianceWar//						break;//					case 0x9b://		 				// ReplyStopAllianceWar//						break;//					case 0x9c://						// RequestSurrenderAllianceWar//						break;					case 0x9d:						// RequestSkillCoolTime						/*if (Config.DEBUG)							_log.info("Request Skill Cool Time .. ignored");						msg = null;*/						break;					case 0x9e:						msg = new RequestPackageSendableItemList();						break;					case 0x9f:						msg = new RequestPackageSend();						break;					case 0xa0:						msg = new RequestBlock();						break;//					case 0xa1://						// RequestCastleSiegeInfo//						break;					case 0xa2:		                msg = new RequestSiegeAttackerList();		                break;					case 0xa3:		                msg = new RequestSiegeDefenderList();		                break;					case 0xa4:		                msg = new RequestJoinSiege();		                break;					case 0xa5:					    msg = new RequestConfirmSiegeWaitingList();					    break;//					case 0xa6://						// RequestSetCastleSiegeTime//						break;					case 0xa7:						msg = new MultiSellChoose();						break;//					case 0xa8://						// NetPing//						break;		            case 0xaa:		            	msg = new RequestUserCommand();		                break;		            case 0xab:		            	msg = new SnoopQuit();		            	break;		            case 0xac:  // we still need this packet to handle BACK button of craft dialog		             msg = new RequestRecipeBookOpen();		                break;		            case 0xad:		                msg = new RequestRecipeBookDestroy();		                break;					case 0xae:						msg = new RequestRecipeItemMakeInfo();					    break;					case 0xaf:						msg = new RequestRecipeItemMakeSelf();					    break; 					//case 0xb0:					//	msg = new RequestRecipeShopManageList(data, client);					//    break;		            case 0xb1:		            	msg = new RequestRecipeShopMessageSet();		                break;					case 0xb2:						msg = new RequestRecipeShopListSet();					    break;					case 0xb3:						msg = new RequestRecipeShopManageQuit();					    break;					case 0xb5:						msg = new RequestRecipeShopMakeInfo();					    break;					case 0xb6:						msg = new RequestRecipeShopMakeItem();					    break;					case 0xb7:						msg = new RequestRecipeShopManagePrev();					    break;					case 0xb8:						msg = new ObserverReturn();					    break;					case 0xb9:						msg = new RequestEvaluate();					    break;					case 0xba:					    msg = new RequestHennaList();					    break;					case 0xbb:						msg = new RequestHennaItemInfo();						break;					case 0xbc:						msg = new RequestHennaEquip();						break;					case 0xc0:						// Clan Privileges						msg = new RequestPledgePower();						break;		            case 0xc1:		                msg = new RequestMakeMacro();		                break;		            case 0xc2:						msg = new RequestDeleteMacro();						break;					// Manor		            case 0xc3:		            	msg = new RequestBuyProcure();		            	break;		            case 0xc4:		            	msg = new RequestBuySeed();		            	break;		            case 0xc5:						msg = new DlgAnswer();						break;		            case 0xc6:						msg = new RequestWearItem();						break;		            case 0xc7:		            	msg = new RequestSSQStatus();		            	break;		            case 0xCA:		                msg = new GameGuardReply();		                break;		            case 0xcc:		            	msg = new RequestSendFriendMsg();		            	break;		            case 0xcd:		                msg = new RequestShowMiniMap();		                break;		            case 0xce: // MSN dialogs so that you dont see them in the console.						break;		            case 0xcf: //record video		            	msg = new RequestRecordInfo();		                break; 		            case 0xd0:		            	int id2 = -1;		            	if (buf.remaining() >= 2)		            	{		            		id2 = buf.getShort() & 0xffff;		            	}		            	else		            	{		            		_log.warning("Client: "+client.toString()+" sent a 0xd0 without the second opcode.");		            		break;		            	} 		                switch (id2)		                {		                	case 1:		                		msg = new RequestOustFromPartyRoom();		                		break;		                	case 2:		                		msg = new RequestDismissPartyRoom();		                		break;		                	case 3:		                		msg = new RequestWithdrawPartyRoom();		                		break;		                    case 4:		                        msg = new RequestChangePartyLeader();		                        break;		                    case 5:		                        msg = new RequestAutoSoulShot();		                        break;		                    case 6:		                        msg = new RequestExEnchantSkillInfo();		                        break;		                    case 7:		                    	msg = new RequestExEnchantSkill();		                    	break;		                    case 8:		                    	msg = new RequestManorList();		                    	break;		                    case 9:		                    	msg = new RequestProcureCropList();		                    	break;		                    case 0x0a:		                    	msg = new RequestSetSeed();		                    	break;		                    case 0x0b:		                    	msg = new RequestSetCrop();		                    	break;		                    case 0x0c:		                    	msg = new RequestWriteHeroWords();		                    	break;		                    case 0x0d:		                    	msg = new RequestExAskJoinMPCC();		                    	break;		                    case 0x0e:		                    	msg = new RequestExAcceptJoinMPCC();		                    	break;		                    case 0x0f:		                    	msg = new RequestExOustFromMPCC();		                    	break;		                    case 0x10:		                    	msg = new RequestExPledgeCrestLarge();		                    	break;		                    case 0x11:		                    	msg = new RequestExSetPledgeCrestLarge();		                    	break;		                    case 0x12:		                    	msg = new RequestOlympiadObserverEnd();		                    	break;		                    case 0x13:		                    	msg = new RequestOlympiadMatchList();		                    	break;		                    case 0x14:		                        msg = new RequestAskJoinPartyRoom();		                        break;		                    case 0x15:		                        msg = new AnswerJoinPartyRoom();		                        break;		                    case 0x16:		                        msg = new RequestListPartyMatchingWaitingRoom();		                        break;		                    case 0x17:		                        msg = new RequestExitPartyMatchingWaitingRoom();		                        break;		                    case 0x18:		                        msg = new RequestGetBossRecord();		                        break;		                    case 0x19:		                        msg = new RequestPledgeSetAcademyMaster();		                        break;		                    case 0x1a:		                        msg = new RequestPledgePowerGradeList();		                        break;		                    case 0x1b:		                        msg = new RequestPledgeMemberPowerInfo();		                        break;		                    case 0x1c:		                        msg = new RequestPledgeSetMemberPowerGrade();		                        break;		                    case 0x1d:		                        msg = new RequestPledgeMemberInfo();		                        break;		                    case 0x1e:		                        msg = new RequestPledgeWarList();		                        break;		                    case 0x1f:		                        msg = new RequestExFishRanking();		                        break;		                    case 0x20:		                        msg = new RequestPCCafeCouponUse();		                        break;		                    // couldnt find it 0x21 :S		                    case 0x22:		                    	msg = new RequestCursedWeaponList();		                    	break;		                    case 0x23:		                    	msg = new RequestCursedWeaponLocation();		                    	break;		                    case 0x24:		                    	msg = new RequestPledgeReorganizeMember();		                    	break;		                    // couldnt find it 0x25 :S		                    case 0x26:		                    	msg = new RequestExMPCCShowPartyMembersInfo();		                    	break;		                    case 0x27:		                    	msg = new RequestDuelStart();		                    	break;		                    case 0x28:		                    	msg = new RequestDuelAnswerStart();		                    	break;		                    case 0x29:		                    	msg = new RequestConfirmTargetItem();		                    	break;		                    case 0x2a:		                    	msg = new RequestConfirmRefinerItem();		                    	break;		                    case 0x2b:		                    	msg = new RequestConfirmGemStone();		                    	break;		                    case 0x2c:		                    	msg = new RequestRefine();		                    	break;		                    case 0x2d:		                    	msg = new RequestConfirmCancelItem();		                    	break;		                    case 0x2e:		                    	msg = new RequestRefineCancel();		                    	break;		                    case 0x2f:		                    	msg = new RequestExMagicSkillUseGround();		                    	break;		                    case 0x30:		                    	msg = new RequestDuelSurrender();		                    	break;		                    default:		                     	printDebugDoubleOpcode(opcode, id2, buf, state, client);		                    	break;		                }						break;		            /*case 0xee:						msg = new RequestChangePartyLeader(data, _client);						break;*/					default:						printDebug(opcode, buf, state, client);						break;				}				break;		}		return msg;	} 	private void printDebug(int opcode, ByteBuffer buf, GameClientState state, L2GameClient client)	{		int size = buf.remaining();     	_log.warning("Unknown Packet: "+Integer.toHexString(opcode)+" on State: "+state.name()+" Client: "+client.toString());     	byte[] array = new byte[size];     	buf.get(array);     	_log.warning(Util.printData(array, size));     	if (Config.ENABLE_MAX_PACKET_PROTECTION)     		knownPacketProtection(client);	} 	private void printDebugDoubleOpcode(int opcode, int id2, ByteBuffer buf, GameClientState state, L2GameClient client)	{		int size = buf.remaining();     	_log.warning("Unknown Packet: "+Integer.toHexString(opcode)+":" + Integer.toHexString(id2)+" on State: "+state.name()+" Client: "+client.toString());     	byte[] array = new byte[size];     	buf.get(array);     	_log.warning(Util.printData(array, size));     	if (Config.ENABLE_MAX_PACKET_PROTECTION)     		knownPacketProtection(client);	} 	private void knownPacketProtection(L2GameClient client)	{		if(client.getActiveChar() != null && client.checkknownPackets())		{			punish(client);			return;		}	} 	private void punish(L2GameClient client)	{		switch(Config.KNOWN_PACKETS_PUNiSHMENT)		{			case(1):				if (client.getActiveChar() != null)				{					GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding known packets.");				}				break;			case(2):				_log.warning("PacketProtection: " + client.toString() + " got kicked due flooding of known packets");				if (client.getActiveChar() != null) 				{					GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding known packets and got kicked.");					client.getActiveChar().sendMessage("You are will be kicked for known packet flooding, GM informed.");					client.getActiveChar().closeNetConnection();				}				break;			case(3):				_log.warning("PacketProtection: " + client.toString() + " got banned due flooding of known packets");				LoginServerThread.getInstance().sendAccessLevel(client.getAccountName(), -99);				if(client.getActiveChar() != null)				{					GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding known packets and got banned.");					client.getActiveChar().sendMessage("You are banned for known packet flooding, GM informed.");					client.getActiveChar().closeNetConnection();				}				break;		}	} 	// impl	public L2GameClient create(MMOConnection<L2GameClient> con)	{		return new L2GameClient(con);	} 	public void execute(ReceivablePacket<L2GameClient> rp)	{		try		{			if (rp.getClient().getState() == GameClientState.IN_GAME)			{				ThreadPoolManager.getInstance().executePacket(rp);			}			else			{				ThreadPoolManager.getInstance().executeIOPacket(rp);			}		}		catch (RejectedExecutionException e)		{			// if the server is shutdown we ignore			if (!ThreadPoolManager.getInstance().isShutdown())			{				_log.severe("Failed executing: "+rp.getClass().getSimpleName()+" for Client: "+rp.getClient().toString());			}		}	}} 
and this is my L2GameClient.java:

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 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 net.sf.l2j.gameserver.network; import java.net.InetAddress;import java.nio.ByteBuffer;import java.sql.PreparedStatement;import java.util.List;import java.util.concurrent.RejectedExecutionException;import java.util.concurrent.ScheduledFuture;import java.util.concurrent.locks.ReentrantLock;import java.util.logging.Level;import java.util.logging.Logger; import javolution.util.FastList;import net.sf.l2j.Config;import net.sf.l2j.L2DatabaseFactory;import net.sf.l2j.gameserver.LoginServerThread;import net.sf.l2j.gameserver.ThreadPoolManager;import net.sf.l2j.gameserver.LoginServerThread.SessionKey;import net.sf.l2j.gameserver.communitybbs.Manager.RegionBBSManager;import net.sf.l2j.gameserver.datatables.SkillTable;import net.sf.l2j.gameserver.model.CharSelectInfoPackage;import net.sf.l2j.gameserver.model.L2World;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;import net.sf.l2j.gameserver.model.entity.L2Event;import net.sf.l2j.gameserver.serverpackets.L2GameServerPacket;import net.sf.l2j.gameserver.util.FloodProtector;import net.sf.l2j.gameserver.serverpackets.UserInfo;import net.sf.l2j.util.EventData; import com.l2jserver.mmocore.network.MMOClient;import com.l2jserver.mmocore.network.MMOConnection; /** * Represents a client connected on Game Server * @author  KenM */public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>>{	protected static final Logger _log = Logger.getLogger(L2GameClient.class.getName()); 	/**	 * CONNECTED	- client has just connected	 * AUTHED		- client has authed but doesnt has character attached to it yet	 * IN_GAME		- client has selected a char and is in game	 * @author  KenM	 */	public static enum GameClientState { CONNECTED, AUTHED, IN_GAME }; 	public GameClientState state; 	// Info	public String accountName;	public SessionKey sessionId;	public L2PcInstance activeChar;	private ReentrantLock _activeCharLock = new ReentrantLock(); 	@SuppressWarnings("unused")	private boolean _isAuthedGG;	private long _connectionStartTime;	private List<Integer> _charSlotMapping = new FastList<Integer>(); 	// Task	protected /*final*/ ScheduledFuture _autoSaveInDB; 	// Crypt	public GameCrypt crypt; 	// Flood protection	public byte packetsSentInSec = 0;	public int packetsSentStartTick = 0;     // KnownPacket protection    private int knownPacketCount = 100; 	public L2GameClient(MMOConnection<L2GameClient> con)	{		super(con);		state = GameClientState.CONNECTED;		_connectionStartTime = System.currentTimeMillis();		crypt = new GameCrypt();		_autoSaveInDB = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(   				new AutoSaveTask(), 300000L, 900000L   				);	} 	public byte[] enableCrypt()	{		byte[] key = BlowFishKeygen.getRandomKey();		crypt.setKey(key);		return key;	} 	public GameClientState getState()	{		return state;	} 	public void setState(GameClientState pState)	{		state = pState;	} 	public long getConnectionStartTime()	{		return _connectionStartTime;	} 	@Override	public boolean decrypt(ByteBuffer buf, int size)	{		crypt.decrypt(buf.array(), buf.position(), size);		return true;	} 	@Override	public boolean encrypt(final ByteBuffer buf, final int size)	{		crypt.encrypt(buf.array(), buf.position(), size);		buf.position(buf.position() + size);		return true;	} 	public L2PcInstance getActiveChar()	{		return activeChar;	} 	public void setActiveChar(L2PcInstance pActiveChar)	{		activeChar = pActiveChar;		if (activeChar != null)		{			L2World.getInstance().storeObject(getActiveChar());		}	} 	public ReentrantLock getActiveCharLock()	{		return _activeCharLock;	} 	public void setGameGuardOk(boolean val)	{		_isAuthedGG = val;	} 	public void setAccountName(String pAccountName)	{		accountName = pAccountName;	} 	public String getAccountName()	{		return accountName;	} 	public void setSessionId(SessionKey sk)	{		sessionId = sk;	} 	public SessionKey getSessionId()	{		return sessionId;	} 	public void sendPacket(L2GameServerPacket gsp)	{		getConnection().sendPacket(gsp);		gsp.runImpl();	} 	public L2PcInstance markToDeleteChar(int charslot) throws Exception	{		//have to make sure active character must be nulled		/*if (getActiveChar() != null)		{			saveCharToDisk(getActiveChar());			if (Config.DEBUG)			{				_log.fine("active Char saved");			}			this.setActiveChar(null);		}*/ 		int objid = getObjectIdForSlot(charslot);		if (objid < 0)		    return null; 		L2PcInstance character = L2PcInstance.load(objid);		if (character.getClanId() != 0)			return character; 		java.sql.Connection con = null;		try		{			con = L2DatabaseFactory.getInstance().getConnection();			PreparedStatement statement = con.prepareStatement("UPDATE characters SET deletetime=? WHERE obj_id=?");			statement.setLong(1, System.currentTimeMillis() + Config.DELETE_DAYS*86400000L); // 24*60*60*1000 = 86400000			statement.setInt(2, objid);			statement.execute();			statement.close();		}		catch (Exception e)		{			_log.warning("Data error on update delete time of char: " + e);		}		finally		{			try { con.close(); } catch (Exception e) {}		}	    return null;	} 	public L2PcInstance deleteChar(int charslot) throws Exception	{		//have to make sure active character must be nulled		/*if (getActiveChar() != null)		{			saveCharToDisk (getActiveChar());			if (Config.DEBUG) _log.fine("active Char saved");			this.setActiveChar(null);		}*/ 		int objid = getObjectIdForSlot(charslot);		if (objid < 0)    	    return null; 		L2PcInstance character = L2PcInstance.load(objid);		if (character.getClanId() != 0)			return character; 		deleteCharByObjId(objid);		return null;	} 	/**	 * Save the L2PcInstance to the database.	 */	public static void saveCharToDisk(L2PcInstance cha)	{        try        {            cha.store();        }        catch(Exception e)        {            _log.severe("Error saving player character: "+e);        }	} 	public void markRestoredChar(int charslot) throws Exception	{		//have to make sure active character must be nulled		/*if (getActiveChar() != null)		{			saveCharToDisk (getActiveChar());			if (Config.DEBUG) _log.fine("active Char saved");			this.setActiveChar(null);		}*/ 		int objid = getObjectIdForSlot(charslot);    		if (objid < 0)    		    return;		java.sql.Connection con = null;		try		{		con = L2DatabaseFactory.getInstance().getConnection();		PreparedStatement statement = con.prepareStatement("UPDATE characters SET deletetime=0 WHERE obj_id=?");		statement.setInt(1, objid);		statement.execute();		statement.close();		}		catch (Exception e)		{			_log.severe("Data error on restoring char: " + e);		}		finally		{			try { con.close(); } catch (Exception e) {}		}	}    	public static void deleteCharByObjId(int objid)	{	    if (objid < 0)	        return; 	    java.sql.Connection con = null; 		try		{			con = L2DatabaseFactory.getInstance().getConnection();			PreparedStatement statement ;         	statement = con.prepareStatement("DELETE FROM character_friends WHERE char_id=? OR friend_id=?");			statement.setInt(1, objid);			statement.setInt(2, objid);			statement.execute();			statement.close();             statement = con.prepareStatement("DELETE FROM character_hennas WHERE char_obj_id=?");            statement.setInt(1, objid);            statement.execute();            statement.close(); 			statement = con.prepareStatement("DELETE FROM character_macroses WHERE char_obj_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_quests WHERE char_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_recipebook WHERE char_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_shortcuts WHERE char_obj_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_skills WHERE char_obj_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_skills_save WHERE char_obj_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM character_subclasses WHERE char_obj_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close();             statement = con.prepareStatement("DELETE FROM heroes WHERE char_id=?");            statement.setInt(1, objid);            statement.execute();            statement.close();             statement = con.prepareStatement("DELETE FROM olympiad_nobles WHERE char_id=?");            statement.setInt(1, objid);            statement.execute();            statement.close();             statement = con.prepareStatement("DELETE FROM seven_signs WHERE char_obj_id=?");            statement.setInt(1, objid);            statement.execute();            statement.close();         	statement = con.prepareStatement("DELETE FROM pets WHERE item_obj_id IN (SELECT object_id FROM items WHERE items.owner_id=?)");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM augmentations WHERE item_id IN (SELECT object_id FROM items WHERE items.owner_id=?)");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM items WHERE owner_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close(); 			statement = con.prepareStatement("DELETE FROM merchant_lease WHERE player_id=?");			statement.setInt(1, objid);			statement.execute();			statement.close();  			statement = con.prepareStatement("DELETE FROM characters WHERE obj_Id=?");			statement.setInt(1, objid);			statement.execute();			statement.close();		}		catch (Exception e)		{			_log.warning("Data error on deleting char: " + e);		}		finally		{			try { con.close(); } catch (Exception e) {}		}	} 	public L2PcInstance loadCharFromDisk(int charslot)	{		L2PcInstance character = L2PcInstance.load(getObjectIdForSlot(charslot));         if (character != null)		{			//restoreInventory(character);			//restoreSkills(character);            //character.restoreSkills();			//restoreShortCuts(character);			//restoreWarehouse(character); 			// preinit some values for each login			character.setRunning();	// running is default			character.standUp();		// standing is default 			character.refreshOverloaded();			character.refreshExpertisePenalty();			character.sendPacket(new UserInfo(character));			character.broadcastKarma();            character.setOnlineStatus(true);		}		else		{			_log.severe("could not restore in slot: "+ charslot);		} 		//setCharacter(character);		return character;	} 	/**     * @param chars     */    public void setCharSelection(CharSelectInfoPackage[] chars)    {        _charSlotMapping.clear();         for (int i = 0; i < chars.length; i++)        {            int objectId = chars[i].getObjectId();            _charSlotMapping.add(new Integer(objectId));        }    }     public void close(L2GameServerPacket gsp)    {    	getConnection().close(gsp);    }     /**     * @param charslot     * @return     */    private int getObjectIdForSlot(int charslot)    {        if (charslot < 0 || charslot >= _charSlotMapping.size())        {            _log.warning(toString()+" tried to delete Character in slot "+charslot+" but no characters exits at that slot.");            return -1;        }        Integer objectId = _charSlotMapping.get(charslot);        return objectId.intValue();    }     @Override    protected void onForcedDisconnection()    {    	_log.info("Client "+toString()+" disconnected abnormally.");    }     @Override    protected void onDisconection()	{    	// no long running tasks here, do it async    	try    	{    		ThreadPoolManager.getInstance().executeTask(new DisconnectTask());    	}    	catch (RejectedExecutionException e)    	{    		// server is closing    	}    }     public boolean checkknownPackets()	{		if(this.getActiveChar() != null && 				!FloodProtector.getInstance().tryPerformAction(this.getActiveChar().getObjectId(), FloodProtector.PROTECTED_KNOWNPACKET))		{			knownPacketCount++;			if (knownPacketCount >= Config.MAX_KNOWN_PACKETS)			{				return true;			}			else				return false;		}		else		{			knownPacketCount = 0;			return false;		}	}      /**     * Produces the best possible string representation of this client.     */    @Override	public String toString()	{		try		{			InetAddress address = getConnection().getSocketChannel().socket().getInetAddress();			switch (getState())			{				case CONNECTED:					return "[IP: "+(address == null ? "disconnected" : address.getHostAddress())+"]";				case AUTHED:					return "[Account: "+getAccountName()+" - IP: "+(address == null ? "disconnected" : address.getHostAddress())+"]";				case IN_GAME:					return "[Character: "+(getActiveChar() == null ? "disconnected" : getActiveChar().getName())+" - Account: "+getAccountName()+" - IP: "+(address == null ? "disconnected" : address.getHostAddress())+"]";				default:					throw new IllegalStateException("Missing state on switch");			}		}		catch (NullPointerException e)		{			return "[Character read failed due to disconnect]";		}	} 	class DisconnectTask implements Runnable	{ 		/**		 * @see java.lang.Runnable#run()		 */		public void run()		{			try			{				// Update BBS				try				{					RegionBBSManager.getInstance().changeCommunityBoard();				}				catch (Exception e)				{					e.printStackTrace();				} 				// we are going to mannually save the char bellow thus we can force the cancel				_autoSaveInDB.cancel(true); 	            L2PcInstance player = L2GameClient.this.getActiveChar();				if (player != null)  // this should only happen on connection loss				{ 	                // we store all data from players who are disconnected while in an event in order to restore it in the next login	                if (player.atEvent)	                {	                	EventData data = new EventData(player.eventX, player.eventY, player.eventZ, player.eventkarma, player.eventpvpkills, player.eventpkkills, player.eventTitle, player.kills, player.eventSitForced);	                    L2Event.connectionLossData.put(player.getName(), data);	                }	                if (player.isFlying())	                {	                	player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));	                }					// notify the world about our disconnect					player.deleteMe(); 					try	                {						saveCharToDisk(player);					}	                catch (Exception e2) { /* ignore any problems here */ }				}				L2GameClient.this.setActiveChar(null);			}			catch (Exception e1)			{				_log.log(Level.WARNING, "error while disconnecting client", e1);			}			finally			{				LoginServerThread.getInstance().sendLogout(L2GameClient.this.getAccountName());			}		}	} 	class AutoSaveTask implements Runnable	{		public void run()		{			try			{				L2PcInstance player = L2GameClient.this.getActiveChar();				if (player != null)				{					saveCharToDisk(player);				}			}			catch (Throwable e)			{				_log.severe(e.toString());			}		}	}}
you know guys maybe its an MMOCore issue. if somebody could help it would be great because when this happens the whole server stacks and i have to restart it.

btw thanks to JIV for unlocking the topic.
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: exception in thread "selectorthread-48"

Post by JIV »

1. you should write you have it modified and not just donwloaded precompiled pack :P
2. no its not mmocore problem
3. post also FloodProtector line 124
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

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 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 net.sf.l2j.gameserver.util; import java.util.logging.Logger; import javolution.util.FastMap;import javolution.util.FastMap.Entry;import net.sf.l2j.Config;import net.sf.l2j.gameserver.GameTimeController; /** * Flood protector * * @author durgus */public class FloodProtector{	private static final Logger _log = Logger.getLogger(FloodProtector.class.getName());	private static FloodProtector _instance;  	public static final FloodProtector getInstance()	{		if (_instance == null)		{			_instance = new FloodProtector();		}		return _instance;	} 	// =========================================================	// Data Field	private FastMap<Integer,Integer[]> _floodClient; 	// =========================================================  	// Enum	private static final int PROTECTEDACTIONSIZE = 4; 	// reuse delays for protected actions (in game ticks 1 tick = 100ms)	private static final int[] REUSEDELAY = new int[]{ 4, 42, 42, 16, 100, 200, 15 }; 	// protected actions	public static final int PROTECTED_USEITEM		= 0;	public static final int PROTECTED_ROLLDICE		= 1;	public static final int PROTECTED_FIREWORK		= 2;	public static final int PROTECTED_ITEMPETSUMMON	= 3;	public static final int PROTECTED_HEROVOICE		= 4;	public static final int PROTECTED_SUBCLASS              = 5;  	public static final int PROTECTED_PACKETS         =8; 	public static final int PROTECTED_UNKNOWNPACKET = 9; 	public static final int PROTECTED_BYPASS        = 10;	public static final int PROTECTED_KNOWNPACKET = 11; 	// =========================================================	// Constructor	private FloodProtector()	{		_log.info("Initializing FloodProtector");		_floodClient = new FastMap<Integer, Integer[]>(Config.FLOODPROTECTOR_INITIALSIZE).setShared(true);	} 	/**	 * Add a new player to the flood protector	 * (should be done for all players when they enter the world)	 * @param playerObjId	 */	public void registerNewPlayer(int playerObjId)	{		// create a new array		Integer[] array = new Integer[REUSEDELAY.length];		for (int i=0; i<array.length; i++)			array[i] = 0; 		// register the player with an empty array		_floodClient.put(playerObjId, array);	} 	/**	 * Remove a player from the flood protector	 * (should be done if player loggs off)	 * @param playerObjId	 */	public void removePlayer(int playerObjId)	{		_floodClient.remove(playerObjId);	} 	/**	 * Return the size of the flood protector	 * @return size	 */	public int getSize()	{		return _floodClient.size();	} 	/**	 * Try to perform the requested action	 *	 * @param playerObjId	 * @param action	 * @return true if the action may be performed	 */	public boolean tryPerformAction(int playerObjId, int action)	{		Entry<Integer, Integer[]> entry = _floodClient.getEntry(playerObjId);		Integer[] value = entry.getValue(); 		if (value[action] < GameTimeController.getGameTicks())		{			value[action] = GameTimeController.getGameTicks()+REUSEDELAY[action];			entry.setValue(value);			return true;		}		return false;	}}
JIV wrote:1. you should write you have it modified and not just donwloaded precompiled pack :P
precompiled? i dont use precompiled. i compiled the pack alone and if i modified something i did it alone i just dont remember what exactly i modified in this file because i have this pack 1 year now. i dont remember every modification ive done in it since then.
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: exception in thread "selectorthread-48"

Post by JIV »

javolution.util.FastMap.getEntry(Object key)
Returns:
the entry for the specified key or null if none.
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

JIV wrote:javolution.util.FastMap.getEntry(Object key)
Returns:
the entry for the specified key or null if none.
lol could you explain it a little more? i didnt understand :(
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

ok the other guys problem was solved. what about solving my problem now?
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: exception in thread "selectorthread-48"

Post by JIV »

just check if entry exist in map.
Abyssal
Posts: 74
Joined: Wed Mar 10, 2010 1:53 am

Re: exception in thread "selectorthread-48"

Post by Abyssal »

JIV wrote:just check if entry exist in map.
please explain it more. what entry should i check if it exist and how?
Post Reply