Jump to content
  • 0

REQUEST [HELP]


Question

Posted

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;
        }
}

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
Guest
This topic is now closed to further replies.


  • Posts

    • rly swired...leave low npcmakers ,its worked..not crash L2server.exe.   A:I:S:E:PE:DI:DE:BO=1.000000:1.000000:1.000000:1.000000:1.000000:0:0:0 L:Y:X:H=0:0:0:0:0 Crashed Thread[6]. Server Up Time : Wed Oct 15 13:11:08 2025 Current Time : Wed Oct 15 13:13:35 2025 Elapsed Time : 0 days 0 hours 2 minutes 27 seconds IOBufferPool - 39989 / 40000, PendingWrite 0 bytes [0] =============== object report user[0/0], npc[820/0], item[0/0], usersocket[0] =============== npc server connection log Connect : Wed Oct 15 13:13:34 2025 [(16328) 2025/10/15 13:13:35]: ======================= an Access Violation in module L2Server.exe at 0033:00518eef. start at 2025/10/15 13:11:08 Read from location ffffffff caused an access violation. Registers: EAX=0003dc7b CS=0033 EIP=00518eef EFLGS=00010207 EBX=a2228c44 SS=002b ESP=7da7f870 EBP=00000000 ECX=0003dc7b DS=002b ESI=00000000 FS=0053 EDX=00400000 ES=002b EDI=0c200dc0 GS=002b Bytes at CS:EIP: 48 8b 0c f0 80 79 5d 00 74 23 44 39 69 10 7f 1d Stack dump: 7da7f870: a2228c44 00000000 0004c158 00000000 009b2a10 00000000 00400000 00000000 7da7f890: 00000001 00000000 00000000 00000000 fffffffe ffffffff 00000000 40cae180 7da7f8b0: 00000000 40d11740 00000000 c0b1be00 00000000 00000000 00000000 00000000 7da7f8d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7da7f8f0: 3b19e2dc 00000000 0078e4c8 00000000 3b19e2dc 00000000 00400000 00000000 7da7f910: 0004c158 00000000 00000000 00000000 00000000 00000000 006c688a 00000000 7da7f930: a2228c44 00000000 00000000 00000000 00000000 00000000 00a2aa10 00000000 7da7f950: 012e6dc0 00000000 9beaee10 00000000 00000000 00000000 0004c158 00000000 7da7f970: 00000000 00000000 00a12d50 00000000 fffffffe ffffffff 0064dd24 00000000 7da7f990: fffffffe ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 ver = Dec 16 2005_22:03:13 GuardInfo : IOThread [0][63] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [1][63] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [2][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [3][47] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [4][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [5][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [6][78] (ahehe): void IOThread_common(void *arglist) -> void CIOObject::TimerDispatch(bool bRootLoop) -> void CThreadLocalTimer::Dispath -> void CEnterWorldSerializer::TimerExpired(int id) -> void CNPC::EnterWorld(bool bSetDefaultParam, int nHP, int nMP) -> CCreature::EnterWorld Lock Stack : .\NpcSocket.cpp(278[116]) IOThread [7][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) -> void Push(int index, int x, int y, int z, int dir, int nSetDefaultParam, int nHP, int nMP) Lock Stack : .\NpcSocket.cpp(389[185]) ListenThread [13][141] (good): void ListenThread_common() -> unsigned __stdcall WaitThread(void *) Lock Stack : MainThread [12][156] (good): Lock Stack : GuardInfo end [(16328) 2025/10/15 13:13:35]: *.\ioc.cpp:648(Tue Dec 13 02:52:40 2005) exception  
    • We can help your Telegram channel, group, bot, or account appear first in Telegram search.   Our safe Telegram SEO service helps you rank your Telegram channel or bot for any keyword in just 72 hours.   No spam, no fake traffic — only real Telegram keyword ranking using premium user signals and smart optimization.   ✅ What We Offer • Top 1 Telegram Search Ranking Service (Channels · Groups · Bots · Accounts) • Rank Telegram channel, group, or bot safely with real engagement • Appear first in Telegram search for your target keyword • Pay-per-keyword with refund-backed guarantee • Global targeting (USA, EU, India)   🧩 Works Best For • Projects that need to appear first in Telegram search • Brands, crypto/NFT groups, trading or SaaS communities • Bot owners who want ranked visibility for their bot • Channels and groups needing more exposure   💡 Why Choose Us   We use safe Telegram SEO techniques — not spam — to deliver fast, stable Telegram top search results.   Our process helps your project gain organic visibility and steady traffic from real Telegram users.   📩 To Get More Information   Telegram: @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-search-ranking.html
    • leave only Npcpos the gremlins (for testing).
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock