OSDN Git Service

生主トークン取得処理実装
authorqwerty2501 <riot313@gmail.com>
Sun, 12 Feb 2012 12:56:27 +0000 (21:56 +0900)
committerqwerty2501 <riot313@gmail.com>
Sun, 12 Feb 2012 12:56:27 +0000 (21:56 +0900)
18 files changed:
include/qwerty/qwerty_common.h
nlib/StdAfx.h
nlib/nlib.vcxproj
nlib/nlib.vcxproj.filters
nlib/nlib_common.cpp
nlib/nlib_common.h
nlib/nlib_define.h
nlib/nlib_errorMessage.cpp
nlib/nlib_include.h
nlib/nlib_nicoLive.cpp
nlib/nlib_nicoLive.h
nlib/nlib_nicoVideoAuth.h [new file with mode: 0644]
nlib/nlib_xmlHandler.cpp
nlib/nlib_xmlHandler.h
nlib_driver/nlib_driver.cpp
nlite.suo
nlite/nlite.rc
nlite/nlite_mainframe.cpp

index 1d8e009..f027f75 100644 (file)
 
 
 
-typedef struct  {
-       UINT64 nord;
-       void *userData;
 
-}UserDataContainer,*UserDataContainer_P;
 
 
 #define DOWNNORD(nord) ((nord) << 8)
index 62481cc..772f789 100644 (file)
@@ -6,6 +6,7 @@
 #define WIN32_LEAN_AND_MEAN             // Windows \83w\83b\83_\81[\82©\82ç\8eg\97p\82³\82ê\82Ä\82¢\82È\82¢\95\94\95ª\82ð\8f\9c\8aO\82µ\82Ü\82·\81B
 #define WINDEBUGER_NOPRINTING                          //\83f\83o\83b\83O\8fo\97Í\82ð\83R\83\93\83\\81[\83\8b\82É\95\\8e¦\82µ\82½\82­\82È\82¢\8fê\8d\87\92è\8b`\82·\82é
 #define USE_NLIB_KEEPALIVE                             //\83L\81[\83v\83A\83\89\83C\83u\82ð\8eg\97p\82·\82é\8fê\8d\87\92è\8b`
+//#define USE_NLIB_LIVEHISTORY                 //\83j\83R\90\82Ì\97\9a\97ð\8fî\95ñ\82ð\8eæ\93¾\82·\82é\8fê\8d\87\82É\8eg\97p
 #define PLAYERSTATUS_GET_TITLE                 //\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\82Å\83^\83C\83g\83\8b\82ð\8eæ\93¾\82·\82é\8fê\8d\87\82É\92è\8b`
 
 //windowsAPI\8aÖ\98A\83w\83b\83_
index 0d33b9b..447ea67 100644 (file)
     <ClInclude Include="nlib_include.h" />
     <ClInclude Include="nlib_myList.h" />
     <ClInclude Include="nlib_nicoLive.h" />
+    <ClInclude Include="nlib_nicoVideoAuth.h" />
     <ClInclude Include="nlib_xmlHandler.h" />
     <ClInclude Include="StdAfx.h" />
     <ClInclude Include="targetver.h" />
index 323c18b..3d36dd2 100644 (file)
@@ -71,5 +71,8 @@
     <ClInclude Include="targetver.h">
       <Filter>ヘッダー ファイル</Filter>
     </ClInclude>
+    <ClInclude Include="nlib_nicoVideoAuth.h">
+      <Filter>ヘッダー ファイル</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file
index 385bff6..fe44ffd 100644 (file)
@@ -145,12 +145,12 @@ static INLINE VOID Parser_Finalize(){
 
 }
 
VOID XMLParse(LPVOID option,LPCSTR body,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent){
NLIB_RESULT XMLParse(LPVOID option,LPCSTR body,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent){
 
        UserDataContainer userDataContainer;
        userDataContainer.nord = 0;
        userDataContainer.userData = option;
-
+       userDataContainer.errcode = NLIB_ERR_CODE_NOTSET;
 
        EnterCriticalSection(&playerStatusParserCs);
 
@@ -167,5 +167,86 @@ static INLINE VOID Parser_Finalize(){
 
        LeaveCriticalSection(&playerStatusParserCs);
 
+       return userDataContainer.errcode;
+}
+
+
+ NLIB_RESULT HttpXMLParse(LPVOID userData,LPCTSTR userSession,HINTERNET hConnect,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent){
+
+        NLIB_RESULT rslt = NLIB_ERR_CODE_NOTSET;
+       const UINT_PTR buflen = LENGTH_65536;
+       LPVOID buffer = malloc(buflen * 3);
+       {
+               
+               
+               
+               LPSTR recvBuffer = (LPSTR)buffer;
+               DWORD readSize;
+               DWORD statusCode;
+               DWORD statusCodeSize = sizeof(statusCode);
+
+
+       
+
+               if(WinHttpSendRequest(hConnect,userSession,-1,WINHTTP_NO_REQUEST_DATA,0,0,0) == FALSE){
+
+                       goto networkerr;
+
+               }
+
+               if(WinHttpReceiveResponse(hConnect,NULL) == FALSE){
+
+                       goto networkerr;
+
+               }
+
+
+               if (WinHttpQueryHeaders(hConnect,WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER,WINHTTP_HEADER_NAME_BY_INDEX,&statusCode,&statusCodeSize,WINHTTP_NO_HEADER_INDEX) == FALSE){
+                       goto networkerr;
+               }
+
+
+               if (HTTP_STATUS_OK != statusCode){
+                       goto networkerr;
+               }
+
+
+
+
+               if(ReadHttpBody(hConnect,(LPBYTE)recvBuffer,buflen,&readSize) == FALSE){
+
+                       goto networkerr;
+
+               }
+
+               recvBuffer[readSize] = '\0';
+
+               recvBuffer = strstr(recvBuffer,"<");
+
+               if(recvBuffer == NULL){
+                       
+                       goto networkerr;
+               }
+
+
+               rslt = XMLParse(userData,recvBuffer,startElementEvent,endElementEvent,characterDataEvent);
+               
+               if(rslt != NLIB_ERR_OK){
+
+                       goto end;
+               }
+       }
+
+end:
+       free(buffer);
+       
+
+       
+
+       return rslt;
+
+networkerr:
+       rslt = NLIB_FAILED_CONNECT;
 
-}
\ No newline at end of file
+       goto end;
+ }
\ No newline at end of file
index da77bef..86e9186 100644 (file)
@@ -6,12 +6,11 @@
 #define USER_AGENT  WTEXT("nlib/")  WTEXT(TOSTR(NLIB_VERTION)) WTEXT(" (qwerty ") WTEXT(__DATE__) WTEXT(")")
 
 
-typedef struct nicovideoauth_t{
-
-       TCHAR userSession[LENGTH_256];
-
-
-}NicoVideoAuth;
+typedef struct  {
+       UINT64 nord;
+       void *userData;
+       NLIB_RESULT errcode;
+}UserDataContainer,*UserDataContainer_P;
 
 ///
 ///http\83Z\83b\83V\83\87\83\93\83n\83\93\83h\83\8b
@@ -51,4 +50,7 @@ extern XML_Parser xmlParser;
 ///
 ///\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\83p\81[\83X\8f\88\97\9d
 ///
-extern VOID XMLParse(LPVOID option,LPCSTR body,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent);
\ No newline at end of file
+extern NLIB_RESULT XMLParse(LPVOID option,LPCSTR body,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent);
+
+
+extern NLIB_RESULT HttpXMLParse(LPVOID userData,LPCTSTR userSession,HINTERNET hConnect,XML_StartElementHandler startElementEvent,XML_EndElementHandler endElementEvent,XML_CharacterDataHandler characterDataEvent);
\ No newline at end of file
index 266252b..8d0ee0f 100644 (file)
@@ -88,8 +88,8 @@
 ///\83\86\81[\83U\81[\83Z\83b\83V\83\87\83\93\95\8e\9a\97ñ\82ª\92·\82·\82¬\82é
 #define NLIB_USERSESSION_FAILED_TOOBIG                                                                                 ((NLIB_RESULT)6)
 
-///\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\90Ú\91±\82É\8e¸\94s\82µ\82½
-#define NLIB_GETPLAYERSTATUS_FAILED_CONNECT                                                                            ((NLIB_RESULT)7)
+///\90Ú\91±\82É\8e¸\94s\82µ\82½
+#define NLIB_FAILED_CONNECT                                                                                                    ((NLIB_RESULT)7)
 
 ///\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\8eæ\93¾\83G\83\89\81[\81Finvalid_lv\82ª\94­\90\82µ\82½
 #define NLIB_ERR_GETPLAYERSTATUS_INVALID_LV                                                                            ((NLIB_RESULT)8)
 ///\83n\81[\83g\83r\81[\83g\83T\81[\83o\81[\90Ú\91±\82É\8e¸\94s
 #define NLIB_HEARTBEAT_FAILED_CONNECT                                                                                  ((NLIB_RESULT)40)
 
+///\90\8eå\8fî\95ñ\83X\83e\81[\83^\83X\83G\83\89\81[\94­\90
+#define NLIB_ERR_PUBLISHSTATUS_ERROR                                                                                   ((NLIB_RESULT)41)
+
+
+
+
+
+
+
+
+
 ///\83G\83\89\81[\83R\81[\83h\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82È\82¢
 #define NLIB_ERR_CODE_NOTSET                                                                                                   ((NLIB_RESULT)0xFFFFFFFF)
 
index 2dba7a1..1744964 100644 (file)
@@ -29,8 +29,8 @@ DECLARE_NLIB_ERROR_MESSAGE(NLIB_LIVENO_FAILED_UNDEFEINE,TEXT("
 //NLIB_USERSESSION_FAILED_TOOBIG
 DECLARE_NLIB_ERROR_MESSAGE(NLIB_USERSESSION_FAILED_TOOBIG,TEXT("\83\86\81[\83U\81[\83Z\83b\83V\83\87\83\93\82Ì\95\8e\9a\97ñ\82ª\92·\82·\82¬\82Ü\82·"));
 
-//NLIB_GETPLAYERSTATUS_FAILED_CONNECT
-DECLARE_NLIB_ERROR_MESSAGE(NLIB_GETPLAYERSTATUS_FAILED_CONNECT,TEXT("\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\83T\81[\83o\81[\82Ö\82Ì\90Ú\91±\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
+//NLIB_FAILED_CONNECT
+DECLARE_NLIB_ERROR_MESSAGE(NLIB_FAILED_CONNECT,TEXT("\83T\81[\83o\81[\82Ö\82Ì\90Ú\91±\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
 
 //NLIB_ERR_GETPLAYERSTATUS_INVALID_LV
 DECLARE_NLIB_ERROR_MESSAGE(NLIB_ERR_GETPLAYERSTATUS_INVALID_LV,TEXT("\96³\8cø\82È\95ú\91\97\94Ô\8d\86\82Å\82·"));
@@ -134,6 +134,10 @@ DECLARE_NLIB_ERROR_MESSAGE(NLIB_ERR_GETPLAYERSTATUS_CHANT_PARSE,TEXT("
 ///NLIB_HEARTBEAT_FAILED_CONNECT
 DECLARE_NLIB_ERROR_MESSAGE(NLIB_HEARTBEAT_FAILED_CONNECT,TEXT("\83n\81[\83g\83r\81[\83g\83T\81[\83o\81[\82Ö\82Ì\90Ú\91±\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
 
+///NLIB_ERR_PUBLISHSTATUS_ERROR
+DECLARE_NLIB_ERROR_MESSAGE(NLIB_ERR_PUBLISHSTATUS_ERROR,TEXT("\90\8eå\8fî\95ñ\8eæ\93¾\82ª\8e¸\94s\82µ\82Ü\82µ\82½"));
+
+
 #define NLIB_ERRMESSAGE_TABLE_START(c) switch(c){
 
 
@@ -159,7 +163,7 @@ LPCTSTR NLIB_GetErrorMessage(NLIB_RESULT rsltCode){
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_LIVENO_FAILED_TOOBIG)
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_LIVENO_FAILED_UNDEFEINE)
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_USERSESSION_FAILED_TOOBIG)
-               NLIB_ERRMESSAGE_CASE(errmes,NLIB_GETPLAYERSTATUS_FAILED_CONNECT)
+               NLIB_ERRMESSAGE_CASE(errmes,NLIB_FAILED_CONNECT)
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_ERR_GETPLAYERSTATUS_INVALID_LV)
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_ERR_GETPLAYERSTATUS_INVALID_THREAD)
                NLIB_ERRMESSAGE_CASE(errmes,NLIB_ERR_GETPLAYERSTATUS_CLOSED)
index 1ecec26..ab8ac1e 100644 (file)
@@ -29,6 +29,7 @@
 #include "nlib.h"
 #include "nlib_common.h"
 #include "nlib_define.h"
+#include "nlib_nicoVideoAuth.h"
 #include "nlib_mylist.h"
 
 #include "nlib_xmlHandler.h"
index c49b4ad..72261fa 100644 (file)
@@ -73,10 +73,13 @@ static CRITICAL_SECTION heartBeatCs;
 //\83v\83\89\83C\83x\81[\83g\8aÖ\90\94
 //
 
+
+
 ///
 ///\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\8eæ\93¾
 ///
-static INLINE NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P pPlayerStatus,LPCTSTR userSession,HINTERNET hConnect,LPVOID buffer);
+//static INLINE NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P pPlayerStatus,LPCTSTR userSession,HINTERNET hConnect,LPVOID buffer);
+static INLINE NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P pPlayerStatus,LPCTSTR userSession,HINTERNET hConnect);
 
 ///
 ///nicoLiveHistory\8eæ\93¾
@@ -84,7 +87,10 @@ static INLINE NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P pPlayerStatus,L
 static INLINE NLIB_RESULT GetNicoLiveHistory(NicoLiveStream_P self,HINTERNET hConnect);
 
 
-
+///
+///\90\8eå\8fî\95ñ\8eæ\93¾
+///
+static INLINE NLIB_RESULT GetPublishStatus(NicoLivePublishStatus_P self,LPCTSTR userSession,HINTERNET hConnect);
 
 
 
@@ -535,17 +541,31 @@ NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVid
 
        //\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\8eæ\93¾
        EnterCriticalSection(&self->sessionManager.cs);
-       rslt = GetPlayerStatus(&self->playerStatus,self->userSession,self->sessionManager.getPlayerStatusSession,self->sessionManager.buffer);
+       rslt = GetPlayerStatus(&self->playerStatus,self->userSession,self->sessionManager.getPlayerStatusSession);
 
        
        LeaveCriticalSection(&self->sessionManager.cs);
 
        if(rslt != NLIB_ERR_OK){
 
-               goto end;
+               goto connecterr;
        }
 
 
+       if(self->playerStatus.stream.is_owner == TRUE){
+               TCHAR objectName[LENGTH_256] = {L"api/getpublishstatus?v="};
+               wcsncat(objectName,self->playerStatus.stream.id,sizeof(objectName) / sizeof(objectName[0]));
+               EnterCriticalSection(&self->sessionManager.cs);
+               self->sessionManager.getPublishStatusSession = WinHttpOpenRequest(hWatchLiveNicoConnect,L"GET",objectName,L"1.1",(LPCTSTR)WINHTTP_NO_REFERER,(LPCTSTR*)WINHTTP_DEFAULT_ACCEPT_TYPES,0);
+               rslt = GetPublishStatus(&self->publishStatus,self->userSession,self->sessionManager.getPublishStatusSession);
+               LeaveCriticalSection(&self->sessionManager.cs);
+       }
+
+       if(rslt != NLIB_ERR_OK){
+
+               goto connecterr;
+
+       }
 
        //\90\95ú\91\97\83I\83u\83W\83F\83N\83g\82É\8ae\88ø\90\94\82ð\90Ý\92è
 
@@ -565,6 +585,11 @@ end:
        
 
        return rslt;
+
+connecterr:
+
+       NicoLiveStream_disConnect(self);
+       goto end;
 }
 
 
@@ -577,19 +602,14 @@ NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self){
                rslt = NLIB_ERR_NOT_LIVECONNECT;
                goto end;
        }
-       if(self == NULL || self->playerStatus.error != NLIB_ERR_OK){
-
-               rslt = NLIB_ERR_PLAYERSTATUS_ERROR;
-               goto end;
-
-       }
+       
 
 
        EnterCriticalSection(&self->sessionManager.cs);
        {
 
                const UINT_PTR buflen = LENGTH_65536;
-               LPVOID buffer = self->sessionManager.buffer;
+               LPVOID buffer = malloc(buflen * 3);
         
                LPTSTR objectName = (LPTSTR)buffer;
                LPTSTR indexPtr;
@@ -675,7 +695,8 @@ NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self){
 
                rslt = NLIB_ERR_OK;
 connectend:
-               ZeroMemory(self->sessionManager.buffer,sizeof(self->sessionManager.buffer));
+               free(buffer);
+               //ZeroMemory(self->sessionManager.buffer,sizeof(self->sessionManager.buffer));
                LeaveCriticalSection(&self->sessionManager.cs);
 
 
@@ -690,7 +711,7 @@ end:
 
 VOID NicoLiveStream_disConnect(NicoLiveStream_P self){
 
-       if(self == NULL || self->isConnecting == FALSE)goto end;
+       if(self == NULL)goto end;
 
        DWORD waitRslt = WSA_WAIT_TIMEOUT;
 
@@ -714,7 +735,8 @@ VOID NicoLiveStream_disConnect(NicoLiveStream_P self){
        self->sessionManager.getPlayerStatusSession = NULL;
        WinHttpCloseHandle(self->sessionManager.heartBeatSession);
        self->sessionManager.heartBeatSession = NULL;
-
+       WinHttpCloseHandle(self->sessionManager.getPublishStatusSession);
+       self->sessionManager.getPublishStatusSession = NULL;
 
 
        self->isConnecting = FALSE;
@@ -740,8 +762,8 @@ NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTST
        
        {
                const UINT_PTR buflen = LENGTH_65536 * 4;
-               LPVOID chunk = self->sessionManager.buffer;
-
+               //LPVOID chunk = self->sessionManager.buffer;
+               LPVOID chunk = malloc(buflen);
                LPSTR postKey;
                LPSTR postKeyBuf = (LPSTR)chunk;
                LPTSTR postKeyReqBuf = (LPTSTR)&postKeyBuf[NICOLIVE_SENDCHATBUFLEN];
@@ -1081,8 +1103,8 @@ NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTST
 errorend:
        
                WinHttpCloseHandle(hGetPostKeySession);
-
-               ZeroMemory(self->sessionManager.buffer,sizeof(self->sessionManager.buffer));
+               free(chunk);
+               //ZeroMemory(self->sessionManager.buffer,sizeof(self->sessionManager.buffer));
                LeaveCriticalSection(&self->sessionManager.cs);
                }
 
@@ -1104,86 +1126,18 @@ errorend:
 
 
 
-NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P self,LPCTSTR userSession,HINTERNET hConnect,LPVOID buffer){
-
-       NLIB_RESULT rslt = NLIB_ERR_OK;
-
-       
-       {
-               
-               const UINT_PTR buflen = LENGTH_65536;
-               
-               LPSTR recvBuffer = (LPSTR)buffer;
-               DWORD readSize;
-               DWORD statusCode;
-               DWORD statusCodeSize = sizeof(statusCode);
-
-
-       
-
-               if(WinHttpSendRequest(hConnect,userSession,-1,WINHTTP_NO_REQUEST_DATA,0,0,0) == FALSE){
-
-                       rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
-                       goto end;
-
-               }
-
-               if(WinHttpReceiveResponse(hConnect,NULL) == FALSE){
-
-                       rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
-                       goto end;
-
-               }
-
-
-               if (WinHttpQueryHeaders(hConnect,WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER,WINHTTP_HEADER_NAME_BY_INDEX,&statusCode,&statusCodeSize,WINHTTP_NO_HEADER_INDEX) == FALSE){
-                       rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
-                       goto end;
-               }
-
-
-               if (HTTP_STATUS_OK != statusCode){
-                       rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
-                       goto end;
-               }
-
-
-
-
-               if(ReadHttpBody(hConnect,(LPBYTE)recvBuffer,buflen,&readSize) == FALSE){
+//NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P self,LPCTSTR userSession,HINTERNET hConnect,LPVOID buffer){
+NLIB_RESULT GetPlayerStatus(NicoLivePlayerStatus_P self,LPCTSTR userSession,HINTERNET hConnect){
 
-                       rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
-                       goto end;
-
-               }
 
-               recvBuffer[readSize] = '\0';
+       return HttpXMLParse(self,userSession,hConnect,NPlayerStatus_ElementStartHandler,NPlayerStatus_ElementEndHandler,NPlayerStatus_CharacterDataHandler);
 
-               recvBuffer = strstr(recvBuffer,"<");
-
-               if(recvBuffer == NULL){
-                       
-                       rslt = NLIB_ERR_GETPLAYERSTATUS_CHANT_PARSE;
-                       goto end;
-               }
-               idumpln_mb(CP_UTF8,"playerstatus:%s",recvBuffer);
-
-
-               XMLParse(self,recvBuffer,NPlayerStatus_ElementStartHandler,NPlayerStatus_ElementEndHandler,NPlayerStatus_CharacterDataHandler);
-               rslt = self->error;
-               if(rslt != NLIB_ERR_OK){
-
-                       goto end;
-               }
-       }
-
-end:
+}
 
-       
+static INLINE NLIB_RESULT GetPublishStatus(NicoLivePublishStatus_P self,LPCTSTR userSession,HINTERNET hConnect){
 
-       
 
-       return rslt;
+       return HttpXMLParse(self,userSession,hConnect,NPublishStatus_ElementStartHandler,NPublishStatus_ElementEndHandler,NPublishStatus_CharacterDataHandler);
 
 }
 
@@ -1191,6 +1145,8 @@ end:
 #define GETNICOLIVEHIS_OBJNAMELENGTH   LENGTH_256
 #define GETNICOLIVEHIS_COOKIELENGTH            LENGTH_512
 
+#ifdef USE_NLIB_LIVEHISTORY
+
 static INLINE NLIB_RESULT GetNicoLiveHistory(NicoLiveStream_P self,HINTERNET hConnect){
 
        NLIB_RESULT rslt = NLIB_ERR_OK;
@@ -1234,33 +1190,33 @@ static INLINE NLIB_RESULT GetNicoLiveHistory(NicoLiveStream_P self,HINTERNET hCo
 
        if(WinHttpSendRequest(hStreamBrowse,cookie,-1,WINHTTP_NO_REQUEST_DATA,0,0,0) == FALSE){
 
-               rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
+               rslt = NLIB_FAILED_CONNECT;
                goto end;
 
        }
 
        if(WinHttpReceiveResponse(hStreamBrowse,NULL) == FALSE){
 
-               rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
+               rslt = NLIB_FAILED_CONNECT;
                goto end;
 
        }
 
        if (WinHttpQueryHeaders(hStreamBrowse,WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER,WINHTTP_HEADER_NAME_BY_INDEX,&statusCode,&statusCodeSize,WINHTTP_NO_HEADER_INDEX) == FALSE){
-               rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
+               rslt = NLIB_FAILED_CONNECT;
                goto end;
        }
 
 
        if (HTTP_STATUS_OK != statusCode){
-               rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
+               rslt = NLIB_FAILED_CONNECT;
                goto end;
        }
 
 
 
        if (WinHttpQueryHeaders(hStreamBrowse,WINHTTP_QUERY_SET_COOKIE,WINHTTP_HEADER_NAME_BY_INDEX,buffer,&chunkSize,WINHTTP_NO_HEADER_INDEX) == FALSE){
-               rslt = NLIB_GETPLAYERSTATUS_FAILED_CONNECT;
+               rslt = NLIB_FAILED_CONNECT;
                goto end;
        }
 
@@ -1295,6 +1251,7 @@ end:
 
 
 }
+#endif
 
 
 
index faf781f..b9e4ff9 100644 (file)
@@ -21,7 +21,7 @@ typedef struct {
        INT_PTR is_restrictSize;
        LPTSTR ticketBuff;
        INT_PTR ticketSize;
-       NLIB_RESULT error;
+//     NLIB_RESULT error;
 
 }NicoLiveHeartBeatContainer,*NicoLiveHeartBeatContainer_P;
 
@@ -113,13 +113,19 @@ typedef struct nicoliveplayerstatus_t{
        StreamStatus                    stream;
        MessageServerStatus             ms;
        NicoLivePSOwn                   user;
-       NLIB_RESULT                             error;
 }NicoLivePlayerStatus,*NicoLivePlayerStatus_P;
 
+
+//\83j\83R\83j\83R\90\95ú\91\97\90\8eå\8fî\95ñ\83X\83e\81[\83^\83X
+typedef struct nicolivepublishstatus_t{
+
+       TCHAR token[LENGTH_256];
+}NicoLivePublishStatus,*NicoLivePublishStatus_P;
+
 typedef struct {
        HINTERNET getPlayerStatusSession;
+       HINTERNET getPublishStatusSession;
        HINTERNET heartBeatSession;
-       CHAR buffer[LENGTH_65536 * 5];
        CRITICAL_SECTION cs;
 }SessionManager,*SessionManager_P;
 
@@ -130,10 +136,13 @@ typedef struct {
 
 typedef struct nicolivestream_t{
        TCHAR userSession[USERSESSION_LENGTH];
+#ifdef USE_NLIB_LIVEHISTORY
        TCHAR nicoLiveHistory[NICOLIVEHISTORY_LENGTH];
+#endif
        TCHAR ticket[LENGTH_256];
        LPVOID option;
        NicoLivePlayerStatus playerStatus;
+       NicoLivePublishStatus publishStatus;
        ChatManager chatManager;
        NicoRecvCallBack callBack;
        INT_PTR res_from;
diff --git a/nlib/nlib_nicoVideoAuth.h b/nlib/nlib_nicoVideoAuth.h
new file mode 100644 (file)
index 0000000..57b3981
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+
+typedef struct nicovideoauth_t{
+
+       TCHAR userSession[LENGTH_256];
+
+
+}NicoVideoAuth;
\ No newline at end of file
index 0bee8eb..7242d79 100644 (file)
@@ -53,6 +53,18 @@ enum StreamInfo_NORD{
 };
 
 
+enum NicoLivePublishStatus_NORD{
+       NicoLivePublish_ROOT,
+       NicoLivePublish_PUBLISHSTATUS,
+       NicoLivePublish_NICOLIVE_API,
+       NicoLivePublish_STREAM,
+       NicoLivePublish_ERROR,
+       NicoLivePublish_TOKEN,
+       NicoLivePublish_CODE
+
+};
+
+
 
 #define StrCpyArray(buf,pszData,nLength) StrCpy(buf,sizeof(buf) / sizeof(buf[0]),pszData,nLength)
 
@@ -64,6 +76,110 @@ static INLINE NLIB_RESULT StrCpy(LPTSTR buf,UINT_PTR buflen,LPCTSTR pszData,UINT
 static INLINE VOID ToUTF8(LPSTR buf,LPCTSTR input,INT_PTR nLength,INT_PTR maxLength);
 
 
+static INLINE NLIB_RESULT convToResultCode(LPCTSTR pszData,UINT nLength){
+
+       NLIB_RESULT rslt = NLIB_ERR_CODE_NOTSET;
+
+       if(_tcsncmp(pszData,TEXT("invalid_lv"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_INVALID_LV;
+                       
+       }else if(_tcsncmp(pszData,TEXT("invalid_thread"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_INVALID_THREAD;
+
+       }else if( _tcsncmp(pszData,TEXT("notfound"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_NOTFOUND;
+
+       }else if(_tcsncmp(pszData,TEXT("notlogin"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_NOTLOGIN;
+
+       }else if(_tcsncmp(pszData,TEXT("not_permitted"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_NOT_PERMITTED;
+
+       }else if(_tcsncmp(pszData,TEXT("maintenance"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_MAINTENANCE;
+
+       }else if(_tcsncmp(pszData,TEXT("closed"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_CLOSED;
+
+       } else if(_tcsncmp(pszData,TEXT("unknown"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_UNKNOWN;
+
+       }else if(_tcsncmp(pszData,TEXT("unknown_error"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_UNKNOWN_ERROR;
+
+       } else if(_tcsncmp(pszData,TEXT("server_error"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_SERVER_ERROR;
+                       
+
+       } else if(_tcsncmp(pszData,TEXT("DELETED"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_DELETED;
+
+       } else if(_tcsncmp(pszData,TEXT("full"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_FULL;
+
+       } else if(_tcsncmp(pszData,TEXT("permission_denied"),nLength) == 0){
+                       
+               rslt = NLIB_ERR_GETPLAYERSTATUS_PERMISSION_DENIED;
+                       
+       }else if(_tcsncmp(pszData,TEXT("require_accept_print_timeshift_ticket"),nLength) == 0) {
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_REQUIRE_ACCEPT_PRINT_TIMESHIFT_TICKET;
+
+
+       }else if(_tcsncmp(pszData,TEXT("access_locked"),nLength) == 0) {
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_ACCESS_LOCKED;
+
+
+       }else if(_tcsncmp(pszData,TEXT("tsarchive"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_TSARCHIVE;
+
+       } else if(_tcsncmp(pszData,TEXT("usertimeshift"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_USERTIMESHIFT;
+
+       } else if(_tcsncmp(pszData,TEXT("require_community_member"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_REQUIRE_COMMUNITY_MEMBER;
+
+       } else if(_tcsncmp(pszData,TEXT("comingsoon"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_COMINGSOON;
+
+       }else if(_tcsncmp(pszData,TEXT("noauth"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_NOAUTH;
+
+       } else if(_tcsncmp(pszData,TEXT("block_now_count_overflow"),nLength) == 0){
+
+               rslt = NLIB_ERR_GETPLAYERSTATUS_BLOCK_NOW_COUNT_OVERFLOW;
+
+       }else {
+               std::wstring errmessage(TEXT("\8c©\8am\94F\82Ì\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\83G\83\89\81[:"));
+               errmessage.append(pszData,nLength);
+               rslt = NLIB_ERR_GETPLAYERSTATUS_UNDEFINED;
+               throw nlib::Exception(errmessage.c_str(),__LINE__,TEXT(__FILE__),TEXT(__FILE__));
+                       
+
+                       
+                       
+       }
+       return rslt;
+
+}
 
 
 
@@ -93,12 +209,12 @@ extern void NPlayerStatus_ElementStartHandler(void *userData,const XML_Char *psz
                                if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) == 0){
 
                                        
-                                               ps->error = NLIB_ERR_OK;
+                                               userDataContainer->errcode = NLIB_ERR_OK;
 
 
                                }else if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) != 0){
 
-                                       ps->error = NLIB_ERR_PLAYERSTATUS_ERROR;
+                                       userDataContainer->errcode = NLIB_ERR_PLAYERSTATUS_ERROR;
                                }
 
 
@@ -273,7 +389,7 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
                
 
                
-               ps->error =  StrCpyArray(ps->ms.addr,pszData,nLength);
+               userDataContainer->errcode =  StrCpyArray(ps->ms.addr,pszData,nLength);
 
 
                break;
@@ -284,7 +400,7 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
                
                
 
-               ps->error =  StrCpyArray(ps->ms.port,pszData,nLength);
+               userDataContainer->errcode =  StrCpyArray(ps->ms.port,pszData,nLength);
                
                
 
@@ -338,7 +454,7 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
        case MAKENORD2(NPlayerStatus_GETPLAYERSTATUS,NPlayerStatus_STREAM,NPlayerStatus_ID):
 
                
-               ps->error =  StrCpyArray(ps->stream.id,pszData,nLength);
+               userDataContainer->errcode =  StrCpyArray(ps->stream.id,pszData,nLength);
 
                break;
                
@@ -356,14 +472,14 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
        case MAKENORD2(NPlayerStatus_GETPLAYERSTATUS,NPlayerStatus_USER,NPlayerStatus_USER_ID):
 
                
-               ps->error = StrCpyArray(ps->user.user_id,pszData,nLength);
+               userDataContainer->errcode = StrCpyArray(ps->user.user_id,pszData,nLength);
 
                break;
                
                //getplayerstatus/user/userDomein
        case MAKENORD2(NPlayerStatus_GETPLAYERSTATUS,NPlayerStatus_USER,NPlayerStatus_USER_DOMEIN):
 
-               ps->error = StrCpyArray(ps->user.userDomain,pszData,nLength);
+               userDataContainer->errcode = StrCpyArray(ps->user.userDomain,pszData,nLength);
 
                break;
 
@@ -390,7 +506,7 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
        case MAKENORD2(NPlayerStatus_GETPLAYERSTATUS,NPlayerStatus_STREAM,NPlayerStatus_DEFAULT_COMMUNITY):
 
                
-               ps->error =  StrCpyArray(ps->stream.default_community,pszData,nLength);
+               userDataContainer->errcode =  StrCpyArray(ps->stream.default_community,pszData,nLength);
 
                break;
 
@@ -416,102 +532,7 @@ void NPlayerStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,i
 
                
                
-               if(_tcsncmp(pszData,TEXT("invalid_lv"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_INVALID_LV;
-                       
-               }else if(_tcsncmp(pszData,TEXT("invalid_thread"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_INVALID_THREAD;
-
-               }else if( _tcsncmp(pszData,TEXT("notfound"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_NOTFOUND;
-
-               }else if(_tcsncmp(pszData,TEXT("notlogin"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_NOTLOGIN;
-
-               }else if(_tcsncmp(pszData,TEXT("not_permitted"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_NOT_PERMITTED;
-
-               }else if(_tcsncmp(pszData,TEXT("maintenance"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_MAINTENANCE;
-
-               }else if(_tcsncmp(pszData,TEXT("closed"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_CLOSED;
-
-               } else if(_tcsncmp(pszData,TEXT("unknown"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_UNKNOWN;
-
-               }else if(_tcsncmp(pszData,TEXT("unknown_error"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_UNKNOWN_ERROR;
-
-               } else if(_tcsncmp(pszData,TEXT("server_error"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_SERVER_ERROR;
-                       
-
-               } else if(_tcsncmp(pszData,TEXT("DELETED"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_DELETED;
-
-               } else if(_tcsncmp(pszData,TEXT("full"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_FULL;
-
-               } else if(_tcsncmp(pszData,TEXT("permission_denied"),nLength) == 0){
-                       
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_PERMISSION_DENIED;
-                       
-               }else if(_tcsncmp(pszData,TEXT("require_accept_print_timeshift_ticket"),nLength) == 0) {
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_REQUIRE_ACCEPT_PRINT_TIMESHIFT_TICKET;
-
-
-               }else if(_tcsncmp(pszData,TEXT("access_locked"),nLength) == 0) {
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_ACCESS_LOCKED;
-
-
-               }else if(_tcsncmp(pszData,TEXT("tsarchive"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_TSARCHIVE;
-
-               } else if(_tcsncmp(pszData,TEXT("usertimeshift"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_USERTIMESHIFT;
-
-               } else if(_tcsncmp(pszData,TEXT("require_community_member"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_REQUIRE_COMMUNITY_MEMBER;
-
-               } else if(_tcsncmp(pszData,TEXT("comingsoon"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_COMINGSOON;
-
-               }else if(_tcsncmp(pszData,TEXT("noauth"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_NOAUTH;
-
-               } else if(_tcsncmp(pszData,TEXT("block_now_count_overflow"),nLength) == 0){
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_BLOCK_NOW_COUNT_OVERFLOW;
-
-               }else {
-                       std::wstring errmessage(TEXT("\8c©\8am\94F\82Ì\83v\83\8c\83C\83\84\81[\83X\83e\81[\83^\83X\83G\83\89\81[:"));
-                       errmessage.append(pszData,nLength);
-                       throw nlib::Exception(errmessage.c_str(),__LINE__,TEXT(__FILE__),TEXT(__FILE__));
-                       
-
-                       ps->error = NLIB_ERR_GETPLAYERSTATUS_UNDEFINED;
-                       
-               }
+               userDataContainer->errcode = convToResultCode(pszData,nLength);
 
                
 
@@ -561,12 +582,12 @@ void NicoLiveHeartBeat_ElementStartHandler(void *userData,const XML_Char *pszNam
                                if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) == 0){
 
                                        
-                                               hbc->error = NLIB_ERR_OK;
+                                               userDataContainer->errcode = NLIB_ERR_OK;
 
 
                                }else if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) != 0){
 
-                                       hbc->error = NLIB_ERR_HEARTBEAT_ERROR;
+                                       userDataContainer->errcode = NLIB_ERR_HEARTBEAT_ERROR;
                                }else if(_tcscmp(atts[index],TEXT("time")) == 0){
 
                                        hbc->heartBeat.time = wcstoul(atts[index + 1],NULL,0);
@@ -716,3 +737,146 @@ static INLINE NLIB_RESULT StrCpy(LPTSTR buf,UINT_PTR buflen,LPCTSTR pszData,UINT
 
 }
 
+
+void NPublishStatus_ElementStartHandler(void *userData,const XML_Char *pszName,const XML_Char *atts[]){
+       UserDataContainer_P userDataContainer = (UserDataContainer_P)userData;
+       NicoLivePublishStatus_P ps = (NicoLivePublishStatus_P)userDataContainer->userData;
+
+       enum NicoLivePublishStatus_NORD element  = NicoLivePublish_ROOT;
+
+       switch (userDataContainer->nord){
+
+               //\90e\83m\81[\83h
+       case (MAKENORD(NicoLivePublish_ROOT)):
+       
+               
+               if(_tcscmp(pszName,TEXT("getpublishstatus")) == 0){
+
+                       
+
+                       UINT_PTR index;
+
+                       for(index = 0;atts[index] != NULL;index += 2){
+
+                               if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) == 0){
+
+                                       
+                                               userDataContainer->errcode = NLIB_ERR_OK;
+
+
+                               }else if(_tcscmp(atts[index],TEXT("status")) == 0 && _tcscmp(atts[index + 1],TEXT("ok")) != 0){
+
+                                       userDataContainer->errcode = NLIB_ERR_PUBLISHSTATUS_ERROR;
+                               }
+
+
+                       }
+
+                       element = NicoLivePublish_PUBLISHSTATUS;
+
+
+
+                       
+
+
+               } else if(_tcscmp(pszName,TEXT("nicolive_api")) == 0){
+
+                       element = NicoLivePublish_NICOLIVE_API;
+
+               }
+               break;
+
+
+       case (MAKENORD(NicoLivePublish_PUBLISHSTATUS)):
+       case (MAKENORD(NicoLivePublish_NICOLIVE_API)):
+
+               if(_tcscmp(pszName,TEXT("stream"))== 0){
+
+                       element = NicoLivePublish_STREAM;
+                       
+
+
+               }else if(_tcscmp(pszName,TEXT("error"))== 0){
+
+                       element = NicoLivePublish_ERROR;
+
+               }
+               break;
+       case (MAKENORD1(NicoLivePublish_PUBLISHSTATUS,NicoLivePublish_STREAM)):
+
+               if(_tcscmp(pszName,TEXT("token")) == 0){
+
+                       element = NicoLivePublish_TOKEN;
+
+               }
+
+               break;
+
+       case (MAKENORD1(NicoLivePublish_PUBLISHSTATUS,NicoLivePublish_ERROR)):
+       case (MAKENORD1(NicoLivePublish_NICOLIVE_API,NicoLivePublish_ERROR)):
+
+               if(_tcscmp(pszName,TEXT("code"))==0){
+
+                       element = NicoLivePublish_CODE;
+
+               }
+
+               break;
+
+
+       default:
+
+
+               break;
+
+       }
+
+       userDataContainer->nord = MAKENORD1(userDataContainer->nord,element);
+
+       return;
+}
+
+void NPublishStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,int nLength){
+       UserDataContainer_P userDataContainer = (UserDataContainer_P)userData;
+       NicoLivePublishStatus_P ps = (NicoLivePublishStatus_P)userDataContainer->userData;
+
+
+       switch(userDataContainer->nord){
+
+       case (MAKENORD2(NicoLivePublish_PUBLISHSTATUS,NicoLivePublish_STREAM,NicoLivePublish_TOKEN)):
+
+               if(nLength < ARRAY_LENGTH(ps->token)){
+                       _tcsncpy(ps->token,pszData,nLength);
+               } else {
+
+                       userDataContainer->errcode = NLIB_ERR_BUFFER_TOOLITTLE;
+
+               }
+
+               break;
+
+       case MAKENORD2(NicoLivePublish_PUBLISHSTATUS,NicoLivePublish_ERROR,NicoLivePublish_CODE):
+       case MAKENORD2(NicoLivePublish_NICOLIVE_API,NicoLivePublish_ERROR,NicoLivePublish_CODE):
+
+               userDataContainer->errcode = convToResultCode(pszData,nLength);
+
+               break;
+
+       default:
+
+               break;
+       }
+
+       return;
+}
+
+void NPublishStatus_ElementEndHandler(void *userData,const XML_Char *pszName){
+       UserDataContainer_P userDataContainer = (UserDataContainer_P)userData;
+       NicoLivePublishStatus_P ps = (NicoLivePublishStatus_P)userDataContainer->userData;
+
+
+       userDataContainer->nord = UPNORD(userDataContainer->nord);
+
+       return;
+
+}
\ No newline at end of file
index a0babc8..b7f294b 100644 (file)
@@ -48,3 +48,19 @@ extern void NicoLiveHeartBeat_CharacterDataHandler(void *userData,const XML_Char
 ///
 extern void NicoLiveHeartBeat_ElementEndHandler(void *userData,const XML_Char *pszName);
 
+
+
+///
+///\83j\83R\90\90\8eå\8fî\95ñ\83X\83e\81[\83^\83X\97v\91f\8aJ\8en\83C\83x\83\93\83g\83n\83\93\83h\83\89
+///
+extern void NPublishStatus_ElementStartHandler(void *userData,const XML_Char *pszName,const XML_Char *atts[]);
+
+///
+///\83j\83R\90\90\8eå\8fî\95ñ\83X\83e\81[\83^\83X\83e\83L\83X\83g\8aJ\8en\83C\83x\83\93\83g\83n\83\93\83h\83\89
+///
+extern void NPublishStatus_CharacterDataHandler(void *userData,const XML_Char *pszData,int nLength);
+
+///
+///\83j\83R\90\90\8eå\8fî\95ñ\83X\83e\81[\83^\83X\97v\91f\8fI\97¹\83C\83x\83\93\83g\83n\83\93\83h\83\89
+///
+extern void NPublishStatus_ElementEndHandler(void *userData,const XML_Char *pszName);
\ No newline at end of file
index 279de30..32ce29f 100644 (file)
@@ -244,10 +244,7 @@ int _tmain(int argc, _TCHAR* argv[])
        
        nicoLive_setup();
        
-       for(int index = 0; index <= NLIB_ERR_NOT_LIVECONNECT;index++){
 
-               idumpln(TEXT("errmessage:%s"),NLIB_GetErrorMessage(index));
-       }
 
        nicoLive_connect();
        //nicoLive_mylist();
index 376e08c..41f881e 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 4768c49..a89e83b 100644 (file)
@@ -179,7 +179,7 @@ IDI_SMALL          ICON           "small.ico"
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 1 VERSIONINFO
     FILEVERSION     0,0,0,2
-    PRODUCTVERSION  0,0,0,1
+    PRODUCTVERSION  0,0,0,2
     FILEOS          VOS_NT
     FILETYPE        VFT_APP
     FILESUBTYPE     VFT2_UNKNOWN
@@ -193,7 +193,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
             VALUE "LegalCopyright", "Copyright (C) 2012 Kohsuke Oikawa."
             VALUE "OriginalFilename", "nlite.exe"
             VALUE "ProductName", "nlite"
-            VALUE "ProductVersion", "0.001"
+            VALUE "ProductVersion", "0.002"
         }
     }
     BLOCK "VarFileInfo"
index 1d1eb0a..c6c4f22 100644 (file)
@@ -326,7 +326,7 @@ BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
                        //\91z\92è\82³\82ê\82½\83G\83\89\81[\83R\81[\83h
                case NLIB_ERR_COOKIE_FAILED:
                case NLIB_LIVENO_FAILED_UNDEFEINE:
-               case NLIB_GETPLAYERSTATUS_FAILED_CONNECT:
+               case NLIB_FAILED_CONNECT:
                case NLIB_ERR_GETPLAYERSTATUS_INVALID_LV:
                case NLIB_ERR_GETPLAYERSTATUS_INVALID_THREAD:
                case NLIB_ERR_GETPLAYERSTATUS_CLOSED: