Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [L2JServer] GM Log mas atualizado (https://secretexperience.net/showthread.php?t=20705)

Guma 20-04-2010 07:16 PM

GM Log mas atualizado
 
Citação:

Index: java/net/sf/l2j/gameserver/model/GMAudit.java
================================================== =================
--- java/net/sf/l2j/gameserver/model/GMAudit.java (revision 1933)
+++ java/net/sf/l2j/gameserver/model/GMAudit.java (working copy)
@@ -14,29 +14,50 @@
*/
package net.sf.l2j.gameserver.model;

+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.lib.Log;

-public class GMAudit {
- private static final Logger _log = Logger.getLogger("gmaudit");
-
- public static void auditGMAction(String gmName, String action, String target, String params){
- if (Config.GMAUDIT){
- String today;
- SimpleDateFormat formatter;
- formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
- today = formatter.format(new Date());
-
- _log.log(Level.INFO, today + ">" + gmName + ">" + action + ">" +target + ">" + params);

+public class GMAudit
+{
+
+ private static final Logger _log = Logger.getLogger(Log.class.getName());
+
+ public static void auditGMAction(String gmName, String action, String target, String params)
+ {
+ if (Config.GMAUDIT)
+ {
+ new File("log/GMAudit").mkdirs();
+
+ SimpleDateFormat formatter;
+ formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
+ String today = formatter.format(new Date());
+
+ try
+ {
+ File file = new File("log/GMAudit/" + gmName + ".txt");
+ FileWriter save = new FileWriter(file, true);
+
+ String out = (today + ">" + gmName + ">" + action + ">" + target + ">" + params + "\n");
+
+ save.write(out);
+ save.flush();
+ save.close();
+
+ save = null;
+ file = null;
+ }
+ catch (IOException e)
+ {
+ _log.log(Level.SEVERE, "GMAudit for GM " + gmName +" could not be saved: ", e);
+ }
}
}

-}
-
-
-
-
-

+}
\ No newline at end of file
creditos : Ahmed

New 22-04-2010 03:41 PM

Pergunta de noob...

O que isso muda ? :unsure:

Guma 22-04-2010 04:08 PM

reforca o monitoramento dos gm "GM LOG"

Lorde 22-04-2010 04:30 PM

Vlw guma por compartilhar tou precisando :)


Horários baseados na GMT -3. Agora são 10:47 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.