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
971bee67
Commit
971bee67
authored
Apr 05, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https
parent
71ab8cc1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
14 deletions
+14
-14
lib/association.rb
lib/association.rb
+1
-1
lib/update.rb
lib/update.rb
+2
-2
lib/window_deck.rb
lib/window_deck.rb
+1
-1
lib/window_lobbybuttons.rb
lib/window_lobbybuttons.rb
+2
-2
lib/ygocore/game.rb
lib/ygocore/game.rb
+3
-3
lib/ygocore/server.yml
lib/ygocore/server.yml
+2
-2
lib/ygocore/user.rb
lib/ygocore/user.rb
+3
-3
No files found.
lib/association.rb
View file @
971bee67
...
...
@@ -50,7 +50,7 @@ Icon=#{Dir.pwd}/graphics/system/icon.png
Type=Application
Categories=Game
Path=
#{
Dir
.
pwd
}
URL=http://my-card.in/
URL=http
s
://my-card.in/
MimeType=x-scheme-handler/mycard;application/x-ygopro-deck;application/x-ygopro-replay'
EOF
x_ygopro_deck
=
<<
EOF
...
...
lib/update.rb
View file @
971bee67
...
...
@@ -3,7 +3,7 @@ require "fileutils"
require_relative
'card'
module
Update
Version
=
'1.0.1'
URL
=
"http://my-card.in/mycard/update.json?version=
#{
Version
}
"
URL
=
"http
s
://my-card.in/mycard/update.json?version=
#{
Version
}
"
class
<<
self
attr_reader
:thumbnails
,
:images
,
:status
...
...
@@ -117,7 +117,7 @@ module Update
$log
.
info
(
'待下载的完整卡图'
)
{
@images
.
inspect
}
$log
.
info
(
'待下载的缩略卡图'
)
{
@thumbnails
.
inspect
}
open
(
'http://my-card.in/cards/image.json'
)
do
|
f
|
open
(
'http
s
://my-card.in/cards/image.json'
)
do
|
f
|
image_index
=
JSON
.
parse
(
f
.
read
)
$log
.
info
(
'卡图路径'
){
image_index
}
url
=
image_index
[
'url'
]
...
...
lib/window_deck.rb
View file @
971bee67
...
...
@@ -164,7 +164,7 @@ class Window_Deck < Window_Scrollable
result
<<
key
[(
c
>>
i
*
6
)
&
0x3F
]
end
end
Dialog
.
web
"http://my-card.in/decks/new?name=
#{
File
.
basename
(
@items
[
index
[
0
]],
".ydk"
)
}
&cards=
#{
result
}
#share"
Dialog
.
web
"http
s
://my-card.in/decks/new?name=
#{
File
.
basename
(
@items
[
index
[
0
]],
".ydk"
)
}
&cards=
#{
result
}
#share"
when
:delete
require_relative
'widget_msgbox'
...
...
lib/window_lobbybuttons.rb
View file @
971bee67
...
...
@@ -34,7 +34,7 @@ class Window_LobbyButtons < Window_List
case
@index
when
0
#常见问题
require_relative
'dialog'
Dialog
.
web
"http://my-card.in/login?user[name]=
#{
CGI
.
escape
$game
.
user
.
name
}
&user[password]=
#{
CGI
.
escape
$game
.
password
}
&continue=/topics/1453"
Dialog
.
web
"http
s
://my-card.in/login?user[name]=
#{
CGI
.
escape
$game
.
user
.
name
}
&user[password]=
#{
CGI
.
escape
$game
.
password
}
&continue=/topics/1453"
when
1
#房间筛选
if
@filter_window
and
!
@filter_window
.
destroyed?
@filter_window
.
destroy
...
...
@@ -53,7 +53,7 @@ class Window_LobbyButtons < Window_List
require
'open-uri'
Thread
.
new
{
begin
open
(
'http://my-card.in/match'
)
{
|
f
|
open
(
'http
s
://my-card.in/match'
)
{
|
f
|
@waiting
=
false
if
f
.
read
=~
/^mycard:\/\/([\d\.]+):(\d+)\/(.*)$/
room
=
Room
.
new
(
nil
,
$3
.
to_s
)
...
...
lib/ygocore/game.rb
View file @
971bee67
...
...
@@ -84,7 +84,7 @@ class Ygocore < Game
def
connect
@recv
=
Thread
.
new
do
EventMachine
::
run
{
http
=
EM
::
HttpRequest
.
new
(
"http://my-card.in/servers.json"
).
get
http
=
EM
::
HttpRequest
.
new
(
"http
s
://my-card.in/servers.json"
).
get
http
.
callback
{
begin
self
.
servers
.
replace
JSON
.
parse
(
http
.
response
).
collect
{
|
data
|
Server
.
new
(
data
[
'id'
],
data
[
'name'
],
data
[
'ip'
],
data
[
'port'
],
data
[
'auth'
])
}
...
...
@@ -94,7 +94,7 @@ class Ygocore < Game
end
#EventMachine::connect "mycard-server.my-card.in", 9997, Client
ws
=
WebSocket
::
EventMachine
::
Client
.
connect
(
:uri
=>
'ws://my-card.in/rooms.json'
);
ws
=
WebSocket
::
EventMachine
::
Client
.
connect
(
:uri
=>
'ws
s
://my-card.in/rooms.json'
);
ws
.
onmessage
do
|
msg
,
type
|
$log
.
info
(
'收到websocket消息'
)
{
msg
.
force_encoding
(
"UTF-8"
)
}
Game_Event
.
push
Game_Event
::
RoomsUpdate
.
new
JSON
.
parse
(
msg
).
collect
{
|
room
|
Game_Event
.
parse_room
(
room
)
}
...
...
@@ -360,7 +360,7 @@ class Ygocore < Game
$config
[
'ygocore'
][
'announcements'
]
||=
[
Announcement
.
new
(
"正在读取公告..."
,
nil
,
nil
)]
Thread
.
new
do
begin
open
(
'http://my-card.in/announcements.json'
)
do
|
file
|
open
(
'http
s
://my-card.in/announcements.json'
)
do
|
file
|
$config
[
'ygocore'
][
'announcements'
].
replace
JSON
.
parse
(
file
.
read
).
collect
{
|
announcement
|
Announcement
.
new
(
announcement
[
'title'
],
announcement
[
'url'
],
Date
.
parse
(
announcement
[
'created_at'
]))
}
...
...
lib/ygocore/server.yml
View file @
971bee67
register
:
http://my-card.in/register
register
:
http
s
://my-card.in/register
api
:
http://master.smdcn.net:7922/
index
:
http://my-card.in/
index
:
http
s
://my-card.in/
server
:
122.0.65.70
port
:
7911
\ No newline at end of file
lib/ygocore/user.rb
View file @
971bee67
...
...
@@ -15,7 +15,7 @@ class User
end
def
space
if
@certified
Dialog
.
web
"http://my-card.in/users/
#{
CGI
.
escape
@id
.
to_s
}
"
Dialog
.
web
"http
s
://my-card.in/users/
#{
CGI
.
escape
@id
.
to_s
}
"
else
Widget_Msgbox
.
new
(
"查看资料"
,
"用户
#{
@name
}
没有注册"
,
:ok
=>
"确定"
)
end
...
...
@@ -29,9 +29,9 @@ class User
yield
result
Thread
.
new
do
require
'cgi'
$log
.
info
(
'读取头像'
){
"http://my-card.in/users/
#{
CGI
.
escape
id
.
to_s
}
.png"
}
$log
.
info
(
'读取头像'
){
"http
s
://my-card.in/users/
#{
CGI
.
escape
id
.
to_s
}
.png"
}
begin
open
(
"http
://my-card.in/users/
#{
CGI
.
escape
id
.
to_s
}
.png"
,
'rb'
)
{
|
io
|
open
(
cache
,
'wb'
)
{
|
c
|
c
.
write
io
.
read
}}
open
(
"http
s://my-card.in/users/
#{
CGI
.
escape
id
.
to_s
}
.png"
,
'rb'
)
{
|
io
|
open
(
cache
,
'wb'
)
{
|
c
|
c
.
write
io
.
read
}}
rescue
Exception
=>
exception
$log
.
error
(
'下载头像'
){[
exception
.
inspect
,
*
exception
.
backtrace
].
join
(
"
\n
"
).
force_encoding
(
"UTF-8"
)}
cache
=
"graphics/avatars/error_
#{
size
}
.png"
...
...
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