Post: Chat Logs
11-17-2015, 03:10 AM #1
Stunz
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({});

Remember to create a folder in the directory "/data" named ChatLogs!

In PlayerAssistant.java add this anywhere

    	public void writeChatLog(String data)
{
checkDateAndTime();
String filePath = "./Data/ChatLogs/" + c.playerName + ".txt";
BufferedWriter bw = null;

try
{
bw = new BufferedWriter(new FileWriter(filePath, true));
bw.write("[" + c.date + "]" + "-" + "[" + c.currentTime + " " + checkTimeOfDay() + "]: " + "[" + c.connectedFrom + "]: " + "" + data + " ");
bw.newLine();
bw.flush();
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
finally
{
if (bw != null)
{
try
{
bw.close();
}
catch (IOException ioe2)
{
}
}
}
}


Then go to Chat.java and under
    c.inStream.readBytes_reverseA(c.getChatText(), c.getChatTextSize(), 0);
add
    c.getPA().writeChatLog(Misc.textUnpack(c.getChatText(), packetSize-2));

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo