Commit dc75f17d authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent b7dfeb3a
...@@ -13,6 +13,7 @@ gem 'sqlite3' ...@@ -13,6 +13,7 @@ gem 'sqlite3'
gem 'zip' gem 'zip'
gem 'websocket' gem 'websocket'
gem 'net-http-pipeline' gem 'net-http-pipeline'
gem 'fssm'
group :development do group :development do
gem 'rake' gem 'rake'
......
...@@ -12,6 +12,8 @@ module Deck_Sync ...@@ -12,6 +12,8 @@ module Deck_Sync
just_updated = [] just_updated = []
$log.info('下载卡组') { "https://my-card.in/decks/?user=#{URI.escape $game.user.id.bare.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")}" } $log.info('下载卡组') { "https://my-card.in/decks/?user=#{URI.escape $game.user.id.bare.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")}" }
open("https://my-card.in/decks/?user=#{URI.escape $game.user.id.bare.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")}") { |list| open("https://my-card.in/decks/?user=#{URI.escape $game.user.id.bare.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")}") { |list|
Dir.mkdir File.dirname(Ygocore.ygocore_path) if !File.directory? File.dirname(Ygocore.ygocore_path)
Dir.mkdir File.join File.dirname(Ygocore.ygocore_path), 'deck' if !File.directory? File.join File.dirname(Ygocore.ygocore_path), 'deck'
JSON.parse(list.read).each { |deck| JSON.parse(list.read).each { |deck|
file = File.join(File.dirname(Ygocore.ygocore_path), 'deck', "#{deck['name']}.ydk") file = File.join(File.dirname(Ygocore.ygocore_path), 'deck', "#{deck['name']}.ydk")
if (!File.file?(file) || DateTime.parse(deck['updated_at']).to_time > File.mtime(file)) if (!File.file?(file) || DateTime.parse(deck['updated_at']).to_time > File.mtime(file))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "fileutils" require "fileutils"
require_relative 'card' require_relative 'card'
module Update module Update
Version = '1.2.2' Version = '1.2.3'
URL = "https://my-card.in/mycard/update.json?version=#{Version}" URL = "https://my-card.in/mycard/update.json?version=#{Version}"
class <<self class <<self
attr_reader :thumbnails, :images attr_reader :thumbnails, :images
......
...@@ -15,7 +15,10 @@ class Window_UserInfo < Window ...@@ -15,7 +15,10 @@ class Window_UserInfo < Window
refresh refresh
require 'open-uri' require 'open-uri'
Thread.new{ Thread.new{
open('https://my-card.in/match_count'){|f|self.match = f.read.to_i} loop {
open('https://my-card.in/match_count'){|f|self.match = f.read.to_i} rescue self.match = "ERROR"
sleep 60
}
} }
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment