Jump to content
  • 0

REQUEST [HELP]


PrO_jeCt

Question

Xerete! 

 oi efialtes pou vlepoume merikes fores!!!

http://prntscr.com/hl3uol

http://prntscr.com/hl3vm2

http://prntscr.com/hl3vqw

 

 

 

/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.communitybbs.tasks;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.ThreadPoolManager;

public class PlayerStatsUpdateTask
  {
       static Logger _log = Logger.getLogger(PlayerStatsUpdateTask.class.getName());
       private static StringBuilder _pvpList = new StringBuilder();
       private static StringBuilder _pkList = new StringBuilder();
       private static StringBuilder _raidList = new StringBuilder();
       private static StringBuilder _adenaList = new StringBuilder();      
       private static StringBuilder _onlineList = new StringBuilder();
       private static String _lastUpdate = "error";
       Connection con = L2DatabaseFactory.getInstance().getConnection();      
      
       public static void updateTask()
       {
               _log.log(Level.INFO, "[CommunityBoard]: Started player stats update task!");
              
               ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
           {
                       @Override
                       public void run()
                   {
                       PlayerStatsUpdateTask.cleanUpTask();
                       PlayerStatsUpdateTask.updatePvPList();
                       PlayerStatsUpdateTask.updatePkList();
                       PlayerStatsUpdateTask.updateRaidList();
                       PlayerStatsUpdateTask.updateAdenaList();
                       PlayerStatsUpdateTask.updateOnlineList();
                      
                       Date date = new Date();
                       PlayerStatsUpdateTask.lastUpdate(date.toString());                             
                   }
           }, 1000L, 600000L);
       }
      
       static void cleanUpTask()
       {
               _pvpList.delete(0, _pvpList.length());
           _pkList.delete(0, _pkList.length());
           _raidList.delete(0, _raidList.length());
           _adenaList.delete(0, _adenaList.length());
           _onlineList.delete(0, _onlineList.length());               
       }
      
        static void updatePvPList()
        {
                try
                {
                        Connection con = L2DatabaseFactory.getInstance().getConnection();Throwable localThrowable3 = null;
                    try
                    {
                        int pos = 0;
                        
                        PreparedStatement statement = con.prepareStatement("SELECT SUM(chr.points), SUM(it.count), ch.char_name, ch.pkkills, ch.pvpkills, ch.onlinetime, ch.base_class, ch.online FROM characters ch LEFT JOIN character_raid_points chr ON ch.obj_Id=chr.char_id LEFT OUTER JOIN items it ON ch.obj_Id=it.owner_id WHERE item_id=57 GROUP BY ch.obj_Id ORDER BY pvpkills DESC LIMIT " + Config.TOP_PLAYER_RESULTS);
                        ResultSet result = statement.executeQuery();
                        while (result.next()) 
                        {
                                pos++;
                                boolean status = false;
                                if (result.getInt("online") == 1)
                                {
                                        status = true;
                                }
                            String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
                            String adenas = getAdenas(result.getInt("SUM(it.count)"));                          

                            _pvpList.append("<table border=0 cellspacing=0 cellpadding=2 height=" + Config.TOP_PLAYER_ROW_HEIGHT + " width=610><tr><td FIXWIDTH=5></td>");
                            _pvpList.append("<td FIXWIDTH=25>" + pos + "</td>");
                            _pvpList.append("<td FIXWIDTH=180>" + result.getString("ch.char_name") + "</td>");
                            _pvpList.append("<td FIXWIDTH=175>" + className(result.getInt("base_class")) + "</td>");
                            _pvpList.append("<td FIXWIDTH=60>" + result.getInt("ch.pvpkills") + "</td>");
                            _pvpList.append("<td FIXWIDTH=60>" + result.getInt("ch.pkkills") + "</td>");
                            _pvpList.append("<td FIXWIDTH=70>" + result.getInt("SUM(chr.points)") + "</td>");
                            _pvpList.append("<td FIXWIDTH=140>" + adenas + "</td>");
                            _pvpList.append("<td FIXWIDTH=150>" + timeon + "</td>");
                            _pvpList.append("<td FIXWIDTH=65>" + (status ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>") + "</td>");
                            _pvpList.append("</tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");                       
                        }
                        result.close();
                        statement.close();
                    }
                    catch (Throwable localThrowable1)
                    {
                        localThrowable3 = localThrowable1;throw localThrowable1;
                    }
                    finally
                    {
                        if (con != null)
                        {
                                if (localThrowable3 != null)
                                {
                                        try
                                        {
                                                con.close();
                                        }
                                        catch (Throwable localThrowable2)
                                        {
                                                localThrowable3.addSuppressed(localThrowable2);
                                        }
                                }
                                else
                                {
                                        con.close();
                                }
                        }
                    }
                }
                catch (Exception e)
                {
                        _log.log(Level.WARNING, "Failed to update pvp list!");
                        e.printStackTrace();
                }
        }
        
        static void updatePkList()
        {
                try
                {
                        Connection con = L2DatabaseFactory.getInstance().getConnection();Throwable localThrowable3 = null;
                        try
                        {
                                int pos = 0;
                                
                                PreparedStatement statement = con.prepareStatement("SELECT SUM(chr.points), SUM(it.count), ch.char_name, ch.pkkills, ch.pvpkills, ch.onlinetime, ch.base_class, ch.online FROM characters ch LEFT JOIN character_raid_points chr ON ch.obj_Id=chr.char_id LEFT OUTER JOIN items it ON ch.obj_Id=it.owner_id WHERE item_id=57 GROUP BY ch.obj_Id ORDER BY pkkills DESC LIMIT " + Config.TOP_PLAYER_RESULTS);
                            ResultSet result = statement.executeQuery();
                            while (result.next())
                            {
                                pos++;
                                boolean status = false;
                                if (result.getInt("online") == 1)
                                {
                                        status = true;
                                }
                                String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
                                String adenas = getAdenas(result.getInt("SUM(it.count)"));
                                
                                _pkList.append("<table border=0 cellspacing=0 cellpadding=2 height=" + Config.TOP_PLAYER_ROW_HEIGHT + " width=610><tr><td FIXWIDTH=5></td>");
                                _pkList.append("<td FIXWIDTH=25>" + pos + "</td>");
                                _pkList.append("<td FIXWIDTH=180>" + result.getString("ch.char_name") + "</td>");
                                _pkList.append("<td FIXWIDTH=175>" + className(result.getInt("base_class")) + "</td>");
                                _pkList.append("<td FIXWIDTH=60>" + result.getInt("ch.pvpkills") + "</td>");
                                _pkList.append("<td FIXWIDTH=60>" + result.getInt("ch.pkkills") + "</td>");
                                _pkList.append("<td FIXWIDTH=70>" + result.getInt("SUM(chr.points)") + "</td>");
                                _pkList.append("<td FIXWIDTH=140>" + adenas + "</td>");
                                _pkList.append("<td FIXWIDTH=150>" + timeon + "</td>");
                                _pkList.append("<td FIXWIDTH=65>" + (status ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>") + "</td>");
                                _pkList.append("</tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");                                
                            }
                            result.close();
                            statement.close();
                        }
                        catch (Throwable localThrowable1)
                        {
                                localThrowable3 = localThrowable1;throw localThrowable1;
                        }
                        finally
                        {
                                if (con != null)
                                {
                                        if (localThrowable3 != null)
                                        {
                                                try
                                                {
                                                        con.close();
                                                }
                                                catch (Throwable localThrowable2)
                                                {
                                                        localThrowable3.addSuppressed(localThrowable2);
                                                }
                                        }
                                        else
                                        {
                                                con.close();
                                        }
                                }
                        }
                }
                catch (Exception e)
                {
                        _log.log(Level.WARNING, "Failed to update pk list!");
                        e.printStackTrace();
                }
        }
        
        static void updateRaidList()
        {
                try
                {
                        Connection con = L2DatabaseFactory.getInstance().getConnection();Throwable localThrowable3 = null;
                        try
                        {
                                int pos = 0;
                                        
                                PreparedStatement statement = con.prepareStatement("SELECT SUM(chr.points), SUM(it.count), ch.char_name, ch.pkkills, ch.pvpkills, ch.onlinetime, ch.base_class, ch.online FROM characters ch LEFT JOIN character_raid_points chr ON ch.obj_Id=chr.char_id LEFT OUTER JOIN items it ON ch.obj_Id=it.owner_id WHERE item_id=57 GROUP BY ch.obj_Id ORDER BY SUM(chr.points) DESC LIMIT " + Config.TOP_PLAYER_RESULTS);
                                ResultSet result = statement.executeQuery();
                                while (result.next())
                                {
                                        pos++;
                                    boolean status = false;
                                    if (result.getInt("online") == 1)
                                    {
                                        status = true;
                                    }
                                    String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
                                    String adenas = getAdenas(result.getInt("SUM(it.count)"));
                                        
                                    _raidList.append("<table border=0 cellspacing=0 cellpadding=2 height=" + Config.TOP_PLAYER_ROW_HEIGHT + " width=610><tr><td FIXWIDTH=5></td>");
                                    _raidList.append("<td FIXWIDTH=25>" + pos + "</td>");
                                    _raidList.append("<td FIXWIDTH=180>" + result.getString("ch.char_name") + "</td>");
                                    _raidList.append("<td FIXWIDTH=175>" + className(result.getInt("base_class")) + "</td>");
                                    _raidList.append("<td FIXWIDTH=60>" + result.getInt("ch.pvpkills") + "</td>");
                                    _raidList.append("<td FIXWIDTH=60>" + result.getInt("ch.pkkills") + "</td>");
                                    _raidList.append("<td FIXWIDTH=70>" + result.getInt("SUM(chr.points)") + "</td>");
                                    _raidList.append("<td FIXWIDTH=140>" + adenas + "</td>");
                                    _raidList.append("<td FIXWIDTH=150>" + timeon + "</td>");
                                    _raidList.append("<td FIXWIDTH=65>" + (status ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>") + "</td>");
                                    _raidList.append("</tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");
                                }
                                result.close();
                                statement.close();
                        }
                        catch (Throwable localThrowable1)
                        {
                                localThrowable3 = localThrowable1;throw localThrowable1;
                        }
                        finally
                        {
                                if (con != null)
                                {
                                        if (localThrowable3 != null)
                                        {
                                                try
                                                {
                                                        con.close();
                                                }
                                                catch (Throwable localThrowable2)
                                            {
                                                        localThrowable3.addSuppressed(localThrowable2);
                                            }
                                        }
                                        else
                                        {
                                                con.close();
                                        }
                                }
                        }
                }
                catch (Exception e)
                {
                        _log.log(Level.WARNING, "Failed to update raid list!");
                        e.printStackTrace();
                }
        }
        
        static void updateAdenaList()
        {
                try
                {
                        Connection con = L2DatabaseFactory.getInstance().getConnection();Throwable localThrowable3 = null;
                        try
                        {
                                int pos = 0;
                                
                            PreparedStatement statement = con.prepareStatement("SELECT SUM(chr.points), SUM(it.count), ch.char_name, ch.pkkills, ch.pvpkills, ch.onlinetime, ch.base_class, ch.online FROM characters ch LEFT JOIN character_raid_points chr ON ch.obj_Id=chr.char_id LEFT OUTER JOIN items it ON ch.obj_Id=it.owner_id WHERE item_id=57 GROUP BY ch.obj_Id ORDER BY SUM(it.count) DESC LIMIT " + Config.TOP_PLAYER_RESULTS);
                            ResultSet result = statement.executeQuery();
                            while (result.next())
                            {
                                pos++;
                                boolean status = false;
                                if (result.getInt("online") == 1)
                                {
                                        status = true;
                                }
                                String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
                                String adenas = getAdenas(result.getInt("SUM(it.count)"));
                                
                                _adenaList.append("<table border=0 cellspacing=0 cellpadding=2 height=" + Config.TOP_PLAYER_ROW_HEIGHT + " width=610><tr><td FIXWIDTH=5></td>");
                                _adenaList.append("<td FIXWIDTH=25>" + pos + "</td>");
                                _adenaList.append("<td FIXWIDTH=180>" + result.getString("ch.char_name") + "</td>");
                                _adenaList.append("<td FIXWIDTH=175>" + className(result.getInt("base_class")) + "</td>");
                                _adenaList.append("<td FIXWIDTH=60>" + result.getInt("ch.pvpkills") + "</td>");
                                _adenaList.append("<td FIXWIDTH=60>" + result.getInt("ch.pkkills") + "</td>");
                                _adenaList.append("<td FIXWIDTH=70>" + result.getInt("SUM(chr.points)") + "</td>");
                                _adenaList.append("<td FIXWIDTH=140>" + adenas + "</td>");
                                _adenaList.append("<td FIXWIDTH=150>" + timeon + "</td>");
                                _adenaList.append("<td FIXWIDTH=65>" + (status ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>") + "</td>");
                                _adenaList.append("</tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");                                                                                             
                            }
                            result.close();
                            statement.close();
                        }
                        catch (Throwable localThrowable1)
                        {
                                localThrowable3 = localThrowable1;throw localThrowable1;
                        }
                        finally
                        {
                                if (con != null)
                                {
                                        if (localThrowable3 != null)
                                        {
                                                try
                                                {
                                                        con.close();
                                                }
                                                catch (Throwable localThrowable2)
                                                {
                                                        localThrowable3.addSuppressed(localThrowable2);
                                                }
                                        }
                                        else
                                        {
                                                con.close();
                                        }
                                }
                        }
                }
                catch (Exception e)
                {
                        _log.log(Level.WARNING, "Failed to update adena list!");
                        e.printStackTrace();
                }
        }
        
        static void updateOnlineList()
        {
                try
                {
                        Connection con = L2DatabaseFactory.getInstance().getConnection();Throwable localThrowable3 = null;
                        try
                        {
                                int pos = 0;
                            PreparedStatement statement = con.prepareStatement("SELECT SUM(chr.points), SUM(it.count), ch.char_name, ch.pkkills, ch.pvpkills, ch.onlinetime, ch.base_class, ch.online FROM characters ch LEFT JOIN character_raid_points chr ON ch.obj_Id=chr.char_id LEFT OUTER JOIN items it ON ch.obj_Id=it.owner_id WHERE item_id=57 GROUP BY ch.obj_Id ORDER BY onlinetime DESC LIMIT " + Config.TOP_PLAYER_RESULTS);
                            ResultSet result = statement.executeQuery();
                            while (result.next())     
                            {
                                pos++;
                                boolean status = false;
                                if (result.getInt("online") == 1)
                                {
                                        status = true;
                                }
                                String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
                                String adenas = getAdenas(result.getInt("SUM(it.count)"));
                                
                                _onlineList.append("<table border=0 cellspacing=0 cellpadding=2 height=" + Config.TOP_PLAYER_ROW_HEIGHT + " width=610><tr><td FIXWIDTH=5></td>");
                                _onlineList.append("<td FIXWIDTH=25>" + pos + "</td>");
                                _onlineList.append("<td FIXWIDTH=180>" + result.getString("ch.char_name") + "</td>");
                                _onlineList.append("<td FIXWIDTH=175>" + className(result.getInt("base_class")) + "</td>");
                                _onlineList.append("<td FIXWIDTH=60>" + result.getInt("ch.pvpkills") + "</td>");
                                _onlineList.append("<td FIXWIDTH=60>" + result.getInt("ch.pkkills") + "</td>");
                                _onlineList.append("<td FIXWIDTH=70>" + result.getInt("SUM(chr.points)") + "</td>");
                                _onlineList.append("<td FIXWIDTH=140>" + adenas + "</td>");
                                _onlineList.append("<td FIXWIDTH=150>" + timeon + "</td>");
                                _onlineList.append("<td FIXWIDTH=65>" + (status ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>") + "</td>");
                                _onlineList.append("</tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");                            
                            }
                            result.close();
                            statement.close();
                        }
                        catch (Throwable localThrowable1)
                        {
                                localThrowable3 = localThrowable1;throw localThrowable1;
                        }
                        finally
                        {
                                if (con != null)
                                {
                                        if (localThrowable3 != null)
                                        {
                                                try
                                                {
                                                        con.close();
                                                }
                                                catch (Throwable localThrowable2)
                                                {
                                                        localThrowable3.addSuppressed(localThrowable2);
                                                }
                                        }
                                        else
                                        {
                                                con.close();
                                        }
                                }
                        }
                }
                catch (Exception e)
                {
                        _log.log(Level.WARNING, "Failed to update online time list!");
                    e.printStackTrace();
                }
        }
        
        public static String pvpList()
        {
                return _pvpList.toString();
        }
        
        public static String pkList()
        {
            return _pkList.toString();
        }
        
        public static String raidList()
        {
            return _raidList.toString();
        }
        
        public static String adenaList()
        {
            return _adenaList.toString();
        }
        
        public static String onlineList()
        {
            return _onlineList.toString();
        }
        
        static void lastUpdate(String format)
        {
            _lastUpdate = format;
        }
        
        public static String getLastUpdate()
        {
            return _lastUpdate;
        }       
        
        public static final String className(int classid)
        {
                Map<Integer, String> classList = new HashMap<>();
                
                classList.put(Integer.valueOf(0), "Fighter");
            classList.put(Integer.valueOf(1), "Warrior");
                classList.put(Integer.valueOf(2), "Gladiator");
                classList.put(Integer.valueOf(3), "Warlord");
                classList.put(Integer.valueOf(4), "Knight");
                classList.put(Integer.valueOf(5), "Paladin");
                classList.put(Integer.valueOf(6), "Dark Avenger");
                classList.put(Integer.valueOf(7), "Rogue");
                classList.put(Integer.valueOf(8), "Treasure Hunter");
            classList.put(Integer.valueOf(9), "Hawkeye");
                classList.put(Integer.valueOf(10), "Mage");
                classList.put(Integer.valueOf(11), "Wizard");
                classList.put(Integer.valueOf(12), "Sorcerer");
                classList.put(Integer.valueOf(13), "Necromancer");
                classList.put(Integer.valueOf(14), "Warlock");
                classList.put(Integer.valueOf(15), "Cleric");
                classList.put(Integer.valueOf(16), "Bishop");
                classList.put(Integer.valueOf(17), "Prophet");
                classList.put(Integer.valueOf(18), "Elven Fighter");
                classList.put(Integer.valueOf(19), "Elven Knight");
                classList.put(Integer.valueOf(20), "Temple Knight");
                classList.put(Integer.valueOf(21), "Swordsinger");
                classList.put(Integer.valueOf(22), "Elven Scout");
                classList.put(Integer.valueOf(23), "Plains Walker");
                classList.put(Integer.valueOf(24), "Silver Ranger");
                classList.put(Integer.valueOf(25), "Elven Mage");
                classList.put(Integer.valueOf(26), "Elven Wizard");
                classList.put(Integer.valueOf(27), "Spellsinger");
                classList.put(Integer.valueOf(28), "Elemental Summoner");
                classList.put(Integer.valueOf(29), "Oracle");
                classList.put(Integer.valueOf(30), "Elder");
                classList.put(Integer.valueOf(31), "Dark Fighter");
                classList.put(Integer.valueOf(32), "Palus Knightr");
                classList.put(Integer.valueOf(33), "Shillien Knight");
                classList.put(Integer.valueOf(34), "Bladedancer");
                classList.put(Integer.valueOf(35), "Assasin");
                classList.put(Integer.valueOf(36), "Abyss Walker");
                classList.put(Integer.valueOf(37), "Phantom Ranger");
                classList.put(Integer.valueOf(38), "Dark Mage");
                classList.put(Integer.valueOf(39), "Dark Wizard");
                classList.put(Integer.valueOf(40), "Spellhowler");
                classList.put(Integer.valueOf(41), "Phantom Summoner");
                classList.put(Integer.valueOf(42), "Shillien Oracle");
                classList.put(Integer.valueOf(43), "Shilien Elder");
                classList.put(Integer.valueOf(44), "Orc Fighter");
                classList.put(Integer.valueOf(45), "Orc Raider");
                classList.put(Integer.valueOf(46), "Destroyer");
                classList.put(Integer.valueOf(47), "Orc Monk");
                classList.put(Integer.valueOf(48), "Tyrant");
                classList.put(Integer.valueOf(49), "Orc Mage");
                classList.put(Integer.valueOf(50), "Orc Shaman");
                classList.put(Integer.valueOf(51), "Overlord");
                classList.put(Integer.valueOf(52), "Warcryer");
                classList.put(Integer.valueOf(53), "Dwarven Fighter");
                classList.put(Integer.valueOf(54), "Scavenger");
                classList.put(Integer.valueOf(55), "Bounty Hunter");
                classList.put(Integer.valueOf(56), "Artisan");
                classList.put(Integer.valueOf(57), "Warsmith");
                classList.put(Integer.valueOf(88), "Duelist");
                classList.put(Integer.valueOf(89), "Dreadnought");
                classList.put(Integer.valueOf(90), "Phoenix Knight");
                classList.put(Integer.valueOf(91), "Hell Knight");
                classList.put(Integer.valueOf(92), "Sagittarius");
                classList.put(Integer.valueOf(93), "Adventurer");
                classList.put(Integer.valueOf(94), "Archmage");
                classList.put(Integer.valueOf(95), "Soultaker");
                classList.put(Integer.valueOf(96), "Arcana Lord");
                classList.put(Integer.valueOf(97), "Cardinal");
                classList.put(Integer.valueOf(98), "Hierophant");
                classList.put(Integer.valueOf(99), "Evas Templar");
                classList.put(Integer.valueOf(100), "Sword Muse");
                classList.put(Integer.valueOf(101), "Wind Rider");
                classList.put(Integer.valueOf(102), "Moonlight Sentinel");
                classList.put(Integer.valueOf(103), "Mystic Muse");
                classList.put(Integer.valueOf(104), "Elemental Master");
                classList.put(Integer.valueOf(105), "Evas Saint");
                classList.put(Integer.valueOf(106), "Shillien Templar");
                classList.put(Integer.valueOf(107), "Spectral Dancer");
                classList.put(Integer.valueOf(108), "Ghost Hunter");
                classList.put(Integer.valueOf(109), "Ghost Sentinel");
                classList.put(Integer.valueOf(110), "Storm Screamer");
                classList.put(Integer.valueOf(111), "Spectral Master");
                classList.put(Integer.valueOf(112), "Shillien Saint");
                classList.put(Integer.valueOf(113), "Titan");
                classList.put(Integer.valueOf(114), "Grand Khavatari");
                classList.put(Integer.valueOf(115), "Dominator");
                classList.put(Integer.valueOf(116), "Doomcryer");
                classList.put(Integer.valueOf(117), "Fortune Seeker");
                classList.put(Integer.valueOf(118), "Maestro");
                  
                return classList.get(Integer.valueOf(classid));                 
        }
        
        static String getPlayerRunTime(int secs)
        {
                String timeResult = "";
                if (secs >= 86400)
                {
                        timeResult = Integer.toString(secs / 86400) + " Days " + Integer.toString(secs % 86400 / 3600) + " hours";
                }
                else
                {
                        timeResult = Integer.toString(secs / 3600) + " Hours " + Integer.toString(secs % 3600 / 60) + " mins";
                }
                return timeResult;
        }
        
        static String getAdenas(int adena)
        {
                String adenas = "";
                if (adena >= 1000000000)
                {
                        adenas = Integer.toString(adena / 1000000000) + " Billion " + Integer.toString(adena % 1000000000 / 1000000) + " million";
                }
                else
                {
                        adenas = Integer.toString(adena / 1000000) + " Million " + Integer.toString(adena % 1000000 / 1000) + " k";
                }
                return adenas;
        }
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
try to change
String timeon = getPlayerRunTime(result.getInt("ch.onlinetime"));
String adenas = getAdenas(result.getInt("SUM(it.count)")); 

to

String timeon = getPlayerRunTime(result.getLong("ch.onlinetime"));
String adenas = getAdenas(result.getLong("SUM(it.count)")); 

you also need to change

static String getPlayerRunTime

and

static String getAdenas

to long

 

Edited by Zacapa
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • +256754809279  VOODOO REVENGE SPELLS TO PUNISH SOMEONE/DEATH SPELLS CASTER THAT WORK OVERNIGHT IN Jamaica Sweden Australia UK USA JORDAN +256754809279 drmama Tango, Powerful instant death spells online instant spell that work fast in USA, UK, Kuwait, Germany, Asian, Europe, Philippines, Canada, South Africa, Italy, Peru, India, Iran, Gambia. Sweden, Australia, Nigeria, Spain, Ghana, California, Greece. Death spell on someone, death spells that Death Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex-lover, Revenge instant death spells on toxic uncles powerful instant death spells online instant spell that work fast in USA, UK, Kuwait, Germany, Asian, Europe, Philippines, Canada, revenge spells, most powerful death spell, spell to die in your sleep, successful death spell, most powerful voodoo spell caster, voodoo spell casters in new Orleans, voodoo love spells reviews, proven authentic voodoo spell casters, most powerful voodoo priest in world, black magic tricks to destroy enemy. Results are 100% sure and guaranteed , Europe, Philippines, Canada, South Africa, Italy, Peru, India, Iran, Gambia. spells, guaranteed voodoo spells, spell to make someone sick and die, revenge spells that work instantly, real witches for hire, revenge spells on an ex- lover, how to put a spell on someone who hurts you, spell to make someone sick, voodoo spells to hurt someone, spells to curse someone, powerful revenge spells, most powerful death spell, spell to die in your sleep, successful death spell. +256754809279 drmama Tango Email: drmamatango@gmail.com
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don't be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don't waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME  Don't wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don't think legitimate. Your lover has gone with someone else Don't hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only. STOP A DIVORCE NOW  Order this service now to reinforce the bonds of your relationship and save your marriage. This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. FAITHFULNESS  Your partner cheats on you? This love ritual is definitely the one you need!  LOVE CHARMS   
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don't be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don't waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME  Don't wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don't think legitimate. Your lover has gone with someone else Don't hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only. STOP A DIVORCE NOW  Order this service now to reinforce the bonds of your relationship and save your marriage. This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. FAITHFULNESS  Your partner cheats on you? This love ritual is definitely the one you need!  LOVE CHARMS   
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don't be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don't waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME  Don't wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don't think legitimate. Your lover has gone with someone else Don't hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only. STOP A DIVORCE NOW  Order this service now to reinforce the bonds of your relationship and save your marriage. This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. FAITHFULNESS  Your partner cheats on you? This love ritual is definitely the one you need!  LOVE CHARMS   
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don't be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don't waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME  Don't wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don't think legitimate. Your lover has gone with someone else Don't hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only. STOP A DIVORCE NOW  Order this service now to reinforce the bonds of your relationship and save your marriage. This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. FAITHFULNESS  Your partner cheats on you? This love ritual is definitely the one you need!  LOVE CHARMS   
  • Topics

×
×
  • Create New...