diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/VoteReward.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/VoteReward.ini index 383595806f..7320bfd16a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/VoteReward.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/VoteReward.ini @@ -73,3 +73,23 @@ L2topDualboxesAllowed = 1 # If set to true, game server console will get a report of # current vote count, votes needed for next reward and votes needed for first page. AllowL2topGameServerReport = False + +# Vote reward for L2JBrasil. +AllowL2JBrasilVoteReward = False +# Vote reward server link. +# Example: https://top.l2jbrasil.com/index.php?a=stats&u=l2monkey +L2JBrasilServerLink = +# Votes for next reward needed. +L2JBrasilVotesDifference = 1 +# Minutes between rewards. +# Eg. You put 5 it checks every 5 minutes for reward. +L2JBrasilRewardCheckTime = 1 +# Reward(s). +L2JBrasilReward = 30002,5; +# Topzone reward max dual boxes reward. +# For example if you put 2 and someone has 3 boxes open 2 will be rewarded. +L2JBrasilDualboxesAllowed = 1 +# Game server console report. +# If set to true, game server console will get a report of +# current vote count, votes needed for next reward and votes needed for first page. +AllowL2JBrasilGameServerReport = True diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index 24a539ce26..7ec273a14b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -1308,6 +1308,13 @@ public class Config public static Map L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3491,6 +3498,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3508,6 +3515,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3530,6 +3537,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3505,6 +3512,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3505,6 +3512,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3505,6 +3512,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3548,6 +3555,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3570,6 +3577,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3297,6 +3304,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3304,6 +3311,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3377,6 +3384,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3383,6 +3390,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3383,6 +3390,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3384,6 +3391,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3393,6 +3400,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3410,6 +3417,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("
L2TOP_REWARD = new HashMap<>(); public static int L2TOP_DUALBOXES_ALLOWED; public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT; + public static boolean ALLOW_L2JBRASIL_VOTE_REWARD; + public static String L2JBRASIL_SERVER_LINK; + public static int L2JBRASIL_VOTES_DIFFERENCE; + public static int L2JBRASIL_REWARD_CHECK_TIME; + public static Map L2JBRASIL_REWARD = new HashMap<>(); + public static int L2JBRASIL_DUALBOXES_ALLOWED; + public static boolean ALLOW_L2JBRASIL_GAME_SERVER_REPORT; /** * This class initializes all global variables for configuration.
@@ -3409,6 +3416,19 @@ public class Config } L2TOP_DUALBOXES_ALLOWED = VoteReward.getInt("L2topDualboxesAllowed", 1); ALLOW_L2TOP_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2topGameServerReport", false); + ALLOW_L2JBRASIL_VOTE_REWARD = VoteReward.getBoolean("AllowL2JBrasilVoteReward", false); + L2JBRASIL_SERVER_LINK = VoteReward.getString("L2JBrasilServerLink", ""); + L2JBRASIL_VOTES_DIFFERENCE = VoteReward.getInt("L2JBrasilVotesDifference", 5); + L2JBRASIL_REWARD_CHECK_TIME = VoteReward.getInt("L2JBrasilRewardCheckTime", 5); + String L2JBRASIL_SMALL_REWARD_VALUE = VoteReward.getString("L2JBrasilReward", "57,100000000;"); + String[] l2jbrasil_small_reward_splitted_1 = L2JBRASIL_SMALL_REWARD_VALUE.split(";"); + for (String i : l2jbrasil_small_reward_splitted_1) + { + String[] l2jbrasil_small_reward_splitted_2 = i.split(","); + HOPZONE_REWARD.put(Integer.parseInt(l2jbrasil_small_reward_splitted_2[0]), Integer.parseInt(l2jbrasil_small_reward_splitted_2[1])); + } + L2JBRASIL_DUALBOXES_ALLOWED = VoteReward.getInt("L2JBrasilDualboxesAllowed", 1); + ALLOW_L2JBRASIL_GAME_SERVER_REPORT = VoteReward.getBoolean("AllowL2JBrasilGameServerReport", false); // Load WalkerBotProtection config file (if exists) final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java new file mode 100644 index 0000000000..1a64db8bf3 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/votereward/L2jbrasil.java @@ -0,0 +1,84 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package org.l2jmobius.gameserver.model.votereward; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +import org.l2jmobius.Config; + +/** + * @author Anarchy + */ +public class L2jbrasil extends VoteSystem +{ + public L2jbrasil(int votesDiff, boolean allowReport, int boxes, Map rewards, int checkMins) + { + super(votesDiff, allowReport, boxes, rewards, checkMins); + } + + @Override + public void run() + { + reward(); + } + + @Override + public int getVotes() + { + InputStreamReader isr = null; + BufferedReader br = null; + + try + { + URLConnection con = new URL(Config.L2JBRASIL_SERVER_LINK).openConnection(); + con.addRequestProperty("User-Agent", "Mozilla/5.0"); + isr = new InputStreamReader(con.getInputStream()); + br = new BufferedReader(isr); + + String line; + while ((line = br.readLine()) != null) + { + if (line.contains("Entradas(Total):")[2].replace("