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
2cc864c5
Commit
2cc864c5
authored
Dec 26, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nothing
parent
1d260837
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1329 additions
and
1315 deletions
+1329
-1315
.gitattributes
.gitattributes
+10
-18
lib/game.rb
lib/game.rb
+50
-50
lib/main.rb
lib/main.rb
+134
-134
lib/update.rb
lib/update.rb
+146
-146
lib/window_chat.rb
lib/window_chat.rb
+175
-175
lib/window_lobbybuttons.rb
lib/window_lobbybuttons.rb
+55
-55
lib/window_userinfo.rb
lib/window_userinfo.rb
+35
-35
lib/ygocore/game.rb
lib/ygocore/game.rb
+643
-621
lib/ygocore/room.rb
lib/ygocore/room.rb
+56
-56
locales/ja.yml
locales/ja.yml
+1
-1
locales/zh-OS.yml
locales/zh-OS.yml
+1
-1
locales/zh-TW.yml
locales/zh-TW.yml
+1
-1
locales/zh.yml
locales/zh.yml
+22
-22
No files found.
.gitattributes
View file @
2cc864c5
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
*.rb text
*.yml text
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.html text
*.js text
*.coffee text
*.css text
*.less text
*.png binary
*.jpg binary
\ No newline at end of file
lib/game.rb
View file @
2cc864c5
#游戏适配器的抽象类
require_relative
'game_event'
require_relative
'action'
require_relative
'user'
require_relative
'room'
require_relative
'server'
class
Game
attr_reader
:users
,
:rooms
,
:servers
,
:filter
attr_accessor
:user
,
:room
,
:player_field
,
:opponent_field
,
:turn
,
:turn_player
,
:phase
def
initialize
@users
=
[]
@rooms
=
[]
@servers
=
[]
@filter
=
{
servers:
[],
waiting_only:
false
,
normal_only:
false
}
end
def
login
(
username
,
password
=
nil
)
end
def
refresh
end
def
host
(
room_name
,
room_config
)
end
def
join
(
room
)
end
def
watch
(
room
)
end
def
leave
end
def
action
(
action
)
end
def
chat
(
chatmessage
)
end
def
exit
$scene
=
Scene_Login
.
new
if
$scene
end
def
watching?
@room
and
@room
.
include?
@user
end
def
self
.
deck_edit
require_relative
'window_deck'
@deck_window
=
Window_Deck
.
new
end
def
refresh_interval
5
end
def
show_chat_self
false
end
end
#游戏适配器的抽象类
require_relative
'game_event'
require_relative
'action'
require_relative
'user'
require_relative
'room'
require_relative
'server'
class
Game
attr_reader
:users
,
:rooms
,
:servers
,
:filter
attr_accessor
:user
,
:room
,
:player_field
,
:opponent_field
,
:turn
,
:turn_player
,
:phase
def
initialize
@users
=
[]
@rooms
=
[]
@servers
=
[]
@filter
=
{
servers:
[],
waiting_only:
false
,
normal_only:
false
}
end
def
login
(
username
,
password
=
nil
)
end
def
refresh
end
def
host
(
room_name
,
room_config
)
end
def
join
(
room
)
end
def
watch
(
room
)
end
def
leave
end
def
action
(
action
)
end
def
chat
(
chatmessage
)
end
def
exit
$scene
=
Scene_Login
.
new
if
$scene
end
def
watching?
@room
and
@room
.
include?
@user
end
def
self
.
deck_edit
require_relative
'window_deck'
@deck_window
=
Window_Deck
.
new
end
def
refresh_interval
5
end
def
show_chat_self
false
end
end
lib/main.rb
View file @
2cc864c5
#!/usr/bin/env ruby
begin
Windows
=
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
Dir
.
glob
(
'post_update_*.rb'
).
sort
.
each
{
|
file
|
load
file
}
Thread
.
abort_on_exception
=
true
require_relative
'resolution'
require_relative
'announcement'
require_relative
'config'
require_relative
'association'
#i18n
require
'i18n'
require
'locale'
I18n
.
load_path
+=
Dir
[
'locales/*.yml'
]
I18n
::
Backend
::
Simple
.
include
(
I18n
::
Backend
::
Fallbacks
)
#读取配置文件
$config
=
Config
.
load
Config
.
save
#读取命令行参数
log
=
"log.log"
log_level
=
"INFO"
profile
=
nil
ARGV
.
each
do
|
arg
|
arg
=
arg
.
dup
.
force_encoding
(
"UTF-8"
)
arg
.
force_encoding
(
"GBK"
)
unless
arg
.
valid_encoding?
case
arg
when
/--log=(.*)/
log
.
replace
$1
when
/--log-level=(.*)/
log_level
.
replace
$1
when
/--profile=(.*)/
profile
=
$1
when
/^mycard:.*|\.ydk$|\.yrp$|\.deck$/
require_relative
'quickstart'
$scene
=
false
when
/register_association/
Association
.
register
$scene
=
false
end
end
unless
$scene
==
false
#加载文件
require
'logger'
require
'sdl'
include
SDL
require_relative
'dialog'
require_relative
'graphics'
require_relative
'window'
require_relative
'widget_msgbox'
#日志
if
log
==
"STDOUT"
#调试用
log
=
STDOUT
end
$log
=
Logger
.
new
(
log
,
1
,
1024000
)
$log
.
level
=
Logger
.
const_get
log_level
#性能分析
if
profile
if
profile
==
"STDOUT"
profile
=
STDOUT
else
profile
=
open
(
profile
,
'w'
)
end
require
'profiler'
RubyVM
::
InstructionSequence
.
compile_option
=
{
:trace_instruction
=>
true
,
:specialized_instruction
=>
false
}
Profiler__
::
start_profile
end
SDL
::
Event
::
APPMOUSEFOCUS
=
1
SDL
::
Event
::
APPINPUTFOCUS
=
2
SDL
::
Event
::
APPACTIVE
=
4
SDL
.
putenv
(
"SDL_VIDEO_CENTERED=1"
);
SDL
.
init
(
INIT_VIDEO
)
WM
::
set_caption
(
"MyCard"
,
"MyCard"
)
WM
::
icon
=
Surface
.
load
(
"graphics/system/icon.gif"
)
$screen
=
Screen
.
open
(
$config
[
'screen'
][
'width'
],
$config
[
'screen'
][
'height'
],
0
,
HWSURFACE
|
(
$config
[
'screen'
][
'fullscreen'
]
?
FULLSCREEN
:
0
))
TTF
.
init
#声音
begin
SDL
.
init
(
INIT_AUDIO
)
Mixer
.
open
(
Mixer
::
DEFAULT_FREQUENCY
,
Mixer
::
DEFAULT_FORMAT
,
Mixer
::
DEFAULT_CHANNELS
,
1536
)
Mixer
.
set_volume_music
(
60
)
rescue
nil
end
#标题场景
require_relative
'scene_title'
$scene
=
Scene_Title
.
new
#自动更新, 加载放到SDL前面会崩, 原因不明
require_relative
'update'
Update
.
start
WM
::
set_caption
(
"MyCard v
#{
Update
::
Version
}
"
,
"MyCard"
)
#文件关联
Association
.
start
#初始化完毕
$log
.
info
(
"main"
)
{
"初始化成功"
}
end
rescue
Exception
=>
exception
open
(
'error-程序出错请到论坛反馈.txt'
,
'w'
)
{
|
f
|
f
.
write
[
exception
.
inspect
,
*
exception
.
backtrace
].
join
(
"
\n
"
)
}
$scene
=
false
end
#主循环
begin
$scene
.
main
while
$scene
rescue
Exception
=>
exception
exception
.
backtrace
.
each
{
|
backtrace
|
break
if
backtrace
=~
/^(.*)\.rb:\d+:in `.*'"$/
}
#由于脚本是从main.rb开始执行的,总会有个能匹配成功的文件
$log
.
fatal
(
$1
)
{
[
exception
.
inspect
,
*
exception
.
backtrace
].
collect
{
|
str
|
str
.
force_encoding
(
"UTF-8"
)
}.
join
(
"
\n
"
)
}
$game
.
exit
if
$game
require_relative
'scene_error'
$scene
=
Scene_Error
.
new
retry
ensure
if
profile
Profiler__
::
print_profile
(
profile
)
profile
.
close
end
$log
.
close
rescue
nil
#!/usr/bin/env ruby
begin
Windows
=
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
Dir
.
glob
(
'post_update_*.rb'
).
sort
.
each
{
|
file
|
load
file
}
Thread
.
abort_on_exception
=
true
require_relative
'resolution'
require_relative
'announcement'
require_relative
'config'
require_relative
'association'
#i18n
require
'i18n'
require
'locale'
I18n
.
load_path
+=
Dir
[
'locales/*.yml'
]
I18n
::
Backend
::
Simple
.
include
(
I18n
::
Backend
::
Fallbacks
)
#读取配置文件
$config
=
Config
.
load
Config
.
save
#读取命令行参数
log
=
"log.log"
log_level
=
"INFO"
profile
=
nil
ARGV
.
each
do
|
arg
|
arg
=
arg
.
dup
.
force_encoding
(
"UTF-8"
)
arg
.
force_encoding
(
"GBK"
)
unless
arg
.
valid_encoding?
case
arg
when
/--log=(.*)/
log
.
replace
$1
when
/--log-level=(.*)/
log_level
.
replace
$1
when
/--profile=(.*)/
profile
=
$1
when
/^mycard:.*|\.ydk$|\.yrp$|\.deck$/
require_relative
'quickstart'
$scene
=
false
when
/register_association/
Association
.
register
$scene
=
false
end
end
unless
$scene
==
false
#加载文件
require
'logger'
require
'sdl'
include
SDL
require_relative
'dialog'
require_relative
'graphics'
require_relative
'window'
require_relative
'widget_msgbox'
#日志
if
log
==
"STDOUT"
#调试用
log
=
STDOUT
end
$log
=
Logger
.
new
(
log
,
1
,
1024000
)
$log
.
level
=
Logger
.
const_get
log_level
#性能分析
if
profile
if
profile
==
"STDOUT"
profile
=
STDOUT
else
profile
=
open
(
profile
,
'w'
)
end
require
'profiler'
RubyVM
::
InstructionSequence
.
compile_option
=
{
:trace_instruction
=>
true
,
:specialized_instruction
=>
false
}
Profiler__
::
start_profile
end
SDL
::
Event
::
APPMOUSEFOCUS
=
1
SDL
::
Event
::
APPINPUTFOCUS
=
2
SDL
::
Event
::
APPACTIVE
=
4
SDL
.
putenv
(
"SDL_VIDEO_CENTERED=1"
);
SDL
.
init
(
INIT_VIDEO
)
WM
::
set_caption
(
"MyCard"
,
"MyCard"
)
WM
::
icon
=
Surface
.
load
(
"graphics/system/icon.gif"
)
$screen
=
Screen
.
open
(
$config
[
'screen'
][
'width'
],
$config
[
'screen'
][
'height'
],
0
,
HWSURFACE
|
(
$config
[
'screen'
][
'fullscreen'
]
?
FULLSCREEN
:
0
))
TTF
.
init
#声音
begin
SDL
.
init
(
INIT_AUDIO
)
Mixer
.
open
(
Mixer
::
DEFAULT_FREQUENCY
,
Mixer
::
DEFAULT_FORMAT
,
Mixer
::
DEFAULT_CHANNELS
,
1536
)
Mixer
.
set_volume_music
(
60
)
rescue
nil
end
#标题场景
require_relative
'scene_title'
$scene
=
Scene_Title
.
new
#自动更新, 加载放到SDL前面会崩, 原因不明
require_relative
'update'
Update
.
start
WM
::
set_caption
(
"MyCard v
#{
Update
::
Version
}
"
,
"MyCard"
)
#文件关联
Association
.
start
#初始化完毕
$log
.
info
(
"main"
)
{
"初始化成功"
}
end
rescue
Exception
=>
exception
open
(
'error-程序出错请到论坛反馈.txt'
,
'w'
)
{
|
f
|
f
.
write
[
exception
.
inspect
,
*
exception
.
backtrace
].
join
(
"
\n
"
)
}
$scene
=
false
end
#主循环
begin
$scene
.
main
while
$scene
rescue
Exception
=>
exception
exception
.
backtrace
.
each
{
|
backtrace
|
break
if
backtrace
=~
/^(.*)\.rb:\d+:in `.*'"$/
}
#由于脚本是从main.rb开始执行的,总会有个能匹配成功的文件
$log
.
fatal
(
$1
)
{
[
exception
.
inspect
,
*
exception
.
backtrace
].
collect
{
|
str
|
str
.
force_encoding
(
"UTF-8"
)
}.
join
(
"
\n
"
)
}
$game
.
exit
if
$game
require_relative
'scene_error'
$scene
=
Scene_Error
.
new
retry
ensure
if
profile
Profiler__
::
print_profile
(
profile
)
profile
.
close
end
$log
.
close
rescue
nil
end
\ No newline at end of file
lib/update.rb
View file @
2cc864c5
This diff is collapsed.
Click to expand it.
lib/window_chat.rb
View file @
2cc864c5
This diff is collapsed.
Click to expand it.
lib/window_lobbybuttons.rb
View file @
2cc864c5
require_relative
'window_host'
class
Window_LobbyButtons
<
Window_List
def
initialize
(
x
,
y
)
@items
=
[
I18n
.
t
(
'lobby.faq'
),
I18n
.
t
(
'lobby.filter'
),
I18n
.
t
(
'lobby.editdeck'
),
I18n
.
t
(
'lobby.newroom'
)]
@button
=
Surface
.
load
(
"graphics/lobby/button.png"
)
super
(
x
,
y
,
@items
.
size
*
@button
.
w
/
3
+
@items
.
size
*
4
,
30
)
@font
=
TTF
.
open
(
"fonts/wqy-microhei.ttc"
,
15
)
refresh
end
def
draw_item
(
index
,
status
=
0
)
x
,
y
,
width
=
item_rect
(
index
)
Surface
.
blit
(
@button
,
status
*
@button
.
w
/
3
,
0
,
@button
.
w
/
3
,
@button
.
h
,
@contents
,
x
,
y
)
draw_stroked_text
(
@items
[
index
],
x
+
center_margin
(
@items
[
index
],
width
,
@font
),
y
+
3
,
2
,
@font
,
[
0xdf
,
0xf1
,
0xff
],
[
0x27
,
0x43
,
0x59
])
end
def
item_rect
(
index
)
[
index
*
@button
.
w
/
3
+
(
index
)
*
4
,
0
,
@button
.
w
/
3
,
@height
]
end
def
mousemoved
(
x
,
y
)
if
(
x
-
@x
)
%
(
@button
.
w
/
3
+
4
)
>=
@button
.
w
/
3
self
.
index
=
nil
else
self
.
index
=
(
x
-
@x
)
/
(
@button
.
w
/
3
+
4
)
end
end
def
lostfocus
(
active_window
=
nil
)
self
.
index
=
nil
end
def
clicked
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"
when
1
#房间筛选
if
@filter_window
and
!
@filter_window
.
destroyed?
@filter_window
.
destroy
else
@filter_window
=
Window_Filter
.
new
(
678
,
44
)
end
when
2
#卡组编辑
require_relative
'deck'
$game
.
class
.
deck_edit
when
3
#建立房间
@host_window
=
Window_Host
.
new
(
300
,
200
)
end
end
def
update
@host_window
.
update
if
@host_window
and
!
@host_window
.
destroyed?
end
end
require_relative
'window_host'
class
Window_LobbyButtons
<
Window_List
def
initialize
(
x
,
y
)
@items
=
[
I18n
.
t
(
'lobby.faq'
),
I18n
.
t
(
'lobby.filter'
),
I18n
.
t
(
'lobby.editdeck'
),
I18n
.
t
(
'lobby.newroom'
)]
@button
=
Surface
.
load
(
"graphics/lobby/button.png"
)
super
(
x
,
y
,
@items
.
size
*
@button
.
w
/
3
+
@items
.
size
*
4
,
30
)
@font
=
TTF
.
open
(
"fonts/wqy-microhei.ttc"
,
15
)
refresh
end
def
draw_item
(
index
,
status
=
0
)
x
,
y
,
width
=
item_rect
(
index
)
Surface
.
blit
(
@button
,
status
*
@button
.
w
/
3
,
0
,
@button
.
w
/
3
,
@button
.
h
,
@contents
,
x
,
y
)
draw_stroked_text
(
@items
[
index
],
x
+
center_margin
(
@items
[
index
],
width
,
@font
),
y
+
3
,
2
,
@font
,
[
0xdf
,
0xf1
,
0xff
],
[
0x27
,
0x43
,
0x59
])
end
def
item_rect
(
index
)
[
index
*
@button
.
w
/
3
+
(
index
)
*
4
,
0
,
@button
.
w
/
3
,
@height
]
end
def
mousemoved
(
x
,
y
)
if
(
x
-
@x
)
%
(
@button
.
w
/
3
+
4
)
>=
@button
.
w
/
3
self
.
index
=
nil
else
self
.
index
=
(
x
-
@x
)
/
(
@button
.
w
/
3
+
4
)
end
end
def
lostfocus
(
active_window
=
nil
)
self
.
index
=
nil
end
def
clicked
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"
when
1
#房间筛选
if
@filter_window
and
!
@filter_window
.
destroyed?
@filter_window
.
destroy
else
@filter_window
=
Window_Filter
.
new
(
678
,
44
)
end
when
2
#卡组编辑
require_relative
'deck'
$game
.
class
.
deck_edit
when
3
#建立房间
@host_window
=
Window_Host
.
new
(
300
,
200
)
end
end
def
update
@host_window
.
update
if
@host_window
and
!
@host_window
.
destroyed?
end
end
lib/window_userinfo.rb
View file @
2cc864c5
#encoding: UTF-8
#==============================================================================
# Window_UserInfo
#------------------------------------------------------------------------------
# 游戏大厅显示用户信息的类
#==============================================================================
class
Window_UserInfo
<
Window
def
initialize
(
x
,
y
,
user
)
@avatar_boarder
=
Surface
.
load
(
"graphics/lobby/avatar_boader.png"
)
super
(
x
,
y
,
280
,
144
)
@font
=
TTF
.
open
(
'fonts/wqy-microhei.ttc'
,
16
)
@user
=
user
@background
=
Surface
.
load
(
"graphics/lobby/userinfo.png"
).
display_format
refresh
end
def
refresh
@contents
.
put
(
@background
,
0
,
0
)
@thread
=
@user
.
avatar
(
:middle
)
do
|
avatar
|
clear
(
0
,
0
,
@avatar_boarder
.
w
,
@avatar_boarder
.
h
)
@contents
.
put
(
avatar
,
12
,
12
)
@contents
.
put
(
@avatar_boarder
,
0
,
0
)
end
@font
.
draw_blended_utf8
(
@contents
,
@user
.
name
,
160
,
12
,
0x00
,
0x00
,
0x00
)
unless
@user
.
name
.
empty?
@font
.
draw_blended_utf8
(
@contents
,
@user
.
id
.
to_s
,
160
,
12
+
16
*
2
,
0x00
,
0x00
,
0x00
)
unless
@user
.
id
.
to_s
.
empty?
@font
.
draw_blended_utf8
(
@contents
,
"Lv:
#{
@user
.
level
}
"
,
160
,
12
+
16
*
3
,
0x00
,
0x00
,
0x00
)
if
@user
.
respond_to?
:level
and
@user
.
level
#TODO:规范化,level是iduel专属的,但是又不太想让iduel来重定义这个window
@font
.
draw_blended_utf8
(
@contents
,
"经验:
#{
@user
.
exp
}
"
,
160
,
12
+
16
*
4
,
0x00
,
0x00
,
0x00
)
if
@user
.
respond_to?
:exp
and
@user
.
exp
end
def
dispose
@thread
.
exit
super
end
end
#encoding: UTF-8
#==============================================================================
# Window_UserInfo
#------------------------------------------------------------------------------
# 游戏大厅显示用户信息的类
#==============================================================================
class
Window_UserInfo
<
Window
def
initialize
(
x
,
y
,
user
)
@avatar_boarder
=
Surface
.
load
(
"graphics/lobby/avatar_boader.png"
)
super
(
x
,
y
,
280
,
144
)
@font
=
TTF
.
open
(
'fonts/wqy-microhei.ttc'
,
16
)
@user
=
user
@background
=
Surface
.
load
(
"graphics/lobby/userinfo.png"
).
display_format
refresh
end
def
refresh
@contents
.
put
(
@background
,
0
,
0
)
@thread
=
@user
.
avatar
(
:middle
)
do
|
avatar
|
clear
(
0
,
0
,
@avatar_boarder
.
w
,
@avatar_boarder
.
h
)
@contents
.
put
(
avatar
,
12
,
12
)
@contents
.
put
(
@avatar_boarder
,
0
,
0
)
end
@font
.
draw_blended_utf8
(
@contents
,
@user
.
name
,
160
,
12
,
0x00
,
0x00
,
0x00
)
unless
@user
.
name
.
empty?
@font
.
draw_blended_utf8
(
@contents
,
@user
.
id
.
to_s
,
160
,
12
+
16
*
2
,
0x00
,
0x00
,
0x00
)
unless
@user
.
id
.
to_s
.
empty?
@font
.
draw_blended_utf8
(
@contents
,
"Lv:
#{
@user
.
level
}
"
,
160
,
12
+
16
*
3
,
0x00
,
0x00
,
0x00
)
if
@user
.
respond_to?
:level
and
@user
.
level
#TODO:规范化,level是iduel专属的,但是又不太想让iduel来重定义这个window
@font
.
draw_blended_utf8
(
@contents
,
"经验:
#{
@user
.
exp
}
"
,
160
,
12
+
16
*
4
,
0x00
,
0x00
,
0x00
)
if
@user
.
respond_to?
:exp
and
@user
.
exp
end
def
dispose
@thread
.
exit
super
end
end
lib/ygocore/game.rb
View file @
2cc864c5
This diff is collapsed.
Click to expand it.
lib/ygocore/room.rb
View file @
2cc864c5
class
Room
attr_accessor
:pvp
attr_accessor
:match
attr_accessor
:tag
attr_accessor
:ot
attr_accessor
:lp
attr_accessor
:status
attr_accessor
:server
alias
pvp?
pvp
alias
match?
match
alias
tag?
tag
def
lp
@lp
||=
8000
end
def
ot
@ot
||=
0
end
def
full?
$game
.
is_a?
(
Ygocore
)
?
(
@status
==
:
start
)
:
player2
#不规范修正iduel房间识别问题
end
def
extra
result
=
{}
if
pvp?
result
[
"[竞技场]"
]
=
[
255
,
0
,
0
]
end
if
tag?
result
[
"[TAG双打]"
]
=
[
128
,
0
,
255
]
elsif
match?
result
[
"[三回决斗]"
]
=
[
0xff
,
0x72
,
0
]
end
if
ot
==
1
result
[
"[TCG]"
]
=
[
255
,
0
,
0
]
elsif
ot
==
2
result
[
"[O/T混]"
]
=
[
255
,
0
,
0
]
end
if
lp
!=
8000
result
[
"[LP:
#{
lp
}
]"
]
=
[
255
,
0
,
0
]
end
result
end
def
host_server
servers
=
$game
.
servers
servers
.
select!
{
|
server
|
server
.
auth
}
if
@pvp
s
=
servers
&
$game
.
filter
[
:servers
]
servers
=
s
if
!
s
.
empty?
server
=
servers
.
min_by
{
|
server
|
$game
.
rooms
.
select
{
|
room
|
room
.
server
==
server
}.
size
}
p
server
server
||=
Server
.
new
(
nil
,
""
,
$game
.
server
,
$game
.
port
,
true
)
self
.
server
=
server
server
end
end
class
Room
attr_accessor
:pvp
attr_accessor
:match
attr_accessor
:tag
attr_accessor
:ot
attr_accessor
:lp
attr_accessor
:status
attr_accessor
:server
alias
pvp?
pvp
alias
match?
match
alias
tag?
tag
def
lp
@lp
||=
8000
end
def
ot
@ot
||=
0
end
def
full?
$game
.
is_a?
(
Ygocore
)
?
(
@status
==
:
start
)
:
player2
#不规范修正iduel房间识别问题
end
def
extra
result
=
{}
if
pvp?
result
[
"[竞技场]"
]
=
[
255
,
0
,
0
]
end
if
tag?
result
[
"[TAG双打]"
]
=
[
128
,
0
,
255
]
elsif
match?
result
[
"[三回决斗]"
]
=
[
0xff
,
0x72
,
0
]
end
if
ot
==
1
result
[
"[TCG]"
]
=
[
255
,
0
,
0
]
elsif
ot
==
2
result
[
"[O/T混]"
]
=
[
255
,
0
,
0
]
end
if
lp
!=
8000
result
[
"[LP:
#{
lp
}
]"
]
=
[
255
,
0
,
0
]
end
result
end
def
host_server
servers
=
$game
.
servers
servers
.
select!
{
|
server
|
server
.
auth
}
if
@pvp
s
=
servers
&
$game
.
filter
[
:servers
]
servers
=
s
if
!
s
.
empty?
server
=
servers
.
min_by
{
|
server
|
$game
.
rooms
.
select
{
|
room
|
room
.
server
==
server
}.
size
}
p
server
server
||=
Server
.
new
(
nil
,
""
,
$game
.
server
,
$game
.
port
,
true
)
self
.
server
=
server
server
end
end
locales/ja.yml
View file @
2cc864c5
ja
:
ja
:
name
:
"
日本語"
\ No newline at end of file
locales/zh-OS.yml
View file @
2cc864c5
zh-OS
:
zh-OS
:
name
:
"
中文(OcgSoft)"
\ No newline at end of file
locales/zh-TW.yml
View file @
2cc864c5
zh-TW
:
zh-TW
:
name
:
"
中文(繁体)"
\ No newline at end of file
locales/zh.yml
View file @
2cc864c5
en
:
lang
:
"
中文"
chat
:
room
:
"
lobby.zh"
server
:
"
conference.my-card.in"
login
:
name
:
"
用户名"
password
:
"
密码"
login
:
"
登录"
register
:
"
注册"
remember
:
"
记住密码"
replay
:
"
录像"
lobby
:
faq
:
"
常见问题"
editdeck
:
"
卡组编辑"
newroom
:
"
建立房间"
lobby
:
"
大厅"
filter
:
"
房间筛选"
waiting_only
:
"
仅等待中"
normal_only
:
"
仅标准房"
en
:
lang
:
"
中文"
chat
:
room
:
"
lobby.zh"
server
:
"
conference.my-card.in"
login
:
name
:
"
用户名"
password
:
"
密码"
login
:
"
登录"
register
:
"
注册"
remember
:
"
记住密码"
replay
:
"
录像"
lobby
:
faq
:
"
常见问题"
editdeck
:
"
卡组编辑"
newroom
:
"
建立房间"
lobby
:
"
大厅"
filter
:
"
房间筛选"
waiting_only
:
"
仅等待中"
normal_only
:
"
仅标准房"
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