l2topzone.com
l2topzone.com

Author Topic: Individual Vote Reward.  (Read 379 times)

0 Members and 1 Guest are viewing this topic.

Offlinemarciox25

  • Newbie
  • *
  • Posts: 3
  • L2topzone Votes: 3
  • Servers reviews: 0
  • Country: Belgium.
  • Reputation: +0/-0
  • L2topzone.com
    Individual Vote Reward.
    « on: November 20, 2016, 05:26:16 AM »
    l2topzone.com
    Hello, I'm having some problems, or I think Im. Last time when I had the server running, it was working perfectly.
    and on the config it should be like this
    TopzoneUrl = https://l2topzone.com/lineage/server-info/IDSERVER/L2NAMESERVER
    (Name and ID censored soon avaible for public). and now I went and test it again and it simply didnt worked.
    I saw a thing on the my home space, and saw a API related part. Do I need to put the API link in the URL now?

    Any Help? Thank you!
    Code: [Select]
    protected static int getTopZoneVotes()
    {
    int votes = -1;
    URL url = null;
    URLConnection con = null;
    InputStream is = null;
    InputStreamReader isr = null;
    BufferedReader in = null;
    try
    {
    url = new URL(Config.VOTE_LINK_TOPZONE);
    con = url.openConnection();
    con.addRequestProperty("User-Agent", "L2TopZone");
    is = con.getInputStream();
    isr = new InputStreamReader(is);
    in = new BufferedReader(isr);

    String inputLine;
    while ((inputLine = in.readLine()) != null)
    {

    if (inputLine.contains("</span></small>"))
    {
    votes = Integer.valueOf(inputLine.split(">")[9].replace("</span", ""));
    return votes;
    }
    }


    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    return votes;
    }



    Linkback: https://l2topzone.com/forum/l2-server-support-problems/9/individual-vote-reward/26739/
    « Last Edit: November 20, 2016, 05:26:53 AM by marciox25 »

    Onlinexzone

    • Read our rules
    • Administrator
    • Hero Member
    • *****
    • Posts: 607
    • L2topzone Votes: 21
    • Servers reviews: 134
    • Country: Romania.
    • Reputation: +10480/-0
    • Gender: Male
      • l2topzone
    Read our rules

    Offlinemarciox25

    • Newbie
    • *
    • Posts: 3
    • L2topzone Votes: 3
    • Servers reviews: 0
    • Country: Belgium.
    • Reputation: +0/-0
    • L2topzone.com
      Re: Individual Vote Reward.
      « Reply #2 on: November 20, 2016, 08:43:02 AM »
      Hey, thank you for your answer. Ive read them but I havent seen any instructions of how to properly put the API in the code...

      //edit

      Found it , will take a look and if needed will addapt the code, thx
      « Last Edit: November 20, 2016, 08:47:06 AM by marciox25 »


      Share via diggShare via facebookShare via linkedinShare via myspaceShare via redditShare via twitter
       


      Sitemap