]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/servconf.cpp
Merge remote-tracking branch 'origin/stg-2.409' into ticket37
[stg.git] / stglibs / srvconf.lib / servconf.cpp
index d7df47040c1ba99a91f1653e7a687e78610fcba7..2f4afaba147bc7132d33bddfba5331197b9cb877 100644 (file)
@@ -92,17 +92,15 @@ sc->End(el);
 //-----------------------------------------------------------------------------
 SERVCONF::SERVCONF()
     : currParser(NULL),
 //-----------------------------------------------------------------------------
 SERVCONF::SERVCONF()
     : currParser(NULL),
-      parseDepth(0),
       error(0),
       RecvUserDataCb(NULL),
       RecvGetUserDataCb(NULL),
       error(0),
       RecvUserDataCb(NULL),
       RecvGetUserDataCb(NULL),
-      authByCallback(NULL),
       RecvServerInfoDataCb(NULL),
       RecvChgUserCb(NULL),
       RecvCheckUserCb(NULL),
       RecvSendMessageCb(NULL),
       getUserDataDataCb(NULL),
       RecvServerInfoDataCb(NULL),
       RecvChgUserCb(NULL),
       RecvCheckUserCb(NULL),
       RecvSendMessageCb(NULL),
       getUserDataDataCb(NULL),
-      authByData(NULL),
+      getUserAuthByDataCb(NULL),
       getUsersDataDataCb(NULL),
       getServerInfoDataCb(NULL),
       chgUserDataCb(NULL),
       getUsersDataDataCb(NULL),
       getServerInfoDataCb(NULL),
       chgUserDataCb(NULL),
@@ -112,6 +110,11 @@ SERVCONF::SERVCONF()
 parser = XML_ParserCreate(NULL);
 }
 //-----------------------------------------------------------------------------
 parser = XML_ParserCreate(NULL);
 }
 //-----------------------------------------------------------------------------
+SERVCONF::~SERVCONF()
+{
+XML_ParserFree(parser);
+}
+//-----------------------------------------------------------------------------
 void SERVCONF::SetServer(const char * server)
 {
 nt.SetServer(server);
 void SERVCONF::SetServer(const char * server)
 {
 nt.SetServer(server);
@@ -163,18 +166,18 @@ if ((ret = nt.Disconnect()) != st_ok)
 return st_ok;
 }
 //-----------------------------------------------------------------------------
 return st_ok;
 }
 //-----------------------------------------------------------------------------
-int SERVCONF::AuthBy(const char * l)
+int SERVCONF::GetUserAuthBy(const char * l)
 {
 char request[255];
 snprintf(request, 255, "<GetUserAuthBy login=\"%s\"/>", l);
 {
 char request[255];
 snprintf(request, 255, "<GetUserAuthBy login=\"%s\"/>", l);
+int ret;
 
 currParser = &parserAuthBy;
 
 currParser = &parserAuthBy;
-((PARSER_AUTH_BY*)currParser)->SetCallback(authByCallback, authByData);
+((PARSER_AUTH_BY*)currParser)->SetRecvCb(RecvAuthByCb, getUserAuthByDataCb);
 
 nt.Reset();
 nt.SetRxCallback(this, AnsRecv);
 
 
 nt.Reset();
 nt.SetRxCallback(this, AnsRecv);
 
-int ret;
 if ((ret = nt.Connect()) != st_ok)
     {
     errorMsg = nt.GetError();
 if ((ret = nt.Connect()) != st_ok)
     {
     errorMsg = nt.GetError();
@@ -401,10 +404,10 @@ RecvGetUserDataCb = f;            //GET_USER
 getUserDataDataCb = data;
 }
 //-----------------------------------------------------------------------------
 getUserDataDataCb = data;
 }
 //-----------------------------------------------------------------------------
-void SERVCONF::SetAuthByCallback(PARSER_AUTH_BY::CALLBACK f, void * data)
+void SERVCONF::SetGetUserAuthByRecvCb(RecvAuthByDataCb_t f, void * data)
 {
 {
-authByCallback = f;
-authByData = data;
+RecvAuthByCb = f;
+getUserAuthByDataCb = data;
 }
 //-----------------------------------------------------------------------------
 void SERVCONF::SetServerInfoRecvCb(RecvServerInfoDataCb_t f, void * data)
 }
 //-----------------------------------------------------------------------------
 void SERVCONF::SetServerInfoRecvCb(RecvServerInfoDataCb_t f, void * data)