Jump to content
  • 0

SiegeDate (3 days.)


Question

Posted

hello,

 

If i change SQL query, the siege date will be every x days?

 

public void saveSiegeDate()
{
	if (_scheduledStartSiegeTask != null)
	{
		_scheduledStartSiegeTask.cancel(true);
		_scheduledStartSiegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
	}
	Connection con = null;
	PreparedStatement statement = null;
	try
	{
		con = L2DatabaseFactory.getInstance().getConnection();
		statement = con.prepareStatement("UPDATE castle SET siegeDate = ?, regTimeEnd = ?, regTimeOver = ?  WHERE id = ?");
		statement.setLong(1, getSiegeDate().getTimeInMillis());
		statement.setLong(2, getTimeRegistrationOverDate().getTimeInMillis());
		statement.setString(3, String.valueOf(getIsTimeRegistrationOver()));
		statement.setInt(4, getCastle().getCastleId());
		statement.execute();
	}
	catch (Exception e)
	{
		_log.log(Level.WARNING, "Exception: saveSiegeDate(): " + e.getMessage(), e);
	}
	finally
	{
		L2DatabaseFactory.close(con);
	}
}

 

If i replace

statement.setLong(1, getSiegeDate().getTimeInMillis());

 

by

 

statement.setLong(1, 259200000);

259200000 = 3 days.

 

The sieges will be every 3 days?

 

L2j H5.

 

Cordially,

Bleadd

3 answers to this question

Recommended Posts

  • 0
Posted

Nope, you have to change more than that, cause siege date is corrected at server loading/date save.

 

There's a method which change date of castle to be only for saturday or sunday, correctSiegeDateTime().

 

Added to that your system is wrong. You must add 3 days to previous siege time. Not a static date/hour system/whatever.

  • 0
Posted

I have an idea.. It's a crap and sh*t trick but if i substract 14 days and add 3 days, will it work?

 

Edit : After a moment of thinking : it's the same problem..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...