Cleaned up web interface server, starting work on getting tcp connections to persist then will hook it up to the websockets/http/whatever else we deem worthy.

This commit is contained in:
KimLS
2014-07-07 22:19:46 -07:00
parent 74f07f8e19
commit 9e3e8dbfa6
20 changed files with 158 additions and 634 deletions
+5 -5
View File
@@ -366,13 +366,13 @@ bool EmuTCPConnection::LineOutQueuePush(char* line) {
safe_delete_array(line);
return(true);
}
if (strcmp(line, "**PACKETMODESS**") == 0) {
if (strcmp(line, "**PACKETMODEWI**") == 0) {
MSendQueue.lock();
safe_delete_array(sendbuf);
if (TCPMode == modeConsole)
Send((const uchar*) "\0**PACKETMODESS**\r", 18);
Send((const uchar*) "\0**PACKETMODEWI**\r", 18);
TCPMode = modePacket;
PacketMode = packetModeSocket_Server;
PacketMode = packetModeWebInterface;
EmuTCPNetPacket_Struct* tnps = 0;
while ((tnps = InModeQueue.pop())) {
SendPacket(tnps);
@@ -435,12 +435,12 @@ bool EmuTCPConnection::ConnectIP(uint32 irIP, uint16 irPort, char* errbuf) {
sendbuf = new uchar[sendbuf_size];
memcpy(sendbuf, "\0**PACKETMODEQS**\r", sendbuf_size);
}
else if (PacketMode == packetModeSocket_Server) {
else if (PacketMode == packetModeWebInterface) {
safe_delete_array(sendbuf);
sendbuf_size = 18;
sendbuf_used = sendbuf_size;
sendbuf = new uchar[sendbuf_size];
memcpy(sendbuf, "\0**PACKETMODESS**\r", sendbuf_size);
memcpy(sendbuf, "\0**PACKETMODEWI**\r", sendbuf_size);
}
else {
//default: packetModeZone
+1 -1
View File
@@ -30,7 +30,7 @@ class EmuTCPServer;
class EmuTCPConnection : public TCPConnection {
public:
enum eTCPMode { modeConsole, modeTransition, modePacket };
enum ePacketMode { packetModeZone, packetModeLauncher, packetModeLogin, packetModeUCS, packetModeQueryServ, packetModeSocket_Server };
enum ePacketMode { packetModeZone, packetModeLauncher, packetModeLogin, packetModeUCS, packetModeQueryServ, packetModeWebInterface };
EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, SOCKET iSock, uint32 irIP, uint16 irPort, bool iOldFormat = false);
EmuTCPConnection(bool iOldFormat = false, EmuTCPServer* iRelayServer = 0, eTCPMode iMode = modePacket); // for outgoing connections
+6 -6
View File
@@ -65,12 +65,12 @@ LOG_TYPE( QUERYSERV, CLIENT, DISABLED )
LOG_TYPE( QUERYSERV, TRACE, DISABLED )
LOG_TYPE( QUERYSERV, PACKETS, DISABLED)
LOG_CATEGORY(SOCKET_SERVER)
LOG_TYPE(SOCKET_SERVER, INIT, ENABLED)
LOG_TYPE(SOCKET_SERVER, ERROR, ENABLED)
LOG_TYPE(SOCKET_SERVER, CLIENT, DISABLED)
LOG_TYPE(SOCKET_SERVER, TRACE, DISABLED)
LOG_TYPE(SOCKET_SERVER, PACKETS, DISABLED)
LOG_CATEGORY( WEB_INTERFACE )
LOG_TYPE( WEB_INTERFACE, INIT, ENABLED )
LOG_TYPE( WEB_INTERFACE, ERROR, ENABLED )
LOG_TYPE( WEB_INTERFACE, CLIENT, DISABLED )
LOG_TYPE( WEB_INTERFACE, TRACE, DISABLED )
LOG_TYPE( WEB_INTERFACE, PACKETS, DISABLED )
LOG_CATEGORY( SPAWNS )
LOG_TYPE( SPAWNS, MAIN, DISABLED )
+1 -1
View File
@@ -8,7 +8,7 @@ enum EQEmuExePlatform
ExePlatformWorld,
ExePlatformLogin,
ExePlatformQueryServ,
ExePlatformSocket_Server,
ExePlatformWebInterface,
ExePlatformUCS,
ExePlatformLaunch,
ExePlatformSharedMemory,