Changed build script to save the configuration chosen so you will not have to re-type in information each time you want to build. Fixed issue where LogLevel was setting LogLimit. Added help commands to individual commands to explain options. Reformatted every command to work the same with the way it saves settings and displays results. Updated LogMySQL to work the same with commands as LogSQLite.
PutModule("port - MySQL port (defualt is 3306).");
PutModule("username - MySQL username.");
PutModule("password - MySQL password.");
PutModule("databaseName - MySQL database name.");
PutModule("-----");
PutModule("connect - Reconnect to the MySQL database.");
PutModule("-----");
PutModule("replay - Play back the messages received.");
PutModule("replayAll - Set LogMySQL to replay all messages stored (default is off).");
PutModule("logLimit - Set LogMySQL to limit the amount of items to store into the log (0 means to keep everything, 1 means clear after replay, anything else would limit to the count, default is 1).");
PutModule("logLevel - Set LogMySQL log level (0 messages mentioning you and/or to you only. 1 include all messages sent in an channel. 2 include all actions, join/part, and notices sent in channel and to you. 3 include all server wide messages. 4 include messages sent by you. Default is 1).");
PutModule("-----");
PutModule("Layout is as below.");
PutModule("Command [arguments]");
PutModule("-----");
PutModule("If you do not include an argument on items that supports arguments, LogMySQL will return the current setting for the item.");
}elseif(sCommand.Equals("HOST")){
if(sArgs.empty()){
CStringhost=GetNV("host");
PutModule("Host is set to: "+host);
}else{
SetNV("host",sArgs);
PutModule("Host is now set to: "+sArgs);
}
}elseif(sCommand.Equals("PORT")){
if(sArgs.empty()){
CStringport=GetNV("port");
PutModule("Port is set to: "+port);
}else{
CStringresult;
unsignedintport=strtoul(sArgs.c_str(),NULL,10);
charportStr[20];
snprintf(portStr,sizeof(portStr),"%u",port);
result=portStr;
SetNV("port",result);
PutModule("Port is now set to: "+result);
}
}elseif(sCommand.Equals("USERNAME")){
if(sArgs.empty()){
CStringusername=GetNV("username");
PutModule("Username is set to: "+username);
}else{
SetNV("username",sArgs);
PutModule("Username is now set to: "+sArgs);
}
}elseif(sCommand.Equals("PASSWORD")){
if(sArgs.empty()){
CStringpassword=GetNV("password");
if(password.empty())
PutModule("Password is blank.");
else
PutModule("Password is set.");
}else{
SetNV("password",sArgs);
PutModule("Password is now set.");
}
}elseif(sCommand.Equals("DATABASENAME")){
if(sArgs.empty()){
CStringdatabaseName=GetNV("databaseName");
PutModule("Database Name is set to: "+databaseName);
}else{
SetNV("databaseName",sArgs);
PutModule("Database Name is now set to: "+sArgs);
}
}elseif(sCommand.Equals("CONNECT")){
MySQLConnect();
if(databaseConnected)
PutModule("Database is now connected");
else
PutModule("Unable to connect to database. Check configuration.");
"[1|0]","Set LogSQLite to limit the amount of items to store into the log (0 means to keep everything, 1 means clear after replay, anything else would limit to the count, default is 1).");
"[0-4]","Set LogSQLite log level (0 messages mentioning you and/or to you only. 1 include all messages sent in an channel. 2 include all actions, join/part, and notices sent in channel and to you. 3 include all server wide messages. 4 include messages sent by you. Default is 1).");
AddCommand("Replay",static_cast<CModCommand::ModCmdFunc>(&CLogSQLite::ReplayCommand),"","Play back the messages received.");
AddCommand("ReplayAll",static_cast<CModCommand::ModCmdFunc>(&CLogSQLite::ReplayAllCommand),"[1|0]","Replay all messages stored.");
AddCommand("LogLimit",static_cast<CModCommand::ModCmdFunc>(&CLogSQLite::LogLimitCommand),"[0-9]+","Limit the amount of items to store into the log.");