]> git.stg.codes - stg.git/blobdiff - projects/sgauth/web.h
Move projects back into subfolder.
[stg.git] / projects / sgauth / web.h
index b734f16be9ca9f2ad4cd7e0acd680aef61a98c70..a933230a58df1e9cec1fe74de84cfc4bfac793b1 100644 (file)
 #include <string>
 #include <list>
 
-#include "stg_const.h"
-#include "ia_packets.h"
-
-using namespace std;
+#include "stg/const.h"
+#include "stg/ia_packets.h"
 
 #define MAX_MESSAGES    (10)
 //-----------------------------------------------------------------------------
 struct STG_MESSAGE
 {
-string  msg;
-string  recvTime;
+std::string  msg;
+std::string  recvTime;
 int     type;
 };
 //-----------------------------------------------------------------------------
@@ -58,15 +56,17 @@ class WEB
 public:
     WEB();
     void Run();
-    void SetDirName(const string & dn, int n);
+    void SetDirName(const std::string & dn, int n);
     void SetRefreshPagePeriod(int p);
     void SetListenAddr(uint32_t ip);
-    void AddMessage(const string & message, int type);
+    void AddMessage(const std::string & message, int type);
     void UpdateStat(const LOADSTAT & ls);
     void Start();
 private:
-
     void PrepareNet();
+    int SendReply();
+    int SendCSS();
+    int Redirect(const char * url);
 
     #ifdef WIN32
     WSADATA wsaData;
@@ -74,28 +74,15 @@ private:
     pthread_t thread;
     #endif
 
-    int         SendReply();
-    int         SendCSS();
-    int         Redirect(const char * url);
-
-    string      dirName[DIR_NUM];
-    int         res;
-    int         listenSocket;
-    int         outerSocket;
-    struct sockaddr_in listenAddr;
-    struct sockaddr_in outerAddr;
-    int         refreshPeriod;
-
-    uint32_t    listenWebAddr;
-    LOADSTAT    ls;
+    std::string dirName[DIR_NUM];
+    int res;
+    int listenSocket;
+    int outerSocket;
+    int refreshPeriod;
 
-    list<STG_MESSAGE> messages;
+    uint32_t listenWebAddr;
+    LOADSTAT ls;
 
-    #ifndef WIN32
-    socklen_t   outerAddrLen;
-    #else
-    int         outerAddrLen;
-    #endif
+    std::list<STG_MESSAGE> messages;
 };
 //-----------------------------------------------------------------------------
-