C# Class wmib.Core

Inheritance: System.MarshalByRefObject
Afficher le fichier Open project: benapetr/wikimedia-bot

Méthodes publiques

Свойство Type Description
DB Database
KernelThread Thread
LastText string
MysqlDB WMIBMySQL
PostgreDB PostgreSQL
WriterThread Thread

Méthodes publiques

Méthode Description
BackupData ( string name ) : bool

Create a backup file This is very useful function in case you need to overwrite some file. In that case there is a chance for program to crash during the write and this would left the file corrupted, this function will create a copy of a file using config.tempName() which later needs to be deleted (after you finish your write operation). The file that is to be backed up doesn't need to exist, if it's not present the function just return false

BackupRecovery ( string FileName ) : bool

Recover a file that had a backup and remove it

GetAction ( string message, string Channel, string host, string nick ) : bool

Called on action

GetChannel ( string name ) : Channel

Get a channel object

GetMessage ( string channel, string nick, string host, string message ) : bool

Called when someone post a message to server

GetTempFileName ( string file ) : bool

Copy the selected file to a temporary file name this function is used mostly for restore of corrupted data, so that the corrupted version of file can be stored in /tmp for debugging

HandleException ( Exception ex ) : void

Exception handler

HandleException ( Exception ex, string module ) : void

Exception handler

Kill ( ) : void

This will disable bot and close this process

RecoverFile ( string name, string ch = "unknown object" ) : bool

Recover a file that was previously stored

ShowHelp ( string parameter, Channel channel ) : bool
TrafficLog ( string text ) : void

Store a traffic log to a file

Trim ( string input ) : string
ValidFile ( string name ) : bool

Return true in case the filename is valid

WikiEncode ( string url ) : string
getUptime ( ) : string

Return uptime

Private Methods

Méthode Description
Terminate ( ) : void
showInfo ( string name, string info, string channel ) : void

Method Details

BackupData() public static méthode

Create a backup file This is very useful function in case you need to overwrite some file. In that case there is a chance for program to crash during the write and this would left the file corrupted, this function will create a copy of a file using config.tempName() which later needs to be deleted (after you finish your write operation). The file that is to be backed up doesn't need to exist, if it's not present the function just return false
public static BackupData ( string name ) : bool
name string Full path of a file that you want to make a backup of
Résultat bool

BackupRecovery() public static méthode

Recover a file that had a backup and remove it
public static BackupRecovery ( string FileName ) : bool
FileName string Name of file
Résultat bool

GetAction() public static méthode

Called on action
public static GetAction ( string message, string Channel, string host, string nick ) : bool
message string Message
Channel string Channel
host string Host
nick string Nick
Résultat bool

GetChannel() public static méthode

Get a channel object
public static GetChannel ( string name ) : Channel
name string Name
Résultat Channel

GetMessage() public static méthode

Called when someone post a message to server
public static GetMessage ( string channel, string nick, string host, string message ) : bool
channel string Channel
nick string Nick
host string Host
message string Message
Résultat bool

GetTempFileName() public static méthode

Copy the selected file to a temporary file name this function is used mostly for restore of corrupted data, so that the corrupted version of file can be stored in /tmp for debugging
public static GetTempFileName ( string file ) : bool
file string /// File ///
Résultat bool

HandleException() public static méthode

Exception handler
public static HandleException ( Exception ex ) : void
ex System.Exception Exception pointer
Résultat void

HandleException() public static méthode

Exception handler
public static HandleException ( Exception ex, string module ) : void
ex System.Exception Exception pointer
module string Channel name
Résultat void

Kill() public static méthode

This will disable bot and close this process
public static Kill ( ) : void
Résultat void

RecoverFile() public static méthode

Recover a file that was previously stored
public static RecoverFile ( string name, string ch = "unknown object" ) : bool
name string
ch string
Résultat bool

ShowHelp() public static méthode

public static ShowHelp ( string parameter, Channel channel ) : bool
parameter string
channel Channel
Résultat bool

TrafficLog() public static méthode

Store a traffic log to a file
public static TrafficLog ( string text ) : void
text string
Résultat void

Trim() public static méthode

public static Trim ( string input ) : string
input string
Résultat string

ValidFile() public static méthode

Return true in case the filename is valid
public static ValidFile ( string name ) : bool
name string Name
Résultat bool

WikiEncode() public static méthode

public static WikiEncode ( string url ) : string
url string
Résultat string

getUptime() public static méthode

Return uptime
public static getUptime ( ) : string
Résultat string

Property Details

DB public_oe static_oe property

Database server the bot is connected to multiple DB's this is a pointer to preferred one
public static Database,wmib DB
Résultat Database

KernelThread public_oe static_oe property

public static Thread KernelThread
Résultat Thread

LastText public_oe static_oe property

Last line of text received on irc
public static string LastText
Résultat string

MysqlDB public_oe static_oe property

public static WMIBMySQL,wmib MysqlDB
Résultat WMIBMySQL

PostgreDB public_oe static_oe property

The postgre DB
public static PostgreSQL,wmib PostgreDB
Résultat PostgreSQL

WriterThread public_oe static_oe property

Thread which is writing the system data to files
public static Thread WriterThread
Résultat Thread