Jump to content

Rank Pvp System 3.8.9 [Il - H5]


Recommended Posts

3.8.5 relesed. Fxed many bugs. I recommend reinstall all previous version for this one ;)

It is beta but i've hope I not created new bugs ;)

Link to comment
Share on other sites

Just a suggestion, use try with resources for database interactions:

 

private void load()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
Statement statement = con.createStatement();
ResultSet rset = statement.executeQuery("SELECT * FROM rank_pvp_system"))
{
 
With this, you don't need to close the resources after the usage, like con.close();
Link to comment
Share on other sites

Just a suggestion, use try with resources for database interactions:

 

try (Connection con = L2DatabaseFactory.getInstance().getConnection())

 
With this, you don't need to close the resources after the usage, like con.close();

 

 

Thanks to java 7 :D

Edited by SweeTs
Link to comment
Share on other sites

BTW

 

any awesome solution for neasted try statements for example in here?

try(Connection con = L2DatabaseFactory.getInstance().getConnection())
{
	try(PreparedStatement statement = con.prepareStatement(QUERY_ONE))
	{
		try(ResultSet rset = statement.executeQuery())
		{
			something(rset);
		}
	}
	try(PreparedStatement statement = con.prepareStatement(QUERY_TWO))
	{
		statement.executeUpdate();
	}
}
catch(SQLException e)
{
	_log.error(e);
}
Link to comment
Share on other sites

Maybe something like this:

try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
	statement = con.createStatement();

	statement.addBatch(insert1);
	statement.addBatch(insert2);
	
	statement.addBatch(update1);
	statement.addBatch(update2);
	statement.addBatch(update3);
	
	statement.addBatch(delete1);
	statement.addBatch(delete2);

	statement.batchExecute();
	
	
	statement = con.prepareStatement(select1);
	ResultSet rset = statement.executeQuery();
	
	something(rset);
}
catch (SQLException e)
{
	_log.error(e);
}
Edited by << Masterio >>
Link to comment
Share on other sites

 

Maybe something like this:

try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
	statement = con.createStatement();

	statement.addBatch(insert1);
	statement.addBatch(insert2);
	
	statement.addBatch(update1);
	statement.addBatch(update2);
	statement.addBatch(update3);
	
	statement.addBatch(delete1);
	statement.addBatch(delete2);

	statement.batchExecute();
	
	
	statement = con.prepareStatement(select1);
	ResultSet rset = statement.executeQuery();
	
	something(rset);
}
catch (SQLException e)
{
	_log.error(e);
}

 

If you will get exception, memory will leak because of unclosed Statement and ResultSet. Only object that is safe is con

Link to comment
Share on other sites

 I got this error:

 

 

Exception in thread "Thread-233" Exception in thread "Thread-232" java.lang.NullPointerException
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.KillerPvpStats.updateDailyStats(KillerPvpStats.java:274)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.PvpTable.getKillerPvpStats(PvpTable.java:229)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RankPvpSystem.doPvp(RankPvpSystem.java:64)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RankPvpSystemPc$RankPvpSystemPvpTask.run(RankPvpSystemPc.java:43)
    at java.lang.Thread.run(Unknown Source)

 

 and

 

sent bad RequestBypassToServer: "RPS.RPC:1"
java.lang.NullPointerException
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RPCTable.getRpcByPlayerId(RPCTable.java:91)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RankPvpSystemRPC.playerResponseHtm(RankPvpSystemRPC.java:25)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RankPvpSystemRPC.sendPlayerResponse(RankPvpSystemRPC.java:17)
    at com.l2jserver.gameserver.masteriopack.rankpvpsystem.RankPvpSystemBypass.executeCommand(RankPvpSystemBypass.java:75)
    at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:287)
    at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)
    at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1101)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Edited by Amida Nguyen
Link to comment
Share on other sites

Amida Nguyen 

You should include RPS version and chronicle what u are using.

 

I use RPS 8.5 and Freya, now I have problem is RPS point always reset to 0 after restart server

Edited by Amida Nguyen
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock