-
31.12.2011, 21:55 #1
- Registriert seit
- 19.12.2011
- Beiträge
- 356
Thanked 164 Times in 101 Posts[C#] DeKaDeNz.Client Chatlogger plugin
Nochmal als Example
PHP-Code:using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KNDeKaDeNz.Net;
using System.Windows.Forms;
using System.IO;
namespace DeKaDeNz
{
public class ChatLogger : KNDeKaDeNz.Plugin
{
private string now()
{
return DateTime.Now.ToShortTimeString();
}
StreamWriter SW;
String fileName = "";
public ChatLogger(KNDeKaDeNz.Client.BotClient parent) : base(parent)
{
if (!Directory.Exists("log")) Directory.CreateDirectory("log");
this.Priority = int.MaxValue;
int i = 0;
while (true)
{
i++;
if (!File.Exists("log/log-" + i + ".txt"))
break;
}
fileName = "log/log-" + i + ".txt";
SW = new StreamWriter(File.Create(fileName));
SW.WriteLine("Start logging");
SW.Close();
}
public override string GetInfo()
{
return "Dieses Plugin loggt die Packete in einer Logdatei. Dies ist speziell für Entwickler interessant.";
}
public override void OpenMenu()
{
MessageBox.Show("Dieses Plugin hat keine Optionen.");
}
public override bool OnReceive(Packet p)
{
SW = File.AppendText(fileName);
SW.WriteLine("IN ["+DateTime.Now.ToShortTimeString()+"] "+p.ToString().Replace("\0","\\0"));
SW.Close();
return false;
}
public override bool OnSend(Packet p)
{
SW = File.AppendText(fileName);
SW.WriteLine("OUT [" + DateTime.Now.ToShortTimeString() + "] " + p.ToString().Replace("\0", "\\0"));
SW.Close();
return false;
}
}
}
Geändert von DeKaDeNz (06.01.2012 um 13:39 Uhr)
Ähnliche Themen
-
[S] TÜ Plugin von KoRn
Von Prinzessin Paat im Forum Knuddels Underground SzeneAntworten: 3Letzter Beitrag: 14.04.2013, 15:55 -
[C#] DeKaDeNz.Client BotControll plugin
Von DeKaDeNz im Forum SourcecodeAntworten: 1Letzter Beitrag: 26.08.2012, 01:15 -
[BETA] FiftyBot Plugin für KNDeKaDeNz.Client
Von DeKaDeNz im Forum Knuddels Fifty! BotsAntworten: 5Letzter Beitrag: 02.03.2012, 23:58 -
BingoBot Plugin für KNDeKaDeNz.Client
Von DeKaDeNz im Forum Sonstige Knuddels Bots/SoftwareAntworten: 17Letzter Beitrag: 30.01.2012, 11:06 -
BotControll Plugin für KNDeKaDeNz.Client
Von DeKaDeNz im Forum Sonstige Knuddels Bots/SoftwareAntworten: 5Letzter Beitrag: 22.01.2012, 21:59
Diese Seite nutzt Cookies, um das Nutzererlebnis zu verbessern. Klicken Sie hier, um das Cookie-Tracking zu deaktivieren.