Reworking a lot of stuff at once, this will look very chaotic.

This commit is contained in:
KimLS
2014-07-14 15:09:55 -07:00
parent 9e3e8dbfa6
commit 80892f1d4d
122 changed files with 185 additions and 71 deletions
+3 -3
View File
@@ -13,9 +13,9 @@ ADD_EXECUTABLE(web_interface ${web_interface_sources} ${web_interface_headers})
INSTALL(TARGETS web_interface RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
ADD_DEFINITIONS(-DQSERV)
ADD_DEFINITIONS(-DWEB_INTERFACE)
TARGET_LINK_LIBRARIES(web_interface Common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
TARGET_LINK_LIBRARIES(web_interface common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
IF(MSVC)
SET_TARGET_PROPERTIES(web_interface PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
@@ -37,4 +37,4 @@ IF(UNIX)
ADD_DEFINITIONS(-fPIC)
ENDIF(UNIX)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/Bin)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+44
View File
@@ -0,0 +1,44 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "web_connection.h"
WebConnection::WebConnection(uint32 ID, WebServer *server, SOCKET in_socket, uint32 irIP, uint16 irPort)
: TCPConnection(ID, in_socket, irIP, irPort)
{
w_server = server;
}
WebConnection::~WebConnection() {
}
bool WebConnection::ProcessReceivedData(char* errbuf) {
//recvbuf_used
//recvbuf
return true;
}
WebServer::WebServer(uint16 port)
: TCPServer<EmuTCPConnection>(iPort)
{
}
void WebServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort) {
WebConnection *conn = new WebConnection(ID, this, in_socket, irIP, irPort, pOldFormat);
AddConnection(conn);
}
+44
View File
@@ -0,0 +1,44 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef WI_WEB_CONNECTION_H
#define WI_WEB_CONNECTION_H
#include "../common/TCPConnection.h"
class WebServer;
class WebConnection : public TCPConnection
{
public:
WebConnection(uint32 ID, WebServer *server, SOCKET in_socket, uint32 irIP, uint16 irPort);
virtual ~WebConnection();
protected:
virtual bool ProcessReceivedData(char* errbuf = 0);
WebServer *w_server;
};
class WebServer : protected TCPServer<WebConnection> {
public:
WebServer(uint16 port);
protected:
virtual void CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort);
};
#endif
+5 -3
View File
@@ -41,15 +41,17 @@ int main() {
worldserver = new WorldServer(config->SharedKey);
worldserver->Connect();
while(run) {
while(run) {
Timer::SetCurrentTime();
if (InterserverTimer.Check()) {
if (worldserver->TryReconnect() && (!worldserver->Connected()))
worldserver->AsyncConnect();
}
worldserver->Process();
timeout_manager.CheckTimeouts();
Sleep(10);
timeout_manager.CheckTimeouts();
Sleep(1);
}
return 0;
}