Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
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
MyCard
Ygopro Arena Web
Commits
fe697aec
Commit
fe697aec
authored
Mar 31, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时提交
parent
27403848
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
app/controllers/duels_controller.rb
app/controllers/duels_controller.rb
+2
-2
app/controllers/mycard_controller.rb
app/controllers/mycard_controller.rb
+13
-4
No files found.
app/controllers/duels_controller.rb
View file @
fe697aec
...
...
@@ -53,8 +53,8 @@ class DuelsController < ApplicationController
@duel
.
winreason
=
params
[
:duel
][
:winreason
]
@duel
.
replay
=
params
[
:duel
][
:replay
]
@duel
.
version
=
params
[
:duel
][
:version
]
@duel
.
user1
=
User
.
find_by_name
params
[
:duel
][
:user1_name
]
if
params
[
:duel
][
:user1_name
]
@duel
.
user2
=
User
.
find_by_name
params
[
:duel
][
:user2_name
]
if
params
[
:duel
][
:user2_name
]
@duel
.
user1
=
User
.
find_
or_create_
by_name
params
[
:duel
][
:user1_name
]
if
params
[
:duel
][
:user1_name
]
@duel
.
user2
=
User
.
find_
or_create_
by_name
params
[
:duel
][
:user2_name
]
if
params
[
:duel
][
:user2_name
]
[
params
[
:duel
][
:user1_main
],
params
[
:duel
][
:user1_extra
],
params
[
:duel
][
:user2_main
],
params
[
:duel
][
:user2_extra
]].
each_with_index
do
|
cards
,
index
|
user
=
index
/
2
==
0
?
@duel
.
user1
:
@duel
.
user2
main
=
index
%
2
==
0
...
...
app/controllers/mycard_controller.rb
View file @
fe697aec
...
...
@@ -2,13 +2,22 @@ class MycardController < ApplicationController
def
update
result
=
[]
version
=
params
[
:version
]
loop
do
new_version
=
false
Dir
.
glob
(
'public/mycard/mycard-update-*-*.zip'
)
do
|
file
|
if
file
=~
/mycard-update-(.+?)-(.+?).zip/
if
$1
<=
version
and
$2
>
version
version
=
$2
result
<<
"http://card.touhou.cc/mycard/
#{
$&
}
"
new_version
=
true
break
end
end
end
if
!
new_version
break
end
end
respond_to
do
|
format
|
format
.
json
{
render
json:
result
}
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