Jump to content

Recommended Posts

Posted
Index: /Trunk/L2_GameServer/java/net/sf/l2j/Config.java

===================================================================

--- /Trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 144)

+++ /Trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 147)

@@ -760,4 +760,5 @@

        public static int ADD_EXP;

    public static int ADD_SP;

+    public static boolean PETICION_LOGGING;

       

        //--------------------------------------------------

@@ -1507,4 +1508,5 @@

                                        ADD_EXP = Integer.parseInt(altsettingsSettings.getProperty("AddExpAtPvp", "0"));

                                        ADD_SP = Integer.parseInt(altsettingsSettings.getProperty("AddSpAtPvp", "0"));

+                                      PETICION_LOGGING = Boolean.parseBoolean(altsettingsSettings.getProperty("EnablePeticionLogging", "False"));

                                }

                                catch (Exception e)

Index: /Trunk/L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/PetitionManager.java

===================================================================

--- /Trunk/L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/PetitionManager.java (revision 124)

+++ /Trunk/L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/PetitionManager.java (revision 147)

@@ -15,8 +15,12 @@

package net.sf.l2j.gameserver.instancemanager;

 

+import java.io.File;

+import java.io.FileWriter;

+import java.io.IOException;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.List;

import java.util.Map;

+import java.util.logging.Level;

import java.util.logging.Logger;

 

@@ -606,3 +610,46 @@

                activeChar.sendPacket(htmlMsg);

        }

+     

+      public static synchronized void logResult(String petitioner, String responder, long submitTime, long endTime, String content)

+                      {

+                              if (!Config.PETICION_LOGGING) return;

+                             

+                              SimpleDateFormat formatter;

+                              formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");

+                              String date = formatter.format(new Date());

+                              FileWriter save = null;

+                              try

+                              {

+                                      File file = new File("log/peticion.csv");

+                                     

+                                      boolean writeHead = false;

+                                      if (!file.exists())

+                                              writeHead = true;

+                                     

+                                      save = new FileWriter(file, true);

+                     

+                                      if (writeHead)

+                                      {

+                                              String header = "Date,petitioner,responder,submitTime,endTime,content\r\n";

+                                              save.write(header);

+                                      }

+                                     

+                                      String out = date + "," + petitioner + "," + responder + "," + submitTime + "," + endTime + "," + content + "\r\n";

+                                      save.write(out);

+                              }

+                              catch (IOException e)

+                              {

+                                      _log.log(Level.WARNING, "Peticion System: Peticion log could not be saved: ", e);

+                              }

+                              finally

+                              {

+                                      try

+                                      {

+                                              save.close();

+                                      }

+                                      catch (Exception e)

+                                      {

+                                      }

+                              }

+                      }

}

 

 

config/AltSettings.properties

+

+#---------------------------------------------------------------

+# Peticion settings                                            -

+#---------------------------------------------------------------

+# Log peticions to log/peticions.csv

+# Only for testing yet!

+EnablePeticionLogging = False

Posted

Ehmm.. didn't you forget something? The function looks cool, but you never used it somewhere. Probably you didn't post it. Not everybody knows where to place the command with the right arguments. You should fix your post. Except that, It looks pretty good.

Posted

sorry, but Index are not l2jserver are L2JFree pack or other

 

the imports L2JServer are:

 

com/l2jserver/

 

not

net/sf/l2j

 

fix the code or title. regards

 

 

EDIT: You should also accommodate some Imports for l2jserver

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hello everyone, Lineage II clan MightyTeam is reopening recruitment and looking for ambitious, active players who want to compete seriously and grow together. We are building a disciplined and organized environment focused on teamwork, strategy, and long-term success. What we offer: Strong and experienced leadership, Fair and respectful treatment for every member, Organized clan structure and tactical gameplay, Competitive mentality with clear goals, Stable and drama-free environment, What we expect: Activity and willingness to improve, Teamplay and communication, Respect toward clan members, Motivation to compete and dominate, No politics. No toxicity. Only focused players with the right mentality.   If you are interested in joining MightyTeam, contact on Discord: tzelal.  <-- there is a dot  or Telegram tz3gg. 
    • Lol thanks no l better get Acis /Lucera/Mobius and will squeeze more profit that your crazy ass price files for fucks know what. Even Reborn was smart enough use Acis after Lucera to squeeze shit a lot of money 😁 Fucking hell 15 grants lol 😂 
    • It seems the SkyLord is simply not familiar with what l2-scripts and Bonux represents today. His opinion is likely based on our older materials — which is understandable. We haven't been standing still. Over the years, the studio has moved to a fundamentally different level of development. Our early builds are still available on the legacy site at very accessible prices — and they remain entirely viable for launching a project. As practice shows, solid servers can still be built on them, albeit with greater effort. As for the market — Classic, Essence, and Main have long been running on l2-scripts engines, and the majority of successful servers have, at one stage or another, used our source code as their foundation. This isn't self-promotion — it's the history of the industry. Today, for established projects with a reputation, we offer a different format: private partnership with individual terms tailored to your business goals. If you're interested in long-term collaboration — we're open to the conversation. We have solutions for every level — from newcomers to top-tier projects. Feel free to reach out, and we'll be happy to discuss.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..