Commit 709a9dbb authored by 神楽坂玲奈's avatar 神楽坂玲奈

临时

parent d3b84e50
#!/usr/bin/env ruby #!/usr/bin/env ruby
p ARGV
STDIN.gets
begin begin
#定义全局方法 #定义全局方法
def load_config(file="config.yml") def load_config(file="config.yml")
...@@ -17,7 +19,7 @@ begin ...@@ -17,7 +19,7 @@ begin
if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"] if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"]
require 'win32/registry' require 'win32/registry'
pwd = Dir.pwd.gsub('/', '\\') pwd = Dir.pwd.gsub('/', '\\')
path = '"' + pwd + '\ruby\bin\rubyw.exe" -C"' + pwd + '" -KU lib/main.rb' path = '"' + pwd + '\ruby\bin\ruby.exe" -C"' + pwd + '" -KU lib/main.rb'
command = path + ' "%1"' command = path + ' "%1"'
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard'){|reg|reg['URL Protocol'] = path unless (reg['URL Protocol'] == path rescue false)} Win32::Registry::HKEY_CLASSES_ROOT.create('mycard'){|reg|reg['URL Protocol'] = path unless (reg['URL Protocol'] == path rescue false)}
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard\shell\open\command'){|reg|reg[nil] = command unless (reg[nil] == command rescue false)} Win32::Registry::HKEY_CLASSES_ROOT.create('mycard\shell\open\command'){|reg|reg[nil] = command unless (reg[nil] == command rescue false)}
...@@ -34,6 +36,8 @@ begin ...@@ -34,6 +36,8 @@ begin
log_level = "INFO" log_level = "INFO"
profile = nil profile = nil
ARGV.each do |arg| ARGV.each do |arg|
p arg
STDIN.gets
case arg.dup.force_encoding("UTF-8") case arg.dup.force_encoding("UTF-8")
when /--log=(.*)/ when /--log=(.*)/
log.replace $1 log.replace $1
......
...@@ -4,7 +4,11 @@ require_relative 'room' ...@@ -4,7 +4,11 @@ require_relative 'room'
require_relative 'ygocore/game' require_relative 'ygocore/game'
$game = Ygocore.new $game = Ygocore.new
uri = URI.unescape ARGV.first[9, ARGV.first.size-9] p 1
STDIN.gets
uri = URI.unescape URI.unescape ARGV.first[9, ARGV.first.size-9]
p uri
STDIN.gets
case uri case uri
when /^(.*\.yrp)$/ when /^(.*\.yrp)$/
require 'open-uri' require 'open-uri'
...@@ -25,6 +29,8 @@ when /^(.*\.ydk)$/ ...@@ -25,6 +29,8 @@ when /^(.*\.ydk)$/
} }
Ygocore.run_ygocore(File.basename($1, '.ydk'), true) Ygocore.run_ygocore(File.basename($1, '.ydk'), true)
when /^(?:(.*)\:(.*)\@)?(.*)\:(\d+)\/(.*)$/ when /^(?:(.*)\:(.*)\@)?(.*)\:(\d+)\/(.*)$/
p $1
STDIN.gets
require 'uri' require 'uri'
$game.user = User.new($1.to_sym, $1) if $1 $game.user = User.new($1.to_sym, $1) if $1
$game.password = $2 if $2 $game.password = $2 if $2
......
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