Commit 94abfebd authored by 神楽坂玲奈's avatar 神楽坂玲奈

0x1023,服务器配置文件独立

parent 77b2062f
#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 = []
......
......@@ -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)
......
---
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment