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..

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..