Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
0780194f
Commit
0780194f
authored
Apr 16, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.5.4
parent
8d3ad8f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
Rakefile
Rakefile
+1
-1
lib/update.rb
lib/update.rb
+6
-1
lib/ygocore/game.rb
lib/ygocore/game.rb
+4
-1
No files found.
Rakefile
View file @
0780194f
...
@@ -24,7 +24,7 @@ end
...
@@ -24,7 +24,7 @@ end
spec
=
Gem
::
Specification
.
new
do
|
s
|
spec
=
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
'mycard'
s
.
name
=
'mycard'
s
.
version
=
'0.5.
3
'
s
.
version
=
'0.5.
4
'
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
summary
=
'a card game'
s
.
summary
=
'a card game'
s
.
description
=
s
.
summary
s
.
description
=
s
.
summary
...
...
lib/update.rb
View file @
0780194f
...
@@ -2,7 +2,7 @@ require 'open-uri'
...
@@ -2,7 +2,7 @@ require 'open-uri'
require
"fileutils"
require
"fileutils"
require_relative
'card'
require_relative
'card'
module
Update
module
Update
Version
=
'0.5.
3
'
Version
=
'0.5.
4
'
URL
=
"http://card.touhou.cc/mycard/update.json?version=
#{
Version
}
"
URL
=
"http://card.touhou.cc/mycard/update.json?version=
#{
Version
}
"
class
<<
self
class
<<
self
attr_reader
:thumbnails
,
:images
,
:status
attr_reader
:thumbnails
,
:images
,
:status
...
@@ -34,6 +34,7 @@ module Update
...
@@ -34,6 +34,7 @@ module Update
@thumbnails
=
[]
@thumbnails
=
[]
@status
=
'正在检查更新'
@status
=
'正在检查更新'
@updated
=
false
Thread
.
new
do
Thread
.
new
do
open
(
URL
)
do
|
file
|
open
(
URL
)
do
|
file
|
require
'json'
require
'json'
...
@@ -46,12 +47,16 @@ module Update
...
@@ -46,12 +47,16 @@ module Update
@status
.
replace
"正在下载更新
#{
name
}
"
@status
.
replace
"正在下载更新
#{
name
}
"
open
(
fil
,
'rb'
)
do
|
fi
|
open
(
fil
,
'rb'
)
do
|
fi
|
$log
.
info
(
'下载完毕'
){
name
}
$log
.
info
(
'下载完毕'
){
name
}
@updated
=
true
open
(
name
,
'wb'
)
do
|
f
|
open
(
name
,
'wb'
)
do
|
f
|
f
.
write
fi
.
read
f
.
write
fi
.
read
end
end
end
rescue
$log
.
error
(
'下载更新'
){
'下载更新失败'
}
end
rescue
$log
.
error
(
'下载更新'
){
'下载更新失败'
}
end
end
end
rescue
$log
.
error
(
'检查更新'
){
'检查更新失败'
}
end
rescue
$log
.
error
(
'检查更新'
){
'检查更新失败'
}
if
@updated
Widget_Msgbox
.
new
(
'mycard'
,
'下载更新完毕,点击确定重新运行mycard并安装更新'
,
:ok
=>
"确定"
){
IO
.
popen
(
'./mycard'
);
$scene
=
nil
}
end
if
File
.
file?
"ygocore/cards.cdb"
if
File
.
file?
"ygocore/cards.cdb"
require
'sqlite3'
require
'sqlite3'
db
=
SQLite3
::
Database
.
new
(
"ygocore/cards.cdb"
)
db
=
SQLite3
::
Database
.
new
(
"ygocore/cards.cdb"
)
...
...
lib/ygocore/game.rb
View file @
0780194f
...
@@ -14,6 +14,9 @@ class Ygocore < Game
...
@@ -14,6 +14,9 @@ class Ygocore < Game
load
'lib/ygocore/scene_lobby.rb'
load
'lib/ygocore/scene_lobby.rb'
require
'json'
require
'json'
end
end
def
refresh_interval
60
end
def
login
(
username
,
password
)
def
login
(
username
,
password
)
@username
=
username
@username
=
username
@password
=
password
@password
=
password
...
@@ -170,7 +173,7 @@ class Ygocore < Game
...
@@ -170,7 +173,7 @@ class Ygocore < Game
save_config
save_config
end
end
rescue
Exception
=>
exception
rescue
Exception
=>
exception
$log
.
error
(
'公告
'
)
{[
exception
.
inspect
,
*
exception
.
backtrace
]
.
join
(
"
\n
"
)}
$log
.
error
(
'公告
读取失败'
){[
exception
.
inspect
,
*
exception
.
backtrace
].
collect
{
|
str
|
str
.
encode
(
"UTF-8"
)}
.
join
(
"
\n
"
)}
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment