修改
C_DropItem
在
if (item.isEquipped()) {
// \f1你不能夠放棄此樣物品。
pc.sendPackets(new S_ServerMessage(125));
return;
}
底下加入
//TODO 丟棄物品記錄
dropitem("IP"
+ "(" + pc.getNetConnection().getIp() + ")"
+"玩家"
+ ":【" + pc.getName() + "】 "
+ "的"
+ "【+" + item.getEnchantLevel()
+ " " + item.getName() +
"(" + count + ")" + "】"
+ " 丟棄到地上,"
+ "時間:" + "(" + new Timestamp(System.currentTimeMillis()) + ")。");
在
@Override
public Strin非法網站etType() {
return C_DROP_ITEM;
}
上面加入
//TODO 記錄文件檔 by 阿傑
public static void dropitem(String info) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("dropitem.txt", true));
out.write(info + "\r\n");
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
────────────────
修改
L1Trade
在
player.getTradeWindowInventory().tradeItem(l1iteminstance1,
l1iteminstance1.getCount(),
trading_partner.getInventory());
底下加入
//TODO 交易記錄 (主動找交易的玩家)
trade("IP"
+ "(" + player.getNetConnection().getIp() + ")"
+"玩家"
+ ":【" + player.getName() + "】 "
+ "的"
+ "【+" + l1iteminstance1.getEnchantLevel()
+ " " + l1iteminstance1.getName() +
"(" + l1iteminstance1.getCount() + ")" + "】"
+ " 轉移給玩家"
+ ":【" + trading_partner.getName() + "】,"
+ "時間:" + "(" + new Timestamp(System.currentTimeMillis()) + ")。");
在
trading_partner.getTradeWindowInventory().tradeItem(
l1iteminstance2, l1iteminstance2.getCount(),
player.getInventory());
底下加入
//TODO 交易記錄 (被邀請交易的玩家)
trade("IP"
+ "(" + trading_partner.getNetConnection().getIp() + ")"
+"玩家"
+ ":【" + trading_partner.getName() + "】 "
+ "的"
+ "【+" + l1iteminstance2.getEnchantLevel()
+ " " + l1iteminstance2.getName() +
"(" + l1iteminstance2.getCount() + ")" + "】"
+ " 轉移給玩家"
+ ":【" + player.getName() + "】,"
+ "時間:" + "(" + new Timestamp(System.currentTimeMillis()) + ")。");
在
public void TradeCancel(L1PcInstance player) {
上面加入
//TODO 記錄文件檔 by 阿傑
public static void trade(String info) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("trade.txt", true));
out.write(info + "\r\n");
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
────────────────
修改
C_GiveItem
在
if (targetInv.checkAddItem(item, count) != L1Inventory.OK) {
pc.sendPackets(new S_ServerMessage(942)); // 相手重、以上。
return;
}
底下加入
//TODO 給予NPC物品記錄
giveitem("IP"
+ "(" + pc.getNetConnection().getIp() + ")"
+"玩家"
+ ":【" + pc.getName() + "】 "
+ "的"
+ "【+" + item.getEnchantLevel()
+ " " + item.getName() +
"(" + count + ")" + "】"
+ " 道具丟給NPC,"
+ "時間:" + "(" + new Timestamp(System.currentTimeMillis()) + ")。");
在
private final static String receivableImpls[] = new String[] { "L1Npc", // NPC
上面加入
//TODO 記錄文件檔 by 阿傑
public static void giveitem(String info) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("giveitem.txt", true));
out.write(info + "\r\n");
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}