mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Remove trailing whitespace
This commit is contained in:
@@ -9,7 +9,7 @@ EQEmuErrorLog::EQEmuErrorLog()
|
||||
mErrorLog = NULL;
|
||||
mErrorLog = fopen(LOG_FILE_NAME, "w");
|
||||
if(!mErrorLog) {
|
||||
Log(eqEmuLogConsole,"Opening of %s for writing failed, debug output will be tied to console only.", LOG_FILE_NAME);
|
||||
Log(eqEmuLogConsole,"Opening of %s for writing failed, debug output will be tied to console only.", LOG_FILE_NAME);
|
||||
}
|
||||
else
|
||||
Log(eqEmuLogBoth, "EQEmuErrorLog Init Successful.");
|
||||
@@ -26,11 +26,11 @@ EQEmuErrorLog::EQEmuErrorLog()
|
||||
|
||||
}
|
||||
EQEmuErrorLog::~EQEmuErrorLog()
|
||||
{
|
||||
{
|
||||
Log(eqEmuLogBoth, "EQEmuErrorLog Shutdown.");
|
||||
if(mErrorLog) {
|
||||
fclose(mErrorLog);
|
||||
mErrorLog = NULL;
|
||||
if(mErrorLog) {
|
||||
fclose(mErrorLog);
|
||||
mErrorLog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void EQEmuErrorLog::Log(unsigned int mOutputType, const char *msg, ...)
|
||||
struct tm *mTime;
|
||||
time(&mClock);
|
||||
mTime = localtime(&mClock);
|
||||
|
||||
|
||||
if(mOutputType & eqEmuLogConsole){
|
||||
printf("[Debug] [%02d.%02d.%02d - %02d:%02d:%02d] %s\n", mTime->tm_mon+1, mTime->tm_mday, mTime->tm_year%100, mTime->tm_hour, mTime->tm_min, mTime->tm_sec, buffer);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void EQEmuErrorLog::Log(unsigned int mOutputType, const char *msg, ...)
|
||||
fprintf(mErrorLogSQL, "%s;\n\n", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(buffer)
|
||||
delete[] buffer;
|
||||
}
|
||||
@@ -13,12 +13,12 @@ enum{
|
||||
};
|
||||
|
||||
//log file output
|
||||
#define LOG_FILE_NAME "debug.txt"
|
||||
#define LOG_FILE_NAME "debug.txt"
|
||||
#define SQL_LOG_FILE_NAME "sql_log.sql"
|
||||
|
||||
//max single log length
|
||||
//same as a client:message() max len
|
||||
#define MAX_LOG_LEN 4096
|
||||
#define MAX_LOG_LEN 4096
|
||||
|
||||
//much simplified logging function, similar to the one used on the server (Tho much simpler)
|
||||
class EQEmuErrorLog {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "utility.h"
|
||||
#include "base.h"
|
||||
#include "ErrorLog.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
void MainFrame::ActivitiesListBoxSimpleSelect(wxCommandEvent& event)
|
||||
@@ -129,7 +129,7 @@ void MainFrame::NewActivity(wxCommandEvent& event)
|
||||
char * mActQuery = 0;
|
||||
MakeAnyLenString(&mActQuery, "INSERT INTO `activities` (`taskid`,`activityid`,`step`,`activitytype`,`text1`,`text2`,`text3`,`goalid`,`goalmethod`,`goalcount`,`delivertonpc`,`zoneid`,`optional`) VALUES (%u,%u,%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u)",
|
||||
newAct.id, newAct.activityId, newAct.step, newAct.activityType, newAct.text1, newAct.text2, newAct.text3, newAct.goalid, newAct.goalmethod, newAct.goalcount, newAct.deliverToNpc, newAct.zoneid, newAct.optional );
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mActQuery);
|
||||
if (mysql_query(mMysql, mActQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
@@ -161,7 +161,7 @@ void MainFrame::DeleteActivity(wxCommandEvent& event)
|
||||
|
||||
eqtask_activity_id *selAct = (eqtask_activity_id*)ActivitiesSelectionList->GetClientData(ActivitiesSelectionList->GetSelection());
|
||||
unsigned int aid = selAct->activityid;
|
||||
unsigned int tid = selAct->id;
|
||||
unsigned int tid = selAct->id;
|
||||
|
||||
if(selAct)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ MainFrame::MainFrame(const wxString& title,
|
||||
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
mErrorLog->Log(eqEmuLogBoth, "Creating Item List Box.");
|
||||
ItemSelectionList = new wxListBox(this, LIST_Click, wxDefaultPosition, wxSize( -1,-1 ), 0, NULL, 0);
|
||||
ItemSelectionList = new wxListBox(this, LIST_Click, wxDefaultPosition, wxSize( -1,-1 ), 0, NULL, 0);
|
||||
|
||||
mErrorLog->Log(eqEmuLogBoth, "Adding Item List Box to Sizer.");
|
||||
BoxSizer1->Add(ItemSelectionList, 0, wxALIGN_TOP|wxALL|wxEXPAND, 5);
|
||||
@@ -228,7 +228,7 @@ MainFrame::MainFrame(const wxString& title,
|
||||
mActText1 = new wxTextCtrl(MainPanel2, -1, wxT(""), wxPoint(185,0), wxSize(180,20), wxTE_DONTWRAP);
|
||||
mActText1->SetMaxLength(64);
|
||||
mActText1->Disable();
|
||||
|
||||
|
||||
mActText2Label = new wxStaticText(MainPanel2, -1, "Text 2:", wxPoint(105,22), wxDefaultSize);
|
||||
mActText2 = new wxTextCtrl(MainPanel2, -1, wxT(""), wxPoint(185,20), wxSize(180,20), wxTE_DONTWRAP);
|
||||
mActText2->SetMaxLength(64);
|
||||
@@ -392,7 +392,7 @@ MainFrame::MainFrame(const wxString& title,
|
||||
|
||||
mErrorLog->Log(eqEmuLogBoth, "Adding Notebook to Sizer.");
|
||||
BoxSizer1->Add(MainNotebookBack, 1, wxALIGN_TOP|wxEXPAND, 5);
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogBoth, "Setting Frame Sizer.");
|
||||
this->SetSizer(BoxSizer1);
|
||||
mErrorLog->Log(eqEmuLogBoth, "Calculating Frame Layout.");
|
||||
@@ -444,22 +444,22 @@ void MainFrame::Connect(wxCommandEvent& WXUNUSED(event))
|
||||
mErrorLog->Log(eqEmuLogBoth, "Failed to load tasks, exiting.");
|
||||
Close(TRUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!LoadGoals()){
|
||||
mysql_close(mMysql);
|
||||
mErrorLog->Log(eqEmuLogBoth, "Failed to load goals, exiting.");
|
||||
Close(TRUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!LoadActivities()){
|
||||
mysql_close(mMysql);
|
||||
mErrorLog->Log(eqEmuLogBoth, "Failed to load activities, exiting.");
|
||||
Close(TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!LoadItems()){
|
||||
mysql_close(mMysql);
|
||||
mErrorLog->Log(eqEmuLogBoth, "Failed to load items, exiting.");
|
||||
@@ -510,7 +510,7 @@ void MainFrame::ListBoxDoubleClick(wxCommandEvent& event)
|
||||
Iter = taskList.begin();
|
||||
Iter += openedIndex;
|
||||
eqtask mTask = *Iter;
|
||||
|
||||
|
||||
wxString mStr;
|
||||
mStr.Printf("%s", mTask.title);
|
||||
mTaskName->Clear();
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
|
||||
enum
|
||||
{
|
||||
TEXT_Main = wxID_HIGHEST + 1,
|
||||
TEXT_Main = wxID_HIGHEST + 1,
|
||||
MENU_Connect,
|
||||
MENU_Quit,
|
||||
MENU_NewTask,
|
||||
@@ -252,4 +252,4 @@ enum
|
||||
LIST_Click_Proximity,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -12,7 +12,7 @@ using namespace std;
|
||||
bool MainFrame::GetDatabaseSettings(){
|
||||
FILE *mFile = NULL;
|
||||
mFile = fopen("db.txt", "r");
|
||||
|
||||
|
||||
//very little error checking
|
||||
//we don't make sure the values in the file are valid
|
||||
//or all there just that the file exists so:
|
||||
@@ -81,7 +81,7 @@ bool MainFrame::LoadItems(){
|
||||
itemsLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Items", itemsLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for item load.");
|
||||
@@ -143,7 +143,7 @@ bool MainFrame::LoadZones()
|
||||
zonesLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Zones", zonesLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for zone load.");
|
||||
@@ -181,7 +181,7 @@ bool MainFrame::LoadTasks()
|
||||
wxString str;
|
||||
str.Printf("%d:%s", newT.id, newT.title);
|
||||
ItemSelectionList->Append(str);
|
||||
|
||||
|
||||
if(newT.id > highestIndex)
|
||||
highestIndex = newT.id;
|
||||
|
||||
@@ -200,7 +200,7 @@ bool MainFrame::LoadTasks()
|
||||
tasksLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Tasks", tasksLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for task load.");
|
||||
@@ -232,7 +232,7 @@ bool MainFrame::LoadGoals()
|
||||
goalsLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Goals", goalsLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for goal load.");
|
||||
@@ -276,7 +276,7 @@ bool MainFrame::LoadActivities()
|
||||
activitiesLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Activities", activitiesLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for activity load.");
|
||||
@@ -315,7 +315,7 @@ bool MainFrame::LoadProximity()
|
||||
proximitiesLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Proximities", proximitiesLoaded);
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for proximity load.");
|
||||
|
||||
@@ -67,7 +67,7 @@ void MainFrame::PopulateGoalValues(unsigned int goalid)
|
||||
if((*Iter).id == goalid){
|
||||
int *i = new int;
|
||||
*i = (*Iter).value;
|
||||
|
||||
|
||||
wxString curStr;
|
||||
curStr.Clear();
|
||||
curStr.Printf("%u", (*Iter).value);
|
||||
@@ -333,7 +333,7 @@ void MainFrame::ChangeGoalValue(wxCommandEvent& event)
|
||||
mErrorLog->Log(eqEmuLogBoth, "Modify goal value failed, goal values not active");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(GoalsValuesList->GetSelection() == wxNOT_FOUND)
|
||||
{
|
||||
mErrorLog->Log(eqEmuLogBoth, "Modify goal value failed, no selection found");
|
||||
|
||||
@@ -32,7 +32,7 @@ void MainFrame::PopulateProximity()
|
||||
|
||||
prox->exploreid = eqt.exploreid;
|
||||
prox->zoneid = eqt.zoneid;
|
||||
|
||||
|
||||
wxString zoneName;
|
||||
zoneName.Printf("Unknown Zone");
|
||||
vector<eqtask_zones>::iterator ZoneIter;
|
||||
@@ -115,7 +115,7 @@ void MainFrame::NewProximity(wxCommandEvent& event)
|
||||
mErrorLog->Log(eqEmuLogBoth, "New proximity failed, not connected to db");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int newID = wxGetNumberFromUser("", "Explore ID:", "Explore ID", 0, 0, 9999999);
|
||||
int newZoneID = wxGetNumberFromUser("", "Zone ID:", "Zone ID", 0, 0, 9999999);
|
||||
|
||||
@@ -280,7 +280,7 @@ void MainFrame::SaveProximity(wxCommandEvent& event)
|
||||
|
||||
inStr.Clear();
|
||||
inStr = mProxMinx->GetValue();
|
||||
toSave.minx = atof(inStr.mb_str());
|
||||
toSave.minx = atof(inStr.mb_str());
|
||||
|
||||
inStr.Clear();
|
||||
inStr = mProxMaxx->GetValue();
|
||||
@@ -368,9 +368,9 @@ void MainFrame::SaveProximity(wxCommandEvent& event)
|
||||
|
||||
if(canUpdate){
|
||||
char * mQuery = 0;
|
||||
MakeAnyLenString(&mQuery, "UPDATE proximities SET minx=%.4f, maxx=%.4f, miny=%.4f, maxy=%.4f, minz=%.4f, maxz=%.4f) WHERE zoneid=%u AND exploreid=%u",
|
||||
MakeAnyLenString(&mQuery, "UPDATE proximities SET minx=%.4f, maxx=%.4f, miny=%.4f, maxy=%.4f, minz=%.4f, maxz=%.4f) WHERE zoneid=%u AND exploreid=%u",
|
||||
toSave.minx, toSave.maxx, toSave.miny, toSave.maxy, toSave.minz, toSave.maxz, toSave.zoneid, toSave.exploreid);
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
@@ -389,7 +389,7 @@ void MainFrame::SaveProximity(wxCommandEvent& event)
|
||||
|
||||
MakeAnyLenString(&mQuery, "INSERT INTO `proximities` (`zoneid`,`exploreid`,`minx`,`maxx`,`miny`,`maxy`,`minz`,`maxz`) VALUES (%u,%u,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f)"
|
||||
, toSave.zoneid, toSave.exploreid, toSave.minx, toSave.maxx, toSave.miny, toSave.maxy, toSave.minz, toSave.maxz);
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
|
||||
@@ -250,7 +250,7 @@ void MainFrame::SaveTask(wxCommandEvent& event)
|
||||
getStr = mRewardXP->GetValue();
|
||||
ourTask.xpreward = atoi(getStr.mb_str());
|
||||
getStr.Clear();
|
||||
|
||||
|
||||
int * i = (int*)mStartZone->GetClientData(mStartZone->GetSelection());
|
||||
ourTask.startzone = *i;
|
||||
|
||||
@@ -261,7 +261,7 @@ void MainFrame::SaveTask(wxCommandEvent& event)
|
||||
char * mQuery = 0;
|
||||
MakeAnyLenString(&mQuery, "UPDATE tasks SET duration=%u, title='%s', description='%s', reward='%s', rewardid=%u, cashreward=%u, xpreward=%i, rewardmethod=%u, startzone=%u, minlevel=%u, maxlevel=%u, repeatable=%u WHERE id=%u",
|
||||
ourTask.duration, MakeStringSQLSafe(ourTask.title).mb_str(), MakeStringSQLSafe(ourTask.desc).mb_str(), MakeStringSQLSafe(ourTask.reward).mb_str(), ourTask.rewardid, ourTask.cashreward, ourTask.xpreward, ourTask.rewardmethod, ourTask.startzone, ourTask.level_min, ourTask.level_max, ourTask.repeatable, ourTask.id);
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
@@ -278,7 +278,7 @@ void MainFrame::SaveTask(wxCommandEvent& event)
|
||||
|
||||
MakeAnyLenString(&mQuery, "INSERT INTO `tasks` (`id`,`duration`,`title`,`description`,`reward`,`rewardid`,`cashreward`,`xpreward`,`rewardmethod`,`startzone`, `minlevel`, `maxlevel`) VALUES (%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u,%u)",
|
||||
ourTask.id, ourTask.duration, MakeStringSQLSafe(ourTask.title).mb_str(), MakeStringSQLSafe(ourTask.desc).mb_str(), MakeStringSQLSafe(ourTask.reward).mb_str(), ourTask.rewardid, ourTask.cashreward, ourTask.xpreward, ourTask.rewardmethod, ourTask.startzone, ourTask.level_min, ourTask.level_max);
|
||||
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
|
||||
Reference in New Issue
Block a user