• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonbathyscaphephpgamewindowsguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

ギコナビ


Commit MetaInfo

Revision79d3c26df0e85d406201dc510b919987c3df2d91 (tree)
Time2011-02-27 10:25:25
Authorh677 <h677>
Commiterh677

Log Message

冒険の書→忍法帖
すいとんされた時に、Cookieを削除するように修正

Change Summary

Incremental Difference

--- a/Editor.pas
+++ b/Editor.pas
@@ -22,7 +22,7 @@ uses
2222 type
2323 // TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
2424 //‘‚«ž‚Ý–ß‚è’lƒ^ƒCƒv
25- TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtBouken, grtBoukenErr);
25+ TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtNinpou, grtNinpouErr, grtSuiton);
2626
2727 TEditorForm = class(TForm)
2828 MainMenu: TMainMenu;
@@ -220,6 +220,7 @@ type
220220 FInputAssistKey: String; ///< “ü—̓AƒVƒXƒg‚̃L[
221221 FResistWords: TStringList; ///< “ü—̓AƒVƒXƒg‚ÌŽ«‘‚©‚ç‚ÌŒŸõŒ‹‰Ê
222222 FSambaTimer: TSambaTimer; ///< Samba‘΍ô‚̃^ƒCƒ}[
223+ FCookieDomain: string; ///< ”E–@’ŸƒhƒƒCƒ“
223224 procedure Preview;
224225 function Check: Boolean;
225226 procedure SetNameList(sName, sMail: string);
@@ -784,7 +785,7 @@ begin
784785 Indy.Request.AcceptLanguage := 'ja';
785786 Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
786787 Indy.Request.ContentType := 'application/x-www-form-urlencoded';
787- Indy.Request.CustomHeaders.Add(getHeaderStr(ACOOKIE, SPID, PON, GikoSys.GetBoukenCookie(URL), Board));
788+ Indy.Request.CustomHeaders.Add(getHeaderStr(ACOOKIE, SPID, PON, GikoSys.GetBouken(URL, FCookieDomain), Board));
788789 TextStream := TStringStream.Create('');
789790 Source := TStringStream.Create('');
790791 try
@@ -887,23 +888,40 @@ begin
887888 CancelSend( Board, SysMenu );
888889 Exit;
889890 end;
890- end else if ResultType = grtBouken then begin
891+ end else if ResultType = grtNinpou then begin
891892 MsgBox( Handle,
892- '‹M•û‚Ì–`Œ¯‚̏‘‚ðì¬’†‚Å‚·Bˆø‚«•Ô‚·‚È‚ç‚¢‚Ü‚¾B(‚Q•ª‚Ù‚Ç‚©‚©‚è‚Ü‚·)' + #13#10
893+ '‹M•û‚Ì”E–@’Ÿ‚ðì¬’†‚Å‚·Bˆø‚«•Ô‚·‚È‚ç‚¢‚Ü‚¾B(‚Q•ª‚Ù‚Ç‚©‚©‚è‚Ü‚·)' + #13#10
893894 , 'Šm”F',
894- MB_OK or MB_ICONQUESTION);
895+ MB_OK or MB_ICONINFORMATION);
896+ if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
897+ begin
898+ FSambaTimer.WriteSambaTime(Now());
899+ end;
895900 Board.PON := '';
896901 Board.SPID := '';
897902 Board.Cookie := '';
898903 GetCookie(Indy.CookieManager, Board);
899904 Exit;
905+ end else if ResultType = grtSuiton then begin
906+ MsgBox( Handle,
907+ '‹M•û‚Ì”E–@’Ÿ‚͏Ă©‚ê‚Ü‚µ‚½B' + #13#10 +
908+ '”E–@’Ÿ‚ðíœ‚µ‚Ü‚µ‚½AÄ‘—M‚µ‚Ä‚­‚¾‚³‚¢B'
909+ , 'Šm”F',
910+ MB_OK or MB_ICONINFORMATION);
911+ // ”E–@’ŸŠª•¨‚ðÁ‚·
912+ GikoSys.DelBoukenCookie(FCookieDomain);
913+ GikoSys.Setting.WriteBoukenSettingFile;
914+ Board.PON := '';
915+ Board.SPID := '';
916+ Board.Cookie := '';
917+ Exit;
900918 end else begin
901919 if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
902920 begin
903921 FSambaTimer.WriteSambaTime(Now());
904922 end;
905- // –`Œ¯‚̏‘ƒGƒ‰[‚ÍCookie‚ðXV‚·‚é
906- if ResultType = grtBoukenErr then begin
923+ // ”E–@’ŸŠª•¨ƒGƒ‰[‚ÍCookie‚ðXV‚·‚é
924+ if ResultType = grtNinpouErr then begin
907925 GetCookie(Indy.CookieManager, Board);
908926 end;
909927 State := gdsError;
@@ -981,13 +999,17 @@ function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
981999 begin
9821000 if AnsiPos('‘‚«‚±‚Ý‚ªI‚í‚è‚Ü‚µ‚½', ResponseText) <> 0 then
9831001 Result := grtOK
984- else if (AnsiPos('‚d‚q‚q‚n‚qF‹M•û‚Ì–`Œ¯‚̏‘‚ðì¬’†‚Å‚·', ResponseText) > 0)
1002+ else if ( (AnsiPos('<b>‚悤‚±‚»F‹M•û‚Ì”E–@’Ÿ‚ðì¬‚µ‚Ü‚·B‚Q•ªŒã‚ɍēx‘‚«ž‚Þ‚©A‚¨‹A‚è‚­‚¾‚³‚¢', ResponseText) > 0) or
1003+ (AnsiPos('‚d‚q‚q‚n‚qF‹M•û‚Ì–`Œ¯‚̏‘‚ðì¬’†‚Å‚·', ResponseText) > 0) )
9851004 and (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
986- Result := grtBouken
1005+ Result := grtNinpou
9871006 else if ( (AnsiPos('‚d‚q‚q‚n‚qFCs‚ª‘«‚è‚Ü‚¹‚ñ', ResponseText) > 0) or // ƒGƒ‰[ˆµ‚¢
9881007 (AnsiPos('‚d‚q‚q‚n‚qFLv‚ª‘«‚è‚È‚­‚ăXƒŒƒbƒh—§‚Ä', ResponseText) > 0) ) // ƒGƒ‰[ˆµ‚¢
9891008 and (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
990- Result := grtBoukenErr
1009+ Result := grtNinpouErr
1010+ else if( AnsiPos('<b>‚â‚ç‚ꂽ‚Å‚²‚´‚éFLv=0 <br>‚³‚ÄŽ©—Í‚Å•œŠˆ‚Å‚«‚é‚©‚È?', ResponseText) > 0)
1011+ and (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
1012+ Result := grtSuiton
9911013 else if ( AnsiPos('ƒNƒbƒL[‚ª‚È‚¢‚©ŠúŒÀØ‚ê‚Å‚·', ResponseText) > 0) or
9921014 (AnsiPos('<title>ƒNƒbƒL[Šm”FI</title>', ResponseText) > 0) or
9931015 (AnsiPos('<title>¡ƒNƒbƒL[Šm”FI¡</title>', ResponseText) > 0) or
@@ -1920,6 +1942,8 @@ begin
19201942 curCookies := TStringList.Create;
19211943 curCookies.Delimiter := ';';
19221944 curCookies.DelimitedText := ABoard.Cookie;
1945+ curCookies.Sort;
1946+ curCookies.Duplicates := dupIgnore;
19231947 ABoard.Cookie := '';
19241948 try
19251949 for i := 0 to CookieMng.CookieCollection.Count - 1 do begin
@@ -1941,7 +1965,7 @@ begin
19411965 if Length( curCookies.Values[ Cookie.CookieName ] ) > 0 then begin
19421966 // Šù‘¶’l‚Ì•t‚¯‘Ö‚¦
19431967 curCookies[curCookies.IndexOfName(Cookie.CookieName)] :=
1944- Cookie.Value;
1968+ Cookie.ClientCookie;
19451969 end else begin
19461970 // ’ljÁ
19471971 curCookies.Add(Cookie.ClientCookie);
@@ -1949,8 +1973,8 @@ begin
19491973 end;
19501974 end;
19511975 for i := 0 to curCookies.Count - 1 do begin
1952- if (curCookies.Strings[i] <> '') then begin
1953- ABoard.Cookie := ABoard.Cookie + curCookies.Strings[i] + '; ';
1976+ if (curCookies[i] <> '') then begin
1977+ ABoard.Cookie := ABoard.Cookie + curCookies[i] + '; ';
19541978 end;
19551979 end;
19561980 finally
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -265,6 +265,8 @@ type
265265 procedure DelBoukenCookie(ADomain: String);
266266 //! –`Œ¯‚̏‘Domainˆê——Žæ“¾
267267 procedure GetBoukenDomain(var ADomain: TStringList);
268+ //! –`Œ¯‚̏‘ƒhƒƒCƒ“–¼CookieŽæ“¾
269+ function GetBouken(AURL: String; var Domain: String): String;
268270 end;
269271
270272 var
@@ -3497,7 +3499,19 @@ begin
34973499 end;
34983500 end;
34993501 end;
3500-
3502+function TGikoSys.GetBouken(AURL: String; var Domain: String): String;
3503+var
3504+ Protocol, Host, Path, Document, Port,Bookmark : String;
3505+ Cookie : String;
3506+begin
3507+ Domain := '';
3508+ Cookie := '';
3509+ GikoSys.ParseURI(AURL, Protocol, Host, Path, Document, Port,Bookmark);
3510+ if ( Length(Host) > 0 ) then begin
3511+ Setting.GetBouken(Host, Domain, Cookie);
3512+ Result := Cookie;
3513+ end;
3514+end;
35013515
35023516 initialization
35033517 GikoSys := TGikoSys.Create;
--- a/Setting.pas
+++ b/Setting.pas
@@ -550,6 +550,7 @@ type
550550 function GetExtprevieFileName: String;
551551 function GetBoukenCookie(AHostName: String): String;
552552 procedure SetBoukenCookie(ACookieValue, AHostName: String);
553+ procedure GetBouken(AHostName: String; var Domain:String; var Cookie:String);
553554 {
554555 \brief ƒŠƒ“ƒN—š—ð‚Ì•ÛŽƒTƒCƒY‚Ìsetter
555556 \param AVal Ý’è‚·‚éƒTƒCƒY( >0)
@@ -2503,5 +2504,19 @@ begin
25032504 FBoukenCookieList.Add(AHostName + '=' + ACookieValue);
25042505 end;
25052506 end;
2507+procedure TSetting.GetBouken(AHostName: String; var Domain:String; var Cookie:String);
2508+var
2509+ i : Integer;
2510+begin
2511+ Cookie := '';
2512+ for i := 0 to FBoukenCookieList.Count - 1 do begin
2513+ if ( AnsiPos(FBoukenCookieList.Names[i], AHostName) > 0 ) then begin
2514+ Domain := FBoukenCookieList.Names[i];
2515+ Cookie := FBoukenCookieList.Values[FBoukenCookieList.Names[i]];
2516+ Break;
2517+ end;
2518+ end;
2519+end;
2520+
25062521 end.
25072522
Binary files a/gikoNavi.res and b/gikoNavi.res differ