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
94abfebd
Commit
94abfebd
authored
Mar 12, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0x1023,服务器配置文件独立
parent
77b2062f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
lib/ygocore/event.rb
lib/ygocore/event.rb
+1
-1
lib/ygocore/game.rb
lib/ygocore/game.rb
+8
-11
lib/ygocore/server.yml
lib/ygocore/server.yml
+6
-0
No files found.
lib/ygocore/event.rb
View file @
94abfebd
#encoding: UTF-8
class
Game_Event
User_Filter
=
/<li>(:::观战:|===决斗1=|===决斗2=)<font color="(?:blue|gray)">(.+?)(\(未认证\)|)<\/font>;<\/li>/
Room_Filter
=
/<div style="width:300px; height:150px; border:1px #ececec solid; float:left;padding:5px; margin:5px;">房间名称:(.+?)
(<font color=(?:\")?red(?:\")?>决斗已开始!<\/font>|<font color=(?:\")?blue(?:\")?>等待<\/font>)(<font color="#CC6633" title="竞技场,接受服务器录像、场次统计,非认证玩家不得加入">\[竞\]<\/font>|
)<font size="1">\(ID:(\d+)\)<\/font>
#{
User_Filter
}
+?<\/div>/
Room_Filter
=
/<div style="width:300px; height:150px; border:1px #ececec solid; float:left;padding:5px; margin:5px;">房间名称:(.+?)
(<font color="d28311" title="竞技场模式">\[竞\]<\/font>|) (<font color=(?:\")?red(?:\")?>决斗已开始!<\/font>|<font color=(?:\")?blue(?:\")?>等待<\/font>
)<font size="1">\(ID:(\d+)\)<\/font>
#{
User_Filter
}
+?<\/div>/
class
AllRooms
<
Game_Event
def
self
.
parse
(
info
)
@rooms
=
[]
...
...
lib/ygocore/game.rb
View file @
94abfebd
...
...
@@ -2,11 +2,12 @@
load
File
.
expand_path
(
'window_login.rb'
,
File
.
dirname
(
__FILE__
))
require
'open-uri'
class
Ygocore
<
Game
Register_Url
=
'http://card.touhou.cc/register'
#用户点击注册时打开的地址
Port
=
7911
#加入房间时填写到ygocore的服务器端口
Server
=
'140.113.242.65'
#加入房间时填写到ygocore的服务器IP
API_Url
=
'http://card.touhou.cc:7922/'
#获取房间列表和公告的地址
Index_Url
=
'http://card.touhou.cc/'
#用户点击公告之后打开的地址
config
=
YAML
.
load_file
(
"lib/ygocore/server.yml"
)
Register_Url
=
config
[
'register'
]
Port
=
config
[
'port'
]
Server
=
config
[
'server'
]
API_Url
=
config
[
'api'
]
Index_Url
=
config
[
'index'
]
WM_LBUTTONDOWN
=
0x201
WM_LBUTTONUP
=
0x202
...
...
@@ -36,12 +37,8 @@ class Ygocore < Game
end
def
host
(
room_name
,
room_config
)
room
=
Room
.
new
(
0
,
room_name
)
if
room_config
[
:pvp
]
room
.
pvp
=
true
end
if
room_config
[
:match
]
room
.
match
=
true
end
room
.
pvp
=
room_config
[
:pvp
]
room
.
match
=
room_config
[
:match
]
join
room
end
def
watch
(
room
)
...
...
lib/ygocore/server.yml
0 → 100644
View file @
94abfebd
---
register
:
http://card.touhou.cc/regist.html
api
:
http://140.113.242.66:7922/
index
:
http://card.touhou.cc/
server
:
140.113.242.66
port
:
7911
\ No newline at end of file
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