Post merge Log.Out converts and header/linker fixes

This commit is contained in:
Akkadius
2015-02-03 00:10:49 -06:00
parent dd6d1d5511
commit 3448dd1a9e
14 changed files with 67 additions and 40 deletions
+11 -6
View File
@@ -1,13 +1,16 @@
#include "../common/eqemu_logsys.h"
#include "web_interface.h"
#include "method_handler.h"
#include "remote_call.h"
EQEmuLogSys Log;
volatile bool run = true;
TimeoutManager timeout_manager;
const EQEmuConfig *config = nullptr;
WorldServer *worldserver = nullptr;
libwebsocket_context *context = nullptr;
SharedDatabase *db = nullptr;
std::map<std::string, per_session_data_eqemu*> sessions;
std::map<std::string, std::pair<int, MethodHandler>> authorized_methods;
std::map<std::string, MethodHandler> unauthorized_methods;
@@ -135,18 +138,20 @@ static struct libwebsocket_protocols protocols[] = {
int main() {
RegisterExecutablePlatform(ExePlatformWebInterface);
Log.LoadLogSettingsDefaults();
set_exception_handler();
register_methods();
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
_log(WEB_INTERFACE__INIT, "Starting EQEmu Web Server.");
Log.Out(Logs::General, Logs::WebInterface_Server, "Starting EQEmu Web Server.");
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
_log(WEB_INTERFACE__ERROR, "Could not set signal handler");
Log.Out(Logs::General, Logs::Error, "Could not set signal handler");
return 1;
}
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
_log(WEB_INTERFACE__ERROR, "Could not set signal handler");
Log.Out(Logs::General, Logs::Error, "Could not set signal handler");
return 1;
}
@@ -162,15 +167,15 @@ int main() {
context = libwebsocket_create_context(&info);
if (context == NULL) {
_log(WEB_INTERFACE__ERROR, "Could not create websocket handler.");
Log.Out(Logs::General, Logs::Error, "Could not create websocket handler.");
return 1;
}
db = new SharedDatabase();
_log(WEB_INTERFACE__TRACE, "Connecting to database...");
Log.Out(Logs::General, Logs::WebInterface_Server, "Connecting to database...");
if(!db->Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
_log(WEB_INTERFACE__TRACE, "Unable to connect to the database, cannot continue without a database connection");
Log.Out(Logs::General, Logs::WebInterface_Server, "Unable to connect to the database, cannot continue without a database connection");
return 1;
}
+1 -1
View File
@@ -18,7 +18,7 @@
#ifndef WI_WEB_INTERFACE_H
#define WI_WEB_INTERFACE_H
#include "../common/debug.h"
#include "../common/global_define.h"
#include "../common/opcodemgr.h"
#include "../common/eq_stream_factory.h"
#include "../common/rulesys.h"
+3 -3
View File
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/global_define.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
@@ -44,7 +44,7 @@ WorldServer::~WorldServer(){
}
void WorldServer::OnConnected(){
_log(WEB_INTERFACE__INIT, "Connected to World.");
Log.Out(Logs::General, Logs::WebInterface_Server, "Connected to World.");
WorldConnection::OnConnected();
}
@@ -55,7 +55,7 @@ void WorldServer::Process(){
ServerPacket *pack = nullptr;
while((pack = tcpc.PopPacket())){
_log(WEB_INTERFACE__TRACE, "Received Opcode: %4X", pack->opcode);
Log.Out(Logs::General, Logs::Netcode, "Received Opcode: %4X", pack->opcode);
switch(pack->opcode) {
case 0: { break; }
case ServerOP_KeepAlive: { break; }