Custom olympiad period config.
This commit is contained in:
parent
84bd9378fa
commit
653c7e8276
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 50
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -536,6 +536,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2274,6 +2277,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -543,6 +543,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2290,6 +2293,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -543,6 +543,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2299,6 +2302,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -543,6 +543,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2297,6 +2300,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,3 +164,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -580,6 +580,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2826,6 +2829,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 120);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 120);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -581,9 +581,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_GRAND_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_GRAND_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -595,6 +596,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_log.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,13 @@ What is done
|
|||||||
-Castle dungeon instances
|
-Castle dungeon instances
|
||||||
-High Five treasure boxes
|
-High Five treasure boxes
|
||||||
-Fixed server lag on many occasions
|
-Fixed server lag on many occasions
|
||||||
|
-Auto potions voiced command
|
||||||
-Store offline trader transactions in realtime
|
-Store offline trader transactions in realtime
|
||||||
-Minimum range config for private stores
|
-Minimum range config for private stores
|
||||||
-Random spawn system for monsters
|
-Random spawn system for monsters
|
||||||
-Custom starting location
|
-Custom starting location
|
||||||
-Custom community board
|
-Custom community board
|
||||||
|
-Custom Olympiad period
|
||||||
-Premium System
|
-Premium System
|
||||||
-User command expon/expoff
|
-User command expon/expoff
|
||||||
-Reworked drop system
|
-Reworked drop system
|
||||||
|
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -542,6 +542,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2221,6 +2224,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,3 +160,29 @@ AltOlyMaxWeeklyMatchesClassed = 30
|
|||||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
# Maximum number of Class-Irrelevant Team matches a character can join per week
|
||||||
# Default: 10
|
# Default: 10
|
||||||
AltOlyMaxWeeklyMatchesTeam = 10
|
AltOlyMaxWeeklyMatchesTeam = 10
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Custom Olympiad period settings
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Example for Olympiad every 2 weeks:
|
||||||
|
# AltOlyUseCustomPeriodSettings = True
|
||||||
|
# AltOlyPeriod = WEEK
|
||||||
|
# AltOlyPeriodMultiplier = 2
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Enable/disable custom period settings.
|
||||||
|
# Default: False
|
||||||
|
AltOlyUseCustomPeriodSettings = False
|
||||||
|
|
||||||
|
# Change the type of delay between two Olympiads.
|
||||||
|
# Available values: MONTH, WEEK, DAY
|
||||||
|
# Default: MONTH
|
||||||
|
AltOlyPeriodType = MONTH
|
||||||
|
|
||||||
|
# Change the Olympiad frequency.
|
||||||
|
# The value is a multiplier of period type,
|
||||||
|
# i.e. if type is MONTH and multiplier is 2,
|
||||||
|
# then Olympiad will occur every 2 months.
|
||||||
|
# Default: 1
|
||||||
|
# Note! If type = DAY, multiplier must be >= 7!
|
||||||
|
AltOlyPeriodMultiplier = 1
|
||||||
|
@ -542,6 +542,9 @@ public final class Config
|
|||||||
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
||||||
public static int ALT_OLY_ENCHANT_LIMIT;
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
||||||
public static int ALT_OLY_WAIT_TIME;
|
public static int ALT_OLY_WAIT_TIME;
|
||||||
|
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
|
||||||
|
public static String ALT_OLY_PERIOD;
|
||||||
|
public static int ALT_OLY_PERIOD_MULTIPLIER;
|
||||||
public static int ALT_MANOR_REFRESH_TIME;
|
public static int ALT_MANOR_REFRESH_TIME;
|
||||||
public static int ALT_MANOR_REFRESH_MIN;
|
public static int ALT_MANOR_REFRESH_MIN;
|
||||||
public static int ALT_MANOR_APPROVE_TIME;
|
public static int ALT_MANOR_APPROVE_TIME;
|
||||||
@ -2225,6 +2228,9 @@ public final class Config
|
|||||||
}
|
}
|
||||||
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
|
||||||
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60);
|
||||||
|
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false);
|
||||||
|
ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH");
|
||||||
|
ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1);
|
||||||
|
|
||||||
final File hexIdFile = new File(HEXID_FILE);
|
final File hexIdFile = new File(HEXID_FILE);
|
||||||
if (hexIdFile.exists())
|
if (hexIdFile.exists())
|
||||||
|
@ -546,9 +546,10 @@ public class Olympiad extends ListenersContainer
|
|||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.ROUND_S1_OF_THE_OLYMPIAD_GAMES_HAS_STARTED);
|
||||||
sm.addInt(_currentCycle);
|
sm.addInt(_currentCycle);
|
||||||
|
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
|
|
||||||
|
if (!Config.ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS)
|
||||||
|
{
|
||||||
final Calendar currentTime = Calendar.getInstance();
|
final Calendar currentTime = Calendar.getInstance();
|
||||||
currentTime.add(Calendar.MONTH, 1);
|
currentTime.add(Calendar.MONTH, 1);
|
||||||
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
currentTime.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
@ -560,6 +561,65 @@ public class Olympiad extends ListenersContainer
|
|||||||
|
|
||||||
final Calendar nextChange = Calendar.getInstance();
|
final Calendar nextChange = Calendar.getInstance();
|
||||||
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Calendar currentTime = Calendar.getInstance();
|
||||||
|
currentTime.set(Calendar.AM_PM, Calendar.AM);
|
||||||
|
currentTime.set(Calendar.HOUR, 12);
|
||||||
|
currentTime.set(Calendar.MINUTE, 0);
|
||||||
|
currentTime.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
Calendar nextChange = Calendar.getInstance();
|
||||||
|
|
||||||
|
switch (Config.ALT_OLY_PERIOD)
|
||||||
|
{
|
||||||
|
case "DAY":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WEEK":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MONTH":
|
||||||
|
{
|
||||||
|
currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
|
||||||
|
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
|
||||||
|
|
||||||
|
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_olympiadEnd = currentTime.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
scheduleWeeklyChange();
|
scheduleWeeklyChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user