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
xiaoye
mycard
Commits
2a2cbaa9
Commit
2a2cbaa9
authored
Dec 09, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.8.2
parent
cd38339e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
231 additions
and
223 deletions
+231
-223
Rakefile
Rakefile
+64
-64
lib/scene_lobby.rb
lib/scene_lobby.rb
+20
-12
lib/update.rb
lib/update.rb
+146
-146
lib/ygocore/game.rb
lib/ygocore/game.rb
+1
-1
No files found.
Rakefile
View file @
2a2cbaa9
#encoding: UTF-8
#encoding: UTF-8
require
'rubygems'
require
'rubygems'
require
'rake'
require
'rake'
require
'rake/clean'
require
'rake/clean'
require
'rubygems/package_task'
require
'rubygems/package_task'
require
'rdoc/task'
require
'rdoc/task'
#require 'rake/testtask'
#require 'rake/testtask'
Windows
=
RUBY_PLATFORM
[
"mingw"
]
||
RUBY_PLATFORM
[
"mswin"
]
Windows
=
RUBY_PLATFORM
[
"mingw"
]
||
RUBY_PLATFORM
[
"mswin"
]
#在windows上UTF-8脚本编码环境中 Dir.glob无法列出中文目录下的文件 所以自己写个递归
#在windows上UTF-8脚本编码环境中 Dir.glob无法列出中文目录下的文件 所以自己写个递归
def
list
(
path
)
def
list
(
path
)
result
=
[]
result
=
[]
Dir
.
foreach
(
path
)
do
|
file
|
Dir
.
foreach
(
path
)
do
|
file
|
next
if
file
==
"."
or
file
==
".."
next
if
file
==
"."
or
file
==
".."
result
<<
"
#{
path
}
/
#{
file
}
"
result
<<
"
#{
path
}
/
#{
file
}
"
result
.
concat
list
(
result
.
last
)
if
File
.
directory?
result
.
last
result
.
concat
list
(
result
.
last
)
if
File
.
directory?
result
.
last
end
end
rescue
p
$!
result
result
end
end
spec
=
Gem
::
Specification
.
new
do
|
s
|
spec
=
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
'mycard'
s
.
name
=
'mycard'
s
.
version
=
'0.
7.4'
s
.
version
=
'0.
8.2'
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
s
.
author
=
'zh99998'
s
.
author
=
'zh99998'
s
.
email
=
'zh99998@gmail.com'
s
.
email
=
'zh99998@gmail.com'
s
.
homepage
=
'http://
card.touhou,cc'
s
.
homepage
=
'http://
my-card.in'
# s.executables = ['your_executable_here']
# s.executables = ['your_executable_here']
s
.
files
=
%w(LICENSE.txt README.txt
replay)
s
.
files
=
%w(LICENSE.txt README.txt
config.yml replay)
%w{lib audio data fonts
graphics ygocore}
.
each
{
|
dir
|
s
.
files
.
concat
list
(
dir
)}
%w{lib audio data fonts
locales graphics ygocore}
.
each
{
|
dir
|
s
.
files
.
concat
list
(
dir
)}
if
Windows
if
Windows
s
.
files
+=
%w(mycard.exe)
+
list
(
"ruby"
)
s
.
files
+=
%w(mycard.exe)
+
list
(
"ruby"
)
else
else
s
.
files
+=
%w(install.sh)
s
.
files
+=
%w(install.sh)
end
end
s
.
require_path
=
"lib"
s
.
require_path
=
"lib"
#s.bindir = "bin"
#s.bindir = "bin"
end
end
Gem
::
PackageTask
.
new
(
spec
)
do
|
p
|
Gem
::
PackageTask
.
new
(
spec
)
do
|
p
|
p
.
gem_spec
=
spec
p
.
gem_spec
=
spec
if
Windows
if
Windows
p
.
need_zip
=
true
p
.
need_zip
=
true
p
.
zip_command
=
'
../7z.exe a'
p
.
zip_command
=
'
7z a'
def
p
.
zip_file
def
p
.
zip_file
"
#{
package_name
}
-win32.7z"
"
#{
package_name
}
-win32.7z"
end
end
else
else
p
.
need_tar
=
true
p
.
need_tar
=
true
end
end
end
end
Rake
::
RDocTask
.
new
do
|
rdoc
|
Rake
::
RDocTask
.
new
do
|
rdoc
|
files
=
[
'README.txt'
,
'LICENSE.txt'
,
'lib/**/*.rb'
]
files
=
[
'README.txt'
,
'LICENSE.txt'
,
'lib/**/*.rb'
]
rdoc
.
rdoc_files
.
add
(
files
)
rdoc
.
rdoc_files
.
add
(
files
)
rdoc
.
main
=
"README.txt"
# page to start on
rdoc
.
main
=
"README.txt"
# page to start on
rdoc
.
title
=
"Mycard Docs"
rdoc
.
title
=
"Mycard Docs"
rdoc
.
rdoc_dir
=
'doc/rdoc'
# rdoc output folder
rdoc
.
rdoc_dir
=
'doc/rdoc'
# rdoc output folder
rdoc
.
options
<<
'--line-numbers'
rdoc
.
options
<<
'--line-numbers'
end
end
CLOBBER
.
include
%w(error-程序出错请到论坛反馈.txt log.log profile.log config.yml doc ygocore/pics)
+
list
(
'replay'
)
+
list
(
'ygocore/replay'
)
+
list
(
'.'
).
keep_if
{
|
file
|
File
.
basename
(
file
)
==
"Thumbs.db"
}
+
list
(
"graphics/avatars"
).
keep_if
{
|
file
|
File
.
basename
(
file
)
=~
/.*_(?:small|middle|large)\.png/
}
+
list
(
"ygocore/deck"
).
keep_if
{
|
file
|
File
.
basename
(
file
)
!=
'sample.ydk'
}
CLOBBER
.
include
%w(error-程序出错请到论坛反馈.txt log.log profile.log config.yml doc ygocore/pics)
+
list
(
'replay'
)
+
list
(
'ygocore/replay'
)
+
list
(
'.'
).
keep_if
{
|
file
|
File
.
basename
(
file
)
==
"Thumbs.db"
}
+
list
(
"graphics/avatars"
).
reject
{
|
file
|
File
.
basename
(
file
)
=~
/(?:error|loading)_(?:small|middle|large)\.png/
}
+
list
(
"ygocore/deck"
).
keep_if
{
|
file
|
File
.
basename
(
file
)
!=
'sample.ydk'
}
lib/scene_lobby.rb
View file @
2a2cbaa9
...
@@ -16,23 +16,26 @@ class Scene_Lobby < Scene
...
@@ -16,23 +16,26 @@ class Scene_Lobby < Scene
require_relative
'chatmessage'
require_relative
'chatmessage'
require_relative
'scene_duel'
require_relative
'scene_duel'
attr_reader
:chat_window
attr_reader
:chat_window
def
start
def
start
WM
::
set_caption
(
"MyCard v
#{
Update
::
Version
}
-
#{
$config
[
'game'
]
}
-
#{
$game
.
user
.
name
}
(
#{
$game
.
user
.
id
}
)"
,
"MyCard"
)
WM
::
set_caption
(
"MyCard v
#{
Update
::
Version
}
-
#{
$config
[
'game'
]
}
-
#{
$game
.
user
.
name
}
(
#{
$game
.
user
.
id
}
)"
,
"MyCard"
)
$game
.
refresh
$game
.
refresh
@background
=
Graphics
.
load
(
'lobby'
,
'background'
,
false
)
@background
=
Graphics
.
load
(
'lobby'
,
'background'
,
false
)
Surface
.
blit
(
@background
,
0
,
0
,
0
,
0
,
$screen
,
0
,
0
)
Surface
.
blit
(
@background
,
0
,
0
,
0
,
0
,
$screen
,
0
,
0
)
@userlist
=
Window_UserList
.
new
(
24
,
204
,
$game
.
users
)
@userlist
=
Window_UserList
.
new
(
24
,
204
,
$game
.
users
)
@roomlist
=
Window_RoomList
.
new
(
320
,
50
,
$game
.
rooms
)
@roomlist
=
Window_RoomList
.
new
(
320
,
50
,
$game
.
rooms
)
@userinfo
=
Window_UserInfo
.
new
(
24
,
24
,
$game
.
user
)
@userinfo
=
Window_UserInfo
.
new
(
24
,
24
,
$game
.
user
)
@host_window
=
Window_LobbyButtons
.
new
(
678
,
18
)
@host_window
=
Window_LobbyButtons
.
new
(
678
,
18
)
@active_window
=
@roomlist
@active_window
=
@roomlist
@chat_window
=
Window_Chat
.
new
(
313
,
$config
[
'screen'
][
'height'
]
-
225
,
698
,
212
)
@chat_window
=
Window_Chat
.
new
(
313
,
$config
[
'screen'
][
'height'
]
-
225
,
698
,
212
)
@count
=
0
@count
=
0
super
super
end
end
def
bgm
def
bgm
"lobby.ogg"
"lobby.ogg"
end
end
def
handle
(
event
)
def
handle
(
event
)
case
event
case
event
when
Event
::
KeyDown
when
Event
::
KeyDown
...
@@ -62,10 +65,12 @@ class Scene_Lobby < Scene
...
@@ -62,10 +65,12 @@ class Scene_Lobby < Scene
case
event
case
event
when
Game_Event
::
AllUsers
when
Game_Event
::
AllUsers
@userlist
.
items
=
$game
.
users
@userlist
.
items
=
$game
.
users
when
Game_Event
::
AllRooms
when
Game_Event
::
AllRooms
,
Game_Event
::
AllServers
@roomlist
.
items
=
$game
.
rooms
.
find_all
{
|
room
|
$game
.
filter
[
:servers
].
collect
{
|
server
|
server
.
id
}.
include?
(
room
.
server_id
)}
@roomlist
.
items
=
$game
.
rooms
.
find_all
{
|
room
|
when
Game_Event
::
AllServers
$game
.
filter
[
:servers
].
collect
{
|
server
|
server
.
id
}.
include?
(
room
.
server_id
)
and
@roomlist
.
items
=
$game
.
rooms
.
find_all
{
|
room
|
$game
.
filter
[
:servers
].
collect
{
|
server
|
server
.
id
}.
include?
(
room
.
server_id
)}
$game
.
filter
[
:waiting_only
]
?
(
room
.
status
==
:
wait
)
:
true
and
$game
.
filter
[
:normal_only
]
?
(
!
room
.
tag?
&&
(
room
.
ot
==
0
)
&&
(
room
.
lp
=
8000
))
:
true
}
when
Game_Event
::
Join
when
Game_Event
::
Join
join
(
event
.
room
)
join
(
event
.
room
)
when
Game_Event
::
Watch
when
Game_Event
::
Watch
...
@@ -77,9 +82,11 @@ class Scene_Lobby < Scene
...
@@ -77,9 +82,11 @@ class Scene_Lobby < Scene
super
super
end
end
end
end
def
join
(
room
)
def
join
(
room
)
$scene
=
Scene_Duel
.
new
(
room
)
$scene
=
Scene_Duel
.
new
(
room
)
end
end
def
update
def
update
@chat_window
.
update
@chat_window
.
update
@host_window
.
update
@host_window
.
update
...
@@ -91,6 +98,7 @@ class Scene_Lobby < Scene
...
@@ -91,6 +98,7 @@ class Scene_Lobby < Scene
@count
+=
1
@count
+=
1
super
super
end
end
def
terminate
def
terminate
unless
$scene
.
is_a?
Scene_Lobby
or
$scene
.
is_a?
Scene_Duel
unless
$scene
.
is_a?
Scene_Lobby
or
$scene
.
is_a?
Scene_Duel
$game
.
exit
$game
.
exit
...
...
lib/update.rb
View file @
2a2cbaa9
This diff is collapsed.
Click to expand it.
lib/ygocore/game.rb
View file @
2a2cbaa9
...
@@ -77,7 +77,7 @@ class Ygocore < Game
...
@@ -77,7 +77,7 @@ class Ygocore < Game
def
connect
def
connect
@recv
=
Thread
.
new
do
@recv
=
Thread
.
new
do
EventMachine
::
run
{
EventMachine
::
run
{
EventMachine
::
connect
"
localhost
"
,
9997
,
Client
EventMachine
::
connect
"
mycard-server.my-card.in
"
,
9997
,
Client
}
}
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