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
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
#encoding: UTF-8
class
Game_Event
class
Game_Event
User_Filter
=
/<li>(:::观战:|===决斗1=|===决斗2=)<font color="(?:blue|gray)">(.+?)(\(未认证\)|)<\/font>;<\/li>/
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
class
AllRooms
<
Game_Event
def
self
.
parse
(
info
)
def
self
.
parse
(
info
)
@rooms
=
[]
@rooms
=
[]
...
...
lib/ygocore/game.rb
View file @
94abfebd
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
load
File
.
expand_path
(
'window_login.rb'
,
File
.
dirname
(
__FILE__
))
load
File
.
expand_path
(
'window_login.rb'
,
File
.
dirname
(
__FILE__
))
require
'open-uri'
require
'open-uri'
class
Ygocore
<
Game
class
Ygocore
<
Game
Register_Url
=
'http://card.touhou.cc/register'
#用户点击注册时打开的地址
config
=
YAML
.
load_file
(
"lib/ygocore/server.yml"
)
Port
=
7911
#加入房间时填写到ygocore的服务器端口
Register_Url
=
config
[
'register'
]
Server
=
'140.113.242.65'
#加入房间时填写到ygocore的服务器IP
Port
=
config
[
'port'
]
API_Url
=
'http://card.touhou.cc:7922/'
#获取房间列表和公告的地址
Server
=
config
[
'server'
]
Index_Url
=
'http://card.touhou.cc/'
#用户点击公告之后打开的地址
API_Url
=
config
[
'api'
]
Index_Url
=
config
[
'index'
]
WM_LBUTTONDOWN
=
0x201
WM_LBUTTONDOWN
=
0x201
WM_LBUTTONUP
=
0x202
WM_LBUTTONUP
=
0x202
...
@@ -36,12 +37,8 @@ class Ygocore < Game
...
@@ -36,12 +37,8 @@ class Ygocore < Game
end
end
def
host
(
room_name
,
room_config
)
def
host
(
room_name
,
room_config
)
room
=
Room
.
new
(
0
,
room_name
)
room
=
Room
.
new
(
0
,
room_name
)
if
room_config
[
:pvp
]
room
.
pvp
=
room_config
[
:pvp
]
room
.
pvp
=
true
room
.
match
=
room_config
[
:match
]
end
if
room_config
[
:match
]
room
.
match
=
true
end
join
room
join
room
end
end
def
watch
(
room
)
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