private boolean isVotedInSite(String ip, VoteSite site)
{
try
{
// Make URL with vote site link with player IP address
final URL url = new URL(site.getLink(ip));
// Open connection
final HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
// Set User-Agent
httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36");
// Get response code and if everything is OK try to get answer
final int response = httpURLConnection.getResponseCode();
if (response == HTTP_OK)
{
// Get input stream from vote sites
try (BufferedReader br = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream())))
{
// Get answer from vote site which returns true/false
switch (site)
{
case L2HOPZONE:
return br.readLine().contains("true");
case L2TOPZONE:
return br.readLine().equals("TRUE");
case L2NETWORK:
return br.readLine().equals("1");
case L2TOP:
return br.readLine().equals("TRUE");
case L2BR:
return br.readLine().equals("1"); (if is correct or request correct read)
}
}
}
Thank you! I really missed this option when was exploring bots and their features.
I tried to find L2Net for Interlude, but the official GitHub page has the only H5 compiled version. It doesn't work with my L2J IL. I tried to google a proper version, but nothing worked for me (different errors like DirectX not found etc.)
Do you know where can I get a working version of L2Net IL ?
📢 OBT Success – Get Ready for Launch: November 28!!
The Open Beta was an absolute blast!
Over 160+ Master Accounts successfully claimed their reward from The Judge, proving once again how strong and loyal this community truly is.
🔥 Missed the event?
Don’t worry — because so many players asked for another chance, we will host an additional Event very soon! Stay tuned for details.
Community Growth
We’ve already surpassed 500 Master Accounts registered on our forums — and the numbers keep rising every hour.
It feels like the old days… the same energy, the same hype, the same love for Lineage II.
Let’s rebuild L2Elixir the way we remember it:
No shortcuts, no nonsense — just pure old nostalgic gameplay, community spirit, and that classic adventure we all grew up with.
✨ The journey continues…
Launch: November 28, 21:00 UTC+2
Be there when the legend returns.
🔗 Website: https://l2elixir.org/
💬 Discord: https://discord.gg/5ydPHvhbxs
Question
Crytek ™
private boolean isVotedInSite(String ip, VoteSite site) { try { // Make URL with vote site link with player IP address final URL url = new URL(site.getLink(ip)); // Open connection final HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection(); // Set User-Agent httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36"); // Get response code and if everything is OK try to get answer final int response = httpURLConnection.getResponseCode(); if (response == HTTP_OK) { // Get input stream from vote sites try (BufferedReader br = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()))) { // Get answer from vote site which returns true/false switch (site) { case L2HOPZONE: return br.readLine().contains("true"); case L2TOPZONE: return br.readLine().equals("TRUE"); case L2NETWORK: return br.readLine().equals("1"); case L2TOP: return br.readLine().equals("TRUE"); case L2BR: return br.readLine().equals("1"); (if is correct or request correct read) } } }exampe of check is
https://top.l2jbrasil.com/votesystem/index.php?username=l2br&ip=0.0.0.0
have to get check of status. there is 1 (then player not voted is 0)
<votes><vote>
<site_id>id</site_id>
<ip>xxx.xx.xx.xx</ip>
<date>2017-04-24 19:34:07</date>
<status>1</status>
</vote></votes>
Edited by Crytek3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now