mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
Reworking a lot of stuff at once, this will look very chaotic.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user