Jump to content
  • 0

AutoVoteReward System


Question

Posted (edited)

Hello all MxC Member, i start to develop my old pack (base l2jfrozen) and i update my autovotereward system. Hopzone and Topzone works perfect but L2Network no

 

I have a problem on a vote count server starts without error announce says "L2Network vote count 0" for some reason no error.

 

Here is the getvote method:

  Quote

    /**


     * Get the votes of NETWORK
     * @return
     */
    public static int getVotesNetwork()
    {
        try
        {
            URLConnection con = new URL(Config.VOTE_MANAGER_L2NETWORK_LINK).openConnection();
            
            con.addRequestProperty("User-Agent", USER_AGENT);
            con.setConnectTimeout(5000);
            
            try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())))
            {
                String inputLine;
                while ((inputLine = in.readLine()) != null)
                {
                    if (inputLine.contains("tls-in-sts"))
                    {
                        return Integer.valueOf(inputLine.split(">")[2].replace("</b", ""));
                    }
                }
            }
        }
        catch (Exception e)
        {
            LOGGER.warn("Error while getting Network server vote count.");
            // e.printStackTrace();
        }
        
        return 0;
    }

Expand  
Edited by xSlark

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
  On 1/21/2020 at 2:09 PM, xSlark said:

Hello all MxC Member, i start to develop my old pack (base l2jfrozen) and i update my autovotereward system. Hopzone and Topzone works perfect but L2Network no

 

I have a problem on a vote count server starts without error announce says "L2Network vote count 0" for some reason no error.

 

Here is the getvote method:

Expand  

Hello @xSlark you have to update this part of the code.

                    if (inputLine.contains("tls-in-sts"))
                    {
                        return Integer.valueOf(inputLine.split(">")[2].replace("</b", ""));
                    }


However, if i remember correctly, L2Network have an API that you can use to make your own Vote System. I highly recommend rewrite this code in order to use that API.

Edited by Reynald0
Guest
This topic is now closed to further replies.


  • Posts

    • We are taking new orders. DM us on Telegram! We are taking new orders. DM us on Telegram!
    • Hello guys.Im looking for a simple autoclicker that works for servers with anticheat
    • Thank you for the reply. I know that this issue is due to L2 being so old. I was just wondering if there was an external way to fix the UI scaling. Like a patch or some settings.
    • Bro the game is so old it doesn't have a native option to scale the UI like in modern MMOs
    • Dear players, From April 19 to April 27 inc., the Bonus Start event will be active. It’s designed to help new and low-level characters get started more easily.   All characters that meet one of the following conditions: — created less than 3 days ago (regardless of level), — currently level 20 or below, — created during the event period, will receive upon login: — 10 sets of buff scrolls (phys or mage, depending on class), — 10 packs of +50% Drop/Spoil runes (2 hours each), — 10 packs of +50% Exp runes (2 hours each). Characters between level 21 and 30 will receive upon login: — 6 sets of buff scrolls, — 6 packs of +50% Drop/Spoil runes (2h each), — 6 packs of +50% Exp runes (2h each).   Event items will be removed approx. 09.05.2025 Server rates will be increased to x2.25. Take this chance to start your journey with ease or bring an old hero back into the fight — it’s the perfect time to test your strength! Open Beta Test is started!  Helper cats are waiting in towns — talk to them to receive the necessary equipment and level up your character. Siege Schedule:  - April 13 at 16:00 (GMT+2) – Innadrile Castle - April 14 at 20:00 (GMT+2) – Bandit Stronghold - April 15 at 20:00 (GMT+2) – Devastated Castle 📌 During the OBT, players who report bugs will receive CoL:   - 1 CoL for each reported staticmeshes bug (e.g., walking through textures, stairs, etc.) - 2 CoL or more for server-related issues (depending on severity) You can report bugs on the forum. The Open Beta Test will run approximately until April 15 at 23:00 (GMT+2). Your activity and feedback will help us improve the game.   Download links: Download client | Download updater 
  • Topics

×
×
  • Create New...