🏠 ホーム 🔧 自作ツール 🗃️ アーカイブ 📓 日常のブログ 🍜 飯のブログ 📚 勉強のブログ 🗂️ その他のブログ
👃 LychiBrowser's Code - NoseScape

てんともち / LychiBrowser Public

InternetManager.hsp 1,525 Bytes
*init_internet
	exist "hspinet.dll"
	if strsize=-1{
		objprm 1,"hspinet.dllが見つかりません。\n起動できません。\n「x」を押して終了"
		stop
	}
	netinit
	if stat {
		objprm 1,"ネット接続に失敗しました。\nこれでは続行できません。\n「x」を押して終了"
		stop
	}
	netagent ""+AppNameInternal+"/"+AppVerInt
return

*checkupdate
	SetTitle "更新確認/導通確認中"
	neturl "https://tentmochi.com/api/update/LychiBrowser/v1/"
	netrequest_get "getLatest.txt"
	repeat 16
		netexec res
		if res>0 {
			netgetv buf
			buf=cnvatos(buf)
			notesel buf
			noteget tmp,0
			if strlen(tmp)>16 {
				dialog "更新確認に失敗しました。\n\n原因:サーバの応答が異常です。",1
				noteunsel
				break
			}
			if instr(tmp,0,"dead")=0 {
				dialog "開発を終了しました。\n今後メンテナンスはされないため、使用の中止をお勧めします。\nこれまでありがとうございました。",1
				end
			}else:if AppVerInt!=tmp {
				SetTitle "更新があります"
				out ="更新が可能です!\n\n現在のバージョン:"+AppVerInt+"\n最新のバージョン:"+tmp+"\n\n"
				out+="更新方法:\nhttps://tentmochi.com/tool/LychiBrowser/ にアクセスし、\n最新版をダウンロードし、how_to_upgrade.txtを見てください。\n\n※「移動」を押してそのまま続行"
				objprm 0,":home"
				objprm 1,out
				stop
			}
			noteunsel
			break
		}
		if res<0 {
			neterror tmp
			tmp=cnvatos(tmp)
			dialog "更新確認に失敗しました。\n\n原因:"+tmp,1
			break
		}
		await 100
		if cnt=15 {
			dialog "更新確認に失敗しました。\n\n原因:タイムアウトしました",1
		}
	loop
return 0